Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Queues

Queue management functionss. More...

Functions

wiced_queue_t * wiced_rtos_create_queue (void)
 Creates a new instance of queue. More...
 
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. More...
 
wiced_result_t wiced_rtos_push_to_queue (wiced_queue_t *queue, void *message, uint32_t timeout_ms)
 Pushes an object onto a queue. More...
 
wiced_result_t wiced_rtos_pop_from_queue (wiced_queue_t *queue, void *message, uint32_t timeout_ms)
 Pops an object off a queue. More...
 
wiced_bool_t wiced_rtos_is_queue_empty (wiced_queue_t *queue)
 Check if a queue is empty. More...
 
wiced_bool_t wiced_rtos_is_queue_full (wiced_queue_t *queue)
 Check if a queue is full. More...
 
wiced_result_t wiced_rtos_get_queue_occupancy (wiced_queue_t *queue, uint32_t *count)
 Get the queue occupancy. More...
 

Detailed Description

Queue management functionss.

Function Documentation

wiced_queue_t* wiced_rtos_create_queue ( void  )

Creates a new instance of queue.

Creates a new FIFO queue (Allocates memory for a new queue instance and returns the pointer)

Returns
valid pointer : on success.
NULL : 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 (currently 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

Note : This API will create a separate private memory buffer pool so please increase max_number_of_buffer_pools (in wiced_bt_cfg_settings_t structure) by the number of rtos queues initialized - i.e. one per call to this API.

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[DEPRECATED] the number of milliseconds to wait before returning Note: timeout option is not supported and irrespective of timeout_ms value, API would be in blocking state until it receives single message in a queue.
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error 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[DEPRECATED] the number of milliseconds to wait before returning Note: timeout option is not supported and the API returns immediately without waiting even when timeout_ms is non zero.
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred.