nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ data_fifo_block_lock()

int data_fifo_block_lock ( struct data_fifo data_fifo,
void **  data,
size_t  size 
)

#include <include/data_fifo.h>

Confirm that the memory block use has finished and the block is put into the message queue.

There is no mechanism blocking this region from being written to or read from. Hence, this block should not be used before it is later fetched by using data_fifo_pointer_last_filled_get.

Parameters
data_fifoPointer to the data_fifo structure.
dataDouble pointer to the memory block that has been written to.
sizeNumber of bytes written. Must be equal to or smaller than the block size max.
Return values
0Block has been submitted to the message queue.
-ENOMEMThe size parameter is larger than the block size max.
-EINVALThe supplied size is zero.
-ESPIPEA generic return value if an error occurs in k_msg_put. Since data has already been added to the slab, there must be space in the message queue.