CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
The declarations in this header file correspond to the definitions in fifo.c. More...
Go to the source code of this file.
Data Structures | |
struct | CdiFifoFullCbData |
A structure of this type is passed as the parameter to CdiFifoFullCallback(). More... | |
struct | CdiFifoCbData |
A structure of this type is passed as the parameter to CdiFifoCallback(). It contains the state of a single FIFO read or write operation. More... | |
Typedefs | |
typedef struct CdiFifoState * | CdiFifoHandle |
Type used as the handle (pointer to an opaque structure) for a FIFO. Each handle represents a instance of a FIFO. | |
typedef void(* | CdiFifoFullCallback) (const CdiFifoFullCbData *cb_data_ptr) |
Prototype of FIFO write callback function. It is invoked whenever CdiFifoWrite() is used to write to a full FIFO. | |
typedef void(* | CdiFifoCallback) (const CdiFifoCbData *data_ptr) |
Prototype of FIFO debug callback function. | |
Functions | |
CDI_INTERFACE bool | CdiFifoCreate (const char *name_str, int item_count, int item_byte_size, CdiFifoFullCallback full_cb_ptr, CdiUserCbParameter full_user_cb_param, CdiFifoHandle *ret_handle_ptr) |
CDI_INTERFACE bool | CdiFifoRead (CdiFifoHandle handle, int timeout_ms, CdiSignalType abort_wait_signal, void *item_dest_ptr) |
CDI_INTERFACE void | CdiFifoFlush (CdiFifoHandle handle) |
CDI_INTERFACE bool | CdiFifoWrite (CdiFifoHandle handle, int timeout_ms, CdiSignalType abort_wait_signal, const void *item_ptr) |
CDI_INTERFACE const char * | CdiFifoGetName (CdiFifoHandle handle) |
CDI_INTERFACE void | CdiFifoDestroy (CdiFifoHandle handle) |
The declarations in this header file correspond to the definitions in fifo.c.
typedef void(* CdiFifoCallback) (const CdiFifoCbData *data_ptr) |
Prototype of FIFO debug callback function.
This callback function is invoked whenever an item is written to or read from the FIFO.
data_ptr | A pointer to an CdiFifoCbData structure. |
typedef void(* CdiFifoFullCallback) (const CdiFifoFullCbData *cb_data_ptr) |
Prototype of FIFO write callback function. It is invoked whenever CdiFifoWrite() is used to write to a full FIFO.
cb_data_ptr | A pointer to an CdiFifoFullCbData structure. |
CDI_INTERFACE bool CdiFifoCreate | ( | const char * | name_str, |
int | item_count, | ||
int | item_byte_size, | ||
CdiFifoFullCallback | full_cb_ptr, | ||
CdiUserCbParameter | full_user_cb_param, | ||
CdiFifoHandle * | ret_handle_ptr ) |
Create a FIFO.
name_str | Pointer to name of FIFO to copy to the new FIFO instance. |
item_count | Number of items in the FIFO (FIFO depth). |
item_byte_size | Size of each item in bytes. |
full_cb_ptr | Address of callback function invoked when the FIFO is full and CdiFifoWrite() is used. Specify NULL if not used. |
full_user_cb_param | User defined parameter used in structure passed to full_cb_ptr. |
ret_handle_ptr | Pointer to returned handle of the new FIFO. |
CDI_INTERFACE void CdiFifoDestroy | ( | CdiFifoHandle | handle | ) |
Destroy a FIFO.
handle | FIFO handle. |
CDI_INTERFACE void CdiFifoFlush | ( | CdiFifoHandle | handle | ) |
Flush all entries from the FIFO.
handle | FIFO handle. |
CDI_INTERFACE const char * CdiFifoGetName | ( | CdiFifoHandle | handle | ) |
Get name of FIFO that was defined when FIFO was created.
handle | FIFO handle. |
CDI_INTERFACE bool CdiFifoRead | ( | CdiFifoHandle | handle, |
int | timeout_ms, | ||
CdiSignalType | abort_wait_signal, | ||
void * | item_dest_ptr ) |
Read an item from the FIFO buffer and copy to item_dest_ptr.
handle | FIFO handle. |
timeout_ms | If FIFO is empty, this is the number of milliseconds to wait for data before returning. |
abort_wait_signal | Optional signal used to abort the read if the FIFO is empty. Use NULL to specific no signal. |
item_dest_ptr | Pointer to buffer where to copy the item to. Size of buffer must be large enough to hold the data. Data size was set when the FIFO was created (see item_byte_size). |
CDI_INTERFACE bool CdiFifoWrite | ( | CdiFifoHandle | handle, |
int | timeout_ms, | ||
CdiSignalType | abort_wait_signal, | ||
const void * | item_ptr ) |
Write an item to the FIFO.
handle | FIFO handle. |
timeout_ms | If FIFO is full, this is the number of milliseconds to wait for an open entry before returning. |
abort_wait_signal | Optional signal used to abort the write if the FIFO is full. Use NULL to specific no signal. |
item_ptr | Pointer where to copy the item from. |