Provides queue support for inter-task communication.
◆ mmosal_queue_create()
| struct mmosal_queue * mmosal_queue_create |
( |
size_t |
num_items, |
|
|
size_t |
item_size, |
|
|
const char * |
name |
|
) |
| |
Create a new queue.
- Parameters
-
| num_items | The maximum number of items that may be in the queue at a time. |
| item_size | The size of each item in the queue. |
| name | The name of the queue. |
- Returns
- an opaque handle to the queue, or
NULL on failure.
◆ mmosal_queue_delete()
| void mmosal_queue_delete |
( |
struct mmosal_queue * |
queue | ) |
|
Delete a queue.
- Parameters
-
| queue | handle of the queue to delete. |
◆ mmosal_queue_pop()
| bool mmosal_queue_pop |
( |
struct mmosal_queue * |
queue, |
|
|
void * |
item, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Pop an item from the queue.
- Warning
- May not be invoked from an ISR.
- Parameters
-
| queue | The queue to pop from. |
| item | Pointer to memory to receive the popped item. The item will be copied into this memory. The memory size must match the item_size given at creation. |
| timeout_ms | Timeout after which to give up waiting for an item if the queue is empty (in milliseconds). |
- Returns
true if an item was successfully popped, else false.
◆ mmosal_queue_pop_from_isr()
| bool mmosal_queue_pop_from_isr |
( |
struct mmosal_queue * |
queue, |
|
|
void * |
item |
|
) |
| |
Pop an item from the queue (from ISR context).
- Warning
- May only be invoked from an ISR.
- Parameters
-
| queue | The queue to pop from. |
| item | Pointer to memory to receive the popped item. The item will be copied into this memory. The memory size must match the item_size given at creation. |
- Returns
true if an item was successfully popped, else false.
◆ mmosal_queue_push()
| bool mmosal_queue_push |
( |
struct mmosal_queue * |
queue, |
|
|
const void * |
item, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Push an item into the queue.
- Warning
- May not be invoked from an ISR.
- Parameters
-
| queue | The queue to push to. |
| item | Pointer to the item to push. This item will be copied into the queue. The size of the item must match the item_size given at creation. |
| timeout_ms | Timeout after which to give up waiting for space if the queue is full (in milliseconds). |
- Returns
true if an item was successfully pushed, else false.
◆ mmosal_queue_push_from_isr()
| bool mmosal_queue_push_from_isr |
( |
struct mmosal_queue * |
queue, |
|
|
const void * |
item |
|
) |
| |
Push an item into the queue (from ISR context).
- Warning
- May only be invoked from an ISR.
- Parameters
-
| queue | The queue to push to. |
| item | Pointer to the item to push. This item will be copied into the queue. The size of the item must match the item_size given at creation. |
- Returns
true if an item was successfully pushed, else false.