MX Foundation 4
|
Functions | |
uint32 | mxfEmbeddedRxBufferAlloc (HMXF_DEVICE device, uint64 index, uint64 size, HMXF_BUFFER *buffer, uint64 *allocated) |
uint32 | mxfEmbeddedRxBufferGet (HMXF_DEVICE device, uint64 index, HMXF_BUFFER *buffer) |
uint32 | mxfEmbeddedRxBufferFree (HMXF_BUFFER buffer) |
uint32 | mxfEmbeddedRxBufferStatusGet (HMXF_BUFFER buffer, uint64 *status, uint64 *msgCount, uint64 *pendingBytes, uint64 *freeBytes) |
uint32 | mxfEmbeddedRxBufferInfoGet (HMXF_BUFFER buffer, HMXF_DEVICE *device, uint64 *index) |
uint32 | mxfEmbeddedRxBufferClear (HMXF_BUFFER buffer) |
uint32 | mxfEmbeddedRxBufferRead (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *msgCount, uint64 *byteCount, MXF_EMBEDDED_DATAREC *rec) |
uint32 | mxfEmbeddedRxBufferReadAsync (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, MXF_EMBEDDED_DATAREC *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, void *context) |
uint32 | mxfEmbeddedRxBufferAsyncEventInit (HMXF_BUFFER buffer, uint64 almostFull, void *context, MXF_ASYNCEVENT_BUFFER_HANDLER callback) |
uint32 | mxfEmbeddedRxBufferAsyncEventTerminate (HMXF_BUFFER buffer) |
uint32 mxfEmbeddedRxBufferAlloc | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
uint64 | size, | ||
HMXF_BUFFER * | buffer, | ||
uint64 * | allocated | ||
) |
Allocates a receive buffer area for MX-Embedded queue reception (from the embedded code). The allocated size can be greater than the asked size (rounding is done for internal buffer alignment).
[in] | device | device handle |
[in] | index | queue index |
[in] | size | queue size in bytes |
[out] | buffer | returned buffer handle |
[out] | allocated | returned allocated size. Optional, pass NULL to if not needed. |
The maximum number of embedded RX queues (index) must be reserved for the device before the initialization by using the mxfSystemInitAttributeUint64CallbackHandler() and KMXF_DEVICE_EMBEDDED_RX_QUEUE_NUM attribute.
uint32 mxfEmbeddedRxBufferGet | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
HMXF_BUFFER * | buffer | ||
) |
Returns the buffer handle referenced by the device handle and queue index pair.
[in] | device | device handle |
[in] | index | queue index. |
[out] | buffer | returned buffer handle |
uint32 mxfEmbeddedRxBufferFree | ( | HMXF_BUFFER | buffer | ) |
Deallocates the memory previously allocated by mxfEmbeddedRxBufferAlloc().
[in] | buffer | buffer handle. |
uint32 mxfEmbeddedRxBufferStatusGet | ( | HMXF_BUFFER | buffer, |
uint64 * | status, | ||
uint64 * | msgCount, | ||
uint64 * | pendingBytes, | ||
uint64 * | freeBytes | ||
) |
Returns the status of the MX-Embedded RX buffer.
[in] | buffer | buffer handle | ||||||||||||||||||||||
[out] | status | acquisition buffer status
| ||||||||||||||||||||||
[out] | msgCount | number of pending messages to be read | ||||||||||||||||||||||
[out] | pendingBytes | number of pending bytes to be read | ||||||||||||||||||||||
[out] | freeBytes | number of free bytes available |
uint32 mxfEmbeddedRxBufferInfoGet | ( | HMXF_BUFFER | buffer, |
HMXF_DEVICE * | device, | ||
uint64 * | index | ||
) |
Returns the device handle and queue index pair from a MX-Embedded RX buffer handle.
[in] | buffer | buffer handle |
[out] | device | pointer to device handle. Pass NULL to ignore this parameter. |
[out] | index | pointer to queue index. Pass NULL to ignore this parameter. |
uint32 mxfEmbeddedRxBufferClear | ( | HMXF_BUFFER | buffer | ) |
Clears the pending data to read from the MX-Embedded RX buffer.
[in] | buffer | buffer handle |
uint32 mxfEmbeddedRxBufferRead | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | msgCount, | ||
uint64 * | byteCount, | ||
MXF_EMBEDDED_DATAREC * | rec | ||
) |
Reads an array of records from the MX-Embedded RX buffer. MX-Embedded RX queues are used to transfer data from the embedded to the host. This function will read data written from MX-Embedded application with mxfEmbeddedRxBufferWrite().
[in] | buffer | buffer handle |
[in] | maxMsgCount | maximum number of records to read (0 means all messages). |
[in] | maxBytesCount | maximum number of bytes to read (1 to 100MB). |
[out] | msgCount | returned message count |
[out] | byteCount | returned byte count |
[out] | rec | pointer to data records. The records are packed in the buffer. mxfNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer. |
uint32 mxfEmbeddedRxBufferReadAsync | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
MXF_EMBEDDED_DATAREC * | hostBuffer, | ||
MXF_ASYNCHRONOUS_CALLBACK | readCompletion, | ||
void * | context | ||
) |
Reads asynchronously an array of records from the MX-Embedded RX buffer. MX-Embedded RX queues are used to transfer data from the embedded to the host. This function will read data written from MX-Embedded application with mxfEmbeddedRxBufferWrite().
The function will return immediately after it has been registered to be executed by another thread. A callback function will be called when the asynchronous function has finished.
A maximum of 1000 asynchronous function calls can be queued.
[in] | buffer | buffer handle |
[in] | maxMsgCount | maximum number of records to read (0 means all messages). |
[in] | maxBytesCount | maximum number of bytes to read (1 to 100MB). |
[out] | hostBuffer | pointer to data records. The records are packed in the buffer. mxfNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer. |
[in] | readCompletion | callback function to be called when read process has been completed. Callback function is defined as follow: [in] result: return code of the function. [in] context: pointer to a value that has been passed for the callback. [in] output: array of additional information. output[0] contains the number of messages returned in hostBuffer. output[1] contains the number of bytes returned in hostBuffer. |
[in] | context | pointer to a value that will be passed to the callback handler (optional). |
uint32 mxfEmbeddedRxBufferAsyncEventInit | ( | HMXF_BUFFER | buffer, |
uint64 | almostFull, | ||
void * | context, | ||
MXF_ASYNCEVENT_BUFFER_HANDLER | callback | ||
) |
Sets an async event handler for a Rx embedded buffer. When the almost full threshold will be reached, the callback will be called once and will be called again only when the almost full threshold will be reached again.
[in] | buffer | Rx embedded buffer handle |
[in] | almostFull | almost full threshold value |
[in] | context | handler callback context |
[in] | callback | Rx embedded buffer callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] context: context pointer
uint32 mxfEmbeddedRxBufferAsyncEventTerminate | ( | HMXF_BUFFER | buffer | ) |
Clears the async event handler for a Rx embedded buffer.
[in] | buffer | Rx embedded buffer handle |