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

Defines a group of APIs, which interface to RTOS queues functionality contained in ROM. More...

Functions

wiced_queue_t * wiced_rtos_create_queue (void)
 Allocates memory for a new queue instance and returns the pointer. More...
 
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. More...
 
wiced_result_t wiced_rtos_push_to_queue (wiced_queue_t *queue, void *message, uint32_t timeout_ms)
 Enqueues an element. More...
 
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. More...
 
wiced_bool_t wiced_rtos_is_queue_empty (wiced_queue_t *queue)
 Returns boolean value indicating whether queue is empty. More...
 
wiced_bool_t wiced_rtos_is_queue_full (wiced_queue_t *queue)
 Returns boolean value indicating whether queue is full. More...
 
wiced_result_t wiced_rtos_get_queue_occupancy (wiced_queue_t *queue, uint32_t *count)
 Read number of elements enqueued. More...
 

Detailed Description

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.

Function Documentation

wiced_queue_t* wiced_rtos_create_queue ( void  )

Allocates memory for a new queue instance and returns the pointer.

Parameters
void
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]queuepointer to queue instance
[out]countpointer 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]queuepointer to queue instance
[in]nameASCII name for the queue (NULL is allowed)
[in]message_sizenum bytes of each queue element
[in]number_of_messagesmax 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]queuepointer to queue instance
Returns
  • WICED_TRUE
  • WICED_FALSE
wiced_bool_t wiced_rtos_is_queue_full ( wiced_queue_t *  queue)

Returns boolean value indicating whether queue is full.

Parameters
[in]queuepointer to queue instance
Returns
  • WICED_TRUE
  • WICED_FALSE
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]queuepointer to queue instance
[out]messagepointer to which popped element will be memcpy'd
[in]timeout_msmilliseconds 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]queuepointer to queue instance
[out]messagepointer to queue element
[in]timeout_msDeprecated
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 .