MX Foundation 4
|
Functions | |
uint32 | mxfDeviceCommBufferAlloc (HMXF_DEVICE device, uint64 index, uint64 size, HMXF_BUFFER *buffer, uint64 *allocated) |
uint32 | mxfDeviceCommBufferGet (HMXF_DEVICE device, uint64 index, HMXF_BUFFER *buffer) |
uint32 | mxfDeviceCommBufferFree (HMXF_BUFFER buffer) |
uint32 | mxfDeviceCommBufferStatusGet (HMXF_BUFFER buffer, uint64 *status, uint64 *msgCount, uint64 *pendingBytes, uint64 *freeBytes) |
uint32 | mxfDeviceCommBufferInfoGet (HMXF_BUFFER buffer, HMXF_DEVICE *device, uint64 *index) |
uint32 | mxfDeviceCommBufferWrite (HMXF_BUFFER buffer, uint64 count, MXF_EMBEDDED_DATAREC *rec) |
uint32 | mxfDeviceCommBufferWriteAsync (HMXF_BUFFER buffer, uint64 count, MXF_EMBEDDED_DATAREC *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK writeCompletion, void *context) |
uint32 | mxfDeviceCommBufferRead (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *msgReadCount, uint64 *byteReadCount, MXF_EMBEDDED_DATAREC *rec) |
uint32 | mxfDeviceCommBufferReadAsync (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, MXF_EMBEDDED_DATAREC *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, void *context) |
uint32 | mxfDeviceCommBufferClear (HMXF_BUFFER buffer) |
uint32 | mxfDeviceCommRxBufferAsyncEventInit (HMXF_BUFFER buffer, uint64 almostFull, void *context, MXF_ASYNCEVENT_BUFFER_HANDLER callback) |
uint32 | mxfDeviceCommRxBufferAsyncEventTerminate (HMXF_BUFFER buffer) |
uint32 | mxfDeviceCommTxBufferAsyncEventInit (HMXF_BUFFER buffer, uint64 almostEmpty, void *context, MXF_ASYNCEVENT_BUFFER_HANDLER callback) |
uint32 | mxfDeviceCommTxBufferAsyncEventTerminate (HMXF_BUFFER buffer) |
uint32 mxfDeviceCommBufferAlloc | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
uint64 | size, | ||
HMXF_BUFFER * | buffer, | ||
uint64 * | allocated | ||
) |
Allocates a communication buffer area used between an application and an embedded application. The allocated size can be greater than the asked size (rounding is done for internal buffer alignment). allocated
parameter can return the actual allocated size.
[in] | device | device handle |
[in] | index | communication buffer index. KMXF_DEVICE_COMM_QUEUE_NUM attribute is used to define the number of available communication buffer. |
[in] | size | size in bytes to allocate |
[out] | buffer | handle of communication buffer area |
[out] | allocated | returned allocated size. Optional, pass NULL to if not needed. |
uint32 mxfDeviceCommBufferGet | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
HMXF_BUFFER * | buffer | ||
) |
Returns the handle of the specified communication buffer index.
[in] | device | device handle |
[in] | index | communication buffer index. KMXF_DEVICE_COMM_QUEUE_NUM attribute is used to define the number of available communication buffer. |
[out] | buffer | returned handle of communication buffer area |
uint32 mxfDeviceCommBufferFree | ( | HMXF_BUFFER | buffer | ) |
Deallocates the memory previously allocated by mxfDeviceCommBufferAlloc().
[in] | buffer | buffer handle. |
uint32 mxfDeviceCommBufferStatusGet | ( | HMXF_BUFFER | buffer, |
uint64 * | status, | ||
uint64 * | msgCount, | ||
uint64 * | pendingBytes, | ||
uint64 * | freeBytes | ||
) |
Returns the status and the number of messages/bytes pending in a communication buffer.
[in] | buffer | buffer handle |
[out] | status | Reserved for future use. Pass NULL to ignore this parameter. |
[out] | msgCount | number of unread messages of MXF_EMBEDDED_DATAREC type. Pass NULL to ignore this parameter. |
[out] | pendingBytes | number of unread bytes. Pass NULL to ignore this parameter. |
[out] | freeBytes | number of free bytes. Pass NULL to ignore this parameter. |
uint32 mxfDeviceCommBufferInfoGet | ( | HMXF_BUFFER | buffer, |
HMXF_DEVICE * | device, | ||
uint64 * | index | ||
) |
Returns the device handle and communication buffer index from a communication buffer handle.
[in] | buffer | buffer handle |
[out] | device | device handle. Pass NULL to ignore this parameter. |
[out] | index | communication buffer index. Pass NULL to ignore this parameter. |
uint32 mxfDeviceCommBufferWrite | ( | HMXF_BUFFER | buffer, |
uint64 | count, | ||
MXF_EMBEDDED_DATAREC * | rec | ||
) |
Writes data records in the specified communication buffer.
[in] | buffer | buffer handle |
[in] | count | number of records to write |
[in] | rec | array of MXF_EMBEDDED_DATAREC 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 mxfDeviceCommBufferWriteAsync | ( | HMXF_BUFFER | buffer, |
uint64 | count, | ||
MXF_EMBEDDED_DATAREC * | hostBuffer, | ||
MXF_ASYNCHRONOUS_CALLBACK | writeCompletion, | ||
void * | context | ||
) |
Writes asynchronously data records in the specified communication buffer. 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] | count | number of records to write |
[in] | hostBuffer | array of MXF_EMBEDDED_DATAREC 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] | writeCompletion | callback function to be called when write 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 records to write. |
[in] | context | pointer to a value that will be passed to the callback handler (optional). |
uint32 mxfDeviceCommBufferRead | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | msgReadCount, | ||
uint64 * | byteReadCount, | ||
MXF_EMBEDDED_DATAREC * | rec | ||
) |
Reads data records from a communication buffer.
[in] | buffer | buffer handle |
[in] | maxMsgCount | number maximum of records to read (0 means all messages) |
[in] | maxBytesCount | number maximum of bytes to read |
[out] | msgReadCount | number of messages returned |
[out] | byteReadCount | number of bytes to returned |
[out] | rec | array of MXF_EMBEDDED_DATAREC 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 mxfDeviceCommBufferReadAsync | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
MXF_EMBEDDED_DATAREC * | hostBuffer, | ||
MXF_ASYNCHRONOUS_CALLBACK | readCompletion, | ||
void * | context | ||
) |
Reads asynchronously data records from a communication buffer. 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 | number maximum of records to read (0 means all messages) |
[in] | maxBytesCount | number maximum of bytes to read |
[out] | hostBuffer | array of MXF_EMBEDDED_DATAREC 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 mxfDeviceCommBufferClear | ( | HMXF_BUFFER | buffer | ) |
Clears the data pending in a communication buffer.
[in] | buffer | buffer handle |
uint32 mxfDeviceCommRxBufferAsyncEventInit | ( | HMXF_BUFFER | buffer, |
uint64 | almostFull, | ||
void * | context, | ||
MXF_ASYNCEVENT_BUFFER_HANDLER | callback | ||
) |
Sets an async event handler for a Rx communication 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 communication buffer handle |
[in] | almostFull | almost full threshold value |
[in] | context | handler callback context |
[in] | callback | Rx communication buffer callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] context: context pointer
uint32 mxfDeviceCommRxBufferAsyncEventTerminate | ( | HMXF_BUFFER | buffer | ) |
Clears the async event handler for a Rx communication buffer.
[in] | buffer | Rx communication buffer handle |
uint32 mxfDeviceCommTxBufferAsyncEventInit | ( | HMXF_BUFFER | buffer, |
uint64 | almostEmpty, | ||
void * | context, | ||
MXF_ASYNCEVENT_BUFFER_HANDLER | callback | ||
) |
Sets an async event handler for a Tx communication buffer. When the almost empty threshold will be reached, the callback will be called once and will be called again only when the almost empty threshold will be reached again.
[in] | buffer | Tx communication buffer handle |
[in] | almostEmpty | almost empty threshold value |
[in] | context | handler callback context |
[in] | callback | Tx communication buffer callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] context: context pointer
uint32 mxfDeviceCommTxBufferAsyncEventTerminate | ( | HMXF_BUFFER | buffer | ) |
Clears the async event handler for a Tx communication buffer.
[in] | buffer | Tx communication buffer handle |