Defines a group of APIs, which interface to RTOS queues functionality contained in ROM.
More...
Defines a group of APIs, which interface to RTOS queues functionality contained in ROM.
- Note
- The queue APIs will not function until wiced_bt_stack_init is called so that the proper buffer space is allocated at runtime.
wiced_queue_t* wiced_rtos_create_queue |
( |
void |
| ) |
|
Allocates memory for a new queue instance and returns the pointer.
- Parameters
-
- Returns
- NULL an error occurred and the instance was not allocated, do not init
- valid pointer to queue instance, which can now we initialized
wiced_result_t wiced_rtos_get_queue_occupancy |
( |
wiced_queue_t * |
queue, |
|
|
uint32_t * |
count |
|
) |
| |
Read number of elements enqueued.
- Parameters
-
[in] | queue | pointer to queue instance |
[out] | count | pointer to integer for storing occupancy count |
- Returns
- WICED_SUCCESS
- WICED_ERROR
wiced_result_t wiced_rtos_init_queue |
( |
wiced_queue_t * |
queue, |
|
|
const char * |
name, |
|
|
uint32_t |
message_size, |
|
|
uint32_t |
number_of_messages |
|
) |
| |
Initializes queue instance created by wiced_rtos_create_queue.
- Parameters
-
[in] | queue | pointer to queue instance |
[in] | name | ASCII name for the queue (NULL is allowed) |
[in] | message_size | num bytes of each queue element |
[in] | number_of_messages | max number of elements in the queue |
- Returns
- WICED_SUCCESS
- WICED_ERROR
Note : This API will create separate private pool so please increase max_number_of_buffer_pools (in wiced_bt_cfg_settings_t structure) by number of rtos queue created
wiced_bool_t wiced_rtos_is_queue_empty |
( |
wiced_queue_t * |
queue | ) |
|
Returns boolean value indicating whether queue is empty.
- Parameters
-
[in] | queue | pointer to queue instance |
- Returns
-
wiced_bool_t wiced_rtos_is_queue_full |
( |
wiced_queue_t * |
queue | ) |
|
Returns boolean value indicating whether queue is full.
- Parameters
-
[in] | queue | pointer to queue instance |
- Returns
-
wiced_result_t wiced_rtos_pop_from_queue |
( |
wiced_queue_t * |
queue, |
|
|
void * |
message, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Dequeues element and memcpy's it to given pointer.
Can block for specified period of time if queue is empty.
- Parameters
-
[in] | queue | pointer to queue instance |
[out] | message | pointer to which popped element will be memcpy'd |
[in] | timeout_ms | milliseconds to wait for queue to fill if empty (this parameter is deprecated on 20819) |
- Returns
- WICED_SUCCESS
- WICED_ERROR
- Note
- Message parameter must have enough allocated memory to hold the length of popped element, which is specified in wiced_rtos_init_queue .
wiced_result_t wiced_rtos_push_to_queue |
( |
wiced_queue_t * |
queue, |
|
|
void * |
message, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Enqueues an element.
Memcpy's from the message pointer into the queue.
- Parameters
-
[in] | queue | pointer to queue instance |
[out] | message | pointer to queue element |
[in] | timeout_ms | Deprecated |
- Returns
- WICED_SUCCESS
- WICED_ERROR
- Note
- Message parameter must have enough allocated memory to hold the length of a queue element, which is specified in wiced_rtos_init_queue .