Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Queue system for the ca821x-posix exchanges to use for message buffering & sorting. More...
Go to the source code of this file.
Functions | |
void | add_to_queue (struct buffer_queue *buffer_queue, const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef) |
Add a buffer onto the end of a queue. More... | |
void | flush_queue (struct buffer_queue *buffer_queue) |
Empty a queue into nothing. More... | |
size_t | pop_from_queue (struct buffer_queue *buffer_queue, uint8_t *destBuf, size_t maxlen, struct ca821x_dev **pDeviceRef_out) |
Pop a buffer off a queue. More... | |
size_t | peek_queue (struct buffer_queue *buffer_queue) |
Non-blocking function returning the length of the next buffer on the queue (or 0 if nothing) More... | |
size_t | wait_on_queue (struct buffer_queue *buffer_queue, time_t timeout_s) |
Wait on a queue, blocking until there is something available. More... | |
ca_error | wait_on_queue_empty (struct buffer_queue *buffer_queue, time_t timeout_s) |
Wait on a queue, blocking until it is empty. More... | |
Queue system for the ca821x-posix exchanges to use for message buffering & sorting.
void add_to_queue | ( | struct buffer_queue * | buffer_queue, |
const uint8_t * | buf, | ||
size_t | len, | ||
struct ca821x_dev * | pDeviceRef | ||
) |
Add a buffer onto the end of a queue.
buffer_queue | A pointer to the queue |
buf | The buffer to queue |
len | The length in bytes of the buffer |
pDeviceRef | The pDeviceRef that the buffer is relevant to |
void flush_queue | ( | struct buffer_queue * | buffer_queue | ) |
Empty a queue into nothing.
buffer_queue | A pointer to the head of a queue |
size_t peek_queue | ( | struct buffer_queue * | buffer_queue | ) |
Non-blocking function returning the length of the next buffer on the queue (or 0 if nothing)
buffer_queue | A pointer to the queue |
size_t pop_from_queue | ( | struct buffer_queue * | buffer_queue, |
uint8_t * | destBuf, | ||
size_t | maxlen, | ||
struct ca821x_dev ** | pDeviceRef_out | ||
) |
Pop a buffer off a queue.
buffer_queue | A pointer to the queue | |
[out] | destBuf | A pointer to a buffer to accept the dequeued data |
maxlen | The max size of the destBuf | |
[out] | pDeviceRef_out | Output parameter to store the pDeviceRef of the buffer |
size_t wait_on_queue | ( | struct buffer_queue * | buffer_queue, |
time_t | timeout_s | ||
) |
Wait on a queue, blocking until there is something available.
buffer_queue | A pointer to the queue |
timeout_s | The wait timeout in seconds, or 0 for no timeout |
ca_error wait_on_queue_empty | ( | struct buffer_queue * | buffer_queue, |
time_t | timeout_s | ||
) |
Wait on a queue, blocking until it is empty.
buffer_queue | A pointer to the queue |
timeout_s | The wait timeout in seconds, or 0 for no timeout |