Queue
RTOS queue functions. More...
Functions | |
zos_result_t | zn_rtos_queue_init (zos_queue_t *queue, uint32_t message_size, uint32_t number_of_messages) |
Initializes a queueInitialises a FIFO queue. More... | |
zos_result_t | zn_rtos_queue_push (zos_queue_t *queue, const void *message, uint32_t timeout_ms) |
Pushes an object onto a queuePushes an object onto a queue. More... | |
zos_result_t | zn_rtos_queue_pop (zos_queue_t *queue, void *message, uint32_t timeout_ms) |
Pops an object off a queuePops an object off a queue. More... | |
uint32_t | zn_rtos_queue_get_count (zos_queue_t *queue) |
Get number of elements in queue. More... | |
zos_result_t | zn_rtos_queue_deinit (zos_queue_t *queue) |
De-initialise a queueDeletes a queue created with zn_rtos_queue_init() More... | |
zos_bool_t | zn_rtos_queue_is_empty (zos_queue_t *queue) |
Check if a queue is empty. More... | |
zos_bool_t | zn_rtos_queue_is_full (zos_queue_t *queue) |
Check if a queue is full. More... | |
Detailed Description
RTOS queue functions.
Function Documentation
zos_result_t zn_rtos_queue_deinit | ( | zos_queue_t * | queue | ) |
De-initialise a queueDeletes a queue created with zn_rtos_queue_init()
- Parameters
-
queue
: a pointer to the queue handle
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
uint32_t zn_rtos_queue_get_count | ( | zos_queue_t * | queue | ) |
Get number of elements in queue.
zos_result_t zn_rtos_queue_init | ( | zos_queue_t * | queue, |
uint32_t | message_size, |
||
uint32_t | number_of_messages |
||
) |
Initializes a queueInitialises a FIFO queue.
- Parameters
-
queue
: a pointer to the queue handle to be initialised message_size
: size in bytes of objects that will be held in the queue number_of_messages
: depth of the queue - i.e. max number of objects in the queue
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_bool_t zn_rtos_queue_is_empty | ( | zos_queue_t * | queue | ) |
Check if a queue is empty.
- Parameters
-
queue
: a pointer to the queue handle
zos_bool_t zn_rtos_queue_is_full | ( | zos_queue_t * | queue | ) |
Check if a queue is full.
- Parameters
-
queue
: a pointer to the queue handle
- Returns
- ZOS_SUCCESS : queue is full.
- ZOS_ERROR : queue is not full.
zos_result_t zn_rtos_queue_pop | ( | zos_queue_t * | queue, |
void * | message, |
||
uint32_t | timeout_ms |
||
) |
Pops an object off a queuePops an object off a queue.
- Parameters
-
queue
: a pointer to the queue handle message
: pointer to a buffer that will receive the object being popped off the queue. Size is assumed to be the size specified in zn_rtos_queue_init() , hence you must ensure the buffer is long enough or memory corruption will result timeout_ms
the number of milliseconds to wait before returning
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error or timeout occurred
zos_result_t zn_rtos_queue_push | ( | zos_queue_t * | queue, |
const void * | message, |
||
uint32_t | timeout_ms |
||
) |
Pushes an object onto a queuePushes an object onto a queue.
- Parameters
-
queue
: a pointer to the queue handle message
: the object to be added to the queue. Size is assumed to be the size specified in zn_rtos_queue_init() timeout_ms
the number of milliseconds to wait before returning
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error or timeout occurred