nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ nrf_802154_queue_push_begin()

void * nrf_802154_queue_push_begin ( const nrf_802154_queue_t * p_queue)

Returns pointer to the next item to be written to the queue.

This function is to be used when writing data to the queue directly (no copy). Returned pointer is valid when the queue is not full (nrf_802154_queue_is_full returned false). To write an item to the queue perform following.

{
my_item_t * p_item = (my_item_t *)nrf_802154_queue_push_begin(&queue);
... p_item is now direct pointer into memory of the queue, fill all data at p_item pointer
p_item->some_field = some_value;
... fill all data at p_item pointer
}
void nrf_802154_queue_push_commit(nrf_802154_queue_t *p_queue)
Increments write pointer of the queue.
bool nrf_802154_queue_is_full(const nrf_802154_queue_t *p_queue)
Checks if the queue is full.
void * nrf_802154_queue_push_begin(const nrf_802154_queue_t *p_queue)
Returns pointer to the next item to be written to the queue.

To ensure thread-safety external locking is required.

Parameters
[in]p_queuePointer to the queue instance.
Returns
Pointer to the next item to be written.