Queue management functions.
More...
Queue management functions.
wiced_queue_t* wiced_rtos_create_queue |
( |
void |
| ) |
|
Creates a new instance of queue.
Creates a new queue (Allocates memory for a new queue instance and returns the pointer)
- Returns
- valid pointer : on success.
-
NULL : if an error occurred
De-initialise a queue.
Deletes a queue created with wiced_rtos_init_queue
- Parameters
-
queue | : a pointer to the queue handle |
- Returns
- WICED_SUCCESS : on success.
-
WICED_ERROR : if an error occurred
wiced_result_t wiced_rtos_get_queue_occupancy |
( |
wiced_queue_t * |
queue, |
|
|
uint32_t * |
count |
|
) |
| |
Get the queue occupancy.
- Parameters
-
queue | : a pointer to the queue handle |
count | : pointer to integer for storing occupancy count |
- Returns
- WICED_SUCCESS : on success.
-
WICED_ERROR : if an error occurred
wiced_result_t wiced_rtos_init_queue |
( |
wiced_queue_t * |
queue, |
|
|
const char * |
name, |
|
|
uint32_t |
message_size, |
|
|
uint32_t |
number_of_messages |
|
) |
| |
Initialises a queue.
Initialises a FIFO queue
- Parameters
-
queue | : a pointer to the queue handle to be initialised |
name | : a text string name for the queue (NULL is allowed) |
message_size | : size in bytes of objects that will be held in the queue(currentlt only 1 byte is acccepted) |
number_of_messages | : depth of the queue - i.e. max number of objects in the queue |
- Returns
- WICED_SUCCESS : on success.
-
WICED_ERROR : if an error occurred
wiced_bool_t wiced_rtos_is_queue_empty |
( |
wiced_queue_t * |
queue | ) |
|
Check if a queue is empty.
- Parameters
-
queue | : a pointer to the queue handle |
- Returns
- WICED_SUCCESS : queue is empty.
-
WICED_ERROR : queue is not empty.
wiced_bool_t wiced_rtos_is_queue_full |
( |
wiced_queue_t * |
queue | ) |
|
Check if a queue is full.
- Parameters
-
queue | : a pointer to the queue handle |
- Returns
- WICED_SUCCESS : queue is full.
-
WICED_ERROR : queue is not full.
wiced_result_t wiced_rtos_pop_from_queue |
( |
wiced_queue_t * |
queue, |
|
|
void * |
message, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Pops an object off a queue.
Pops 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 wiced_rtos_init_queue , 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
- WICED_SUCCESS : on success.
-
WICED_ERROR : if an error or timeout occurred
wiced_result_t wiced_rtos_push_to_queue |
( |
wiced_queue_t * |
queue, |
|
|
void * |
message, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Pushes an object onto a queue.
Pushes 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 wiced_rtos_init_queue |
timeout_ms | the number of milliseconds to wait before returning |
- Returns
- WICED_SUCCESS : on success.
-
WICED_ERROR : if an error or timeout occurred