RockBLOCK 9704 C Library
Doxygen documentation for the RockBLOCK 9704 C Library.
Loading...
Searching...
No Matches
Functions | Variables
imt_queue.c File Reference
#include "imt_queue.h"

Functions

bool imtQueueMoAdd (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.
 
void imtQueueMtLock (bool lock)
 Lock or unlock the MT queue to prevent messages from getting discarded if full.
 
imt_timtQueueMoGetFirst (void)
 Get the address of the head of the MO queue.
 
imt_timtQueueMtGetFirst (void)
 Get the address of the head of the MT queue.
 
imt_timtQueueMtGetLast (void)
 Get the address of the latest message in the MT 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.
 
void imtQueueInit (void)
 Used to initialise both outgoing and incoming queues.
 

Variables

static imt_queue_t imtMo
 
static imt_queue_t imtMt
 
static uint8_t imtMoBuffer [1U][100000U+2U]
 
static uint8_t imtMtBuffer [1U][100000U+2U]
 
static volatile bool mtLock = false
 

Function Documentation

◆ 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
topicMessage topic ID.
dataPointer to the message payload.
lengthMessage 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
topicMessage topic ID.
idUnique identifier of the message assigned by the modem.
lengthMessage 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
lockCalled 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.

Variable Documentation

◆ imtMo

imt_queue_t imtMo
static

◆ imtMoBuffer

uint8_t imtMoBuffer[1U][100000U+ 2U]
static

◆ imtMt

imt_queue_t imtMt
static

◆ imtMtBuffer

uint8_t imtMtBuffer[1U][100000U+ 2U]
static

◆ mtLock

volatile bool mtLock = false
static