#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
Go to the source code of this file.
|
#define | IMT_QUEUE_SIZE 1U |
| Number of messages allowed in the internal message queue.
|
|
#define | IMT_CRC_SIZE 2U |
| Number of bytes reserved for CRC at the end of the payload.
|
|
#define | IMT_PAYLOAD_SIZE 100000U + IMT_CRC_SIZE |
| Maximum payload size of a single message with the CRC added on.
|
|
|
bool | imtQueueMoAdd (const uint16_t topic, const char *data, const size_t length) |
| Add an outgoing mobile-originated (MO) message to the queue.
|
|
bool | imtQueueMtAdd (const uint16_t topic, const uint16_t id, const size_t length) |
| Add an incoming mobile-terminated (MT) message to the queue.
|
|
bool | imtQueueMoRemove (void) |
| Remove an outgoing mobile-originated (MO) message from the queue.
|
|
bool | imtQueueMtRemove (void) |
| Remove an outgoing mobile-terminated (MT) message from the queue.
|
|
imt_t * | imtQueueMoGetFirst (void) |
| Get the address of the head of the MO queue.
|
|
imt_t * | imtQueueMtGetFirst (void) |
| Get the address of the head of the MT queue.
|
|
imt_t * | imtQueueMtGetLast (void) |
| Get the address of the latest message in the MT queue.
|
|
void | imtQueueMtLock (bool lock) |
| Lock or unlock the MT queue to prevent messages from getting discarded if full.
|
|
void | imtQueueInit (void) |
| Used to initialise both outgoing and incoming queues.
|
|
size_t | imtQueueSize (imt_queue_t *queue) |
| Inline function used to get the current size of the selected queue.
|
|
◆ IMT_CRC_SIZE
Number of bytes reserved for CRC at the end of the payload.
◆ IMT_PAYLOAD_SIZE
Maximum payload size of a single message with the CRC added on.
◆ IMT_QUEUE_SIZE
#define IMT_QUEUE_SIZE 1U |
Number of messages allowed in the internal message queue.
◆ imtQueueInit()
void imtQueueInit |
( |
void |
| ) |
|
Used to initialise both outgoing and incoming queues.
◆ imtQueueMoAdd()
bool imtQueueMoAdd |
( |
const uint16_t |
topic, |
|
|
const char * |
data, |
|
|
const size_t |
length |
|
) |
| |
Add an outgoing mobile-originated (MO) message to the queue.
- Parameters
-
topic | Message topic ID. |
data | Pointer to the message payload. |
length | Message payload length in bytes. |
- Returns
- Bool indicating success or failure to add the message to the queue.
◆ imtQueueMoGetFirst()
imt_t * imtQueueMoGetFirst |
( |
void |
| ) |
|
Get the address of the head of the MO queue.
- Returns
- Pointer to the next message in the queue, NULL if queue is empty.
◆ imtQueueMoRemove()
bool imtQueueMoRemove |
( |
void |
| ) |
|
Remove an outgoing mobile-originated (MO) message from the queue.
- Returns
- Bool indicating success or failure to remove the message from the queue.
◆ imtQueueMtAdd()
bool imtQueueMtAdd |
( |
const uint16_t |
topic, |
|
|
const uint16_t |
id, |
|
|
const size_t |
length |
|
) |
| |
Add an incoming mobile-terminated (MT) message to the queue.
- Parameters
-
topic | Message topic ID. |
id | Unique identifier of the message assigned by the modem. |
length | Message payload length in bytes. |
- Returns
- Bool indicating success or failure to add the message to the queue.
◆ imtQueueMtGetFirst()
imt_t * imtQueueMtGetFirst |
( |
void |
| ) |
|
Get the address of the head of the MT queue.
- Returns
- Pointer to the next message in the queue, NULL if queue is empty.
◆ imtQueueMtGetLast()
imt_t * imtQueueMtGetLast |
( |
void |
| ) |
|
Get the address of the latest message in the MT queue.
- Returns
- Pointer to the last message in the queue, NULL if queue is empty.
◆ imtQueueMtLock()
void imtQueueMtLock |
( |
bool |
lock | ) |
|
Lock or unlock the MT queue to prevent messages from getting discarded if full.
- Parameters
-
lock | Called with true to lock the queue and false to unlock the queue. |
- Note
- This is set to false by default.
◆ imtQueueMtRemove()
bool imtQueueMtRemove |
( |
void |
| ) |
|
Remove an outgoing mobile-terminated (MT) message from the queue.
- Returns
- Bool indicating success or failure to remove the message from the queue.
◆ imtQueueSize()
Inline function used to get the current size of the selected queue.
- Parameters
-
queue | Pointer to the selected queue. |
- Returns
- size_t of the current queue size.