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)
 

Detailed Description

Function Documentation

uint32 mxfEmbeddedRxBufferAlloc ( HMXF_DEVICE  device,
uint64  index,
uint64  size,
HMXF_BUFFER *  buffer,
uint64 *  allocated 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferAlloc(UInt64 device, UInt64 index, UInt64 size, out UInt64 buffer, out UInt64 allocated);

public static extern UInt32 mxfEmbeddedRxBufferAlloc(UInt64 device, UInt64 index, UInt64 size, out UInt64 buffer, IntPtr 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).

Parameters
[in]devicedevice handle
[in]indexqueue index
[in]sizequeue size in bytes
[out]bufferreturned buffer handle
[out]allocatedreturned 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.

Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferFree()
mxfEmbeddedRxBufferGet()
mxfEmbeddedRxBufferStatusGet()
mxfEmbeddedTxBufferAlloc()
uint32 mxfEmbeddedRxBufferGet ( HMXF_DEVICE  device,
uint64  index,
HMXF_BUFFER *  buffer 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferGet(UInt64 device, UInt64 index, out UInt64 buffer);

Returns the buffer handle referenced by the device handle and queue index pair.

Parameters
[in]devicedevice handle
[in]indexqueue index.
[out]bufferreturned buffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
mxfEmbeddedRxBufferStatusGet()
uint32 mxfEmbeddedRxBufferFree ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedRxBufferFree(UInt64 buffer);

Deallocates the memory previously allocated by mxfEmbeddedRxBufferAlloc().

Parameters
[in]bufferbuffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
uint32 mxfEmbeddedRxBufferStatusGet ( HMXF_BUFFER  buffer,
uint64 *  status,
uint64 *  msgCount,
uint64 *  pendingBytes,
uint64 *  freeBytes 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferStatusGet(UInt64 buffer, out UInt64 status, out UInt64 msgCount, out UInt64 pendingBytes, out UInt64 freeBytes);

Returns the status of the MX-Embedded RX buffer.

Parameters
[in]bufferbuffer handle
[out]statusacquisition buffer status
Status Description
MXF_RXACQ_STATUS_WAIT_START_TIME acquisition is waiting for the start time.
MXF_RXACQ_STATUS_WAIT_TRIG acquisition is waiting for the trigger.
MXF_RXACQ_STATUS_RUNNING acquisition is running.
MXF_RXACQ_STATUS_STOPPED acquisition is stopped.
MXF_RXACQ_STATUS_OVERFLOW received data was discarded due to full buffer.
MXF_RXACQ_STATUS_BUFFER_FULL acquisition buffer is full.
MXF_RXACQ_STATUS_RUN_TIMED_OUT acquisition was stopped after duration.
MXF_RXACQ_STATUS_TRIG_TIMED_OUT acquisition was stopped after duration while waiting for trigger.
MXF_RXACQ_STATUS_OUT_OF_RESOURCES acquisition stopped due to full internal buffer.
MXF_RXACQ_STATUS_TRIG_OCCURRED acquisition trigger occurred.
[out]msgCountnumber of pending messages to be read
[out]pendingBytesnumber of pending bytes to be read
[out]freeBytesnumber of free bytes available
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
uint32 mxfEmbeddedRxBufferInfoGet ( HMXF_BUFFER  buffer,
HMXF_DEVICE *  device,
uint64 *  index 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferInfoGet(UInt64 buffer, out UInt64 device, out UInt64 index);

Returns the device handle and queue index pair from a MX-Embedded RX buffer handle.

Parameters
[in]bufferbuffer handle
[out]devicepointer to device handle. Pass NULL to ignore this parameter.
[out]indexpointer to queue index. Pass NULL to ignore this parameter.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
mxfEmbeddedRxBufferGet()
uint32 mxfEmbeddedRxBufferClear ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedRxBufferClear(UInt64 buffer);

Clears the pending data to read from the MX-Embedded RX buffer.

Parameters
[in]bufferbuffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
mxfEmbeddedRxBufferRead()
mxfEmbeddedRxBufferWrite()
uint32 mxfEmbeddedRxBufferRead ( HMXF_BUFFER  buffer,
uint64  maxMsgCount,
uint64  maxBytesCount,
uint64 *  msgCount,
uint64 *  byteCount,
MXF_EMBEDDED_DATAREC rec 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferRead(UInt64 buffer, UInt64 maxMsgCount, UInt64 maxBytesCount, out UInt64 msgCount, out UInt64 byteCount, IntPtr 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().

Parameters
[in]bufferbuffer handle
[in]maxMsgCountmaximum number of records to read (0 means all messages).
[in]maxBytesCountmaximum number of bytes to read (1 to 100MB).
[out]msgCountreturned message count
[out]byteCountreturned byte count
[out]recpointer 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.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferAlloc()
mxfEmbeddedRxBufferStatusGet()
mxfEmbeddedRxBufferClear()
mxfEmbeddedRxBufferWrite()
mxfNextRecordPtrGet()
mxfEmbeddedRxBufferReadAsync()
uint32 mxfEmbeddedRxBufferReadAsync ( HMXF_BUFFER  buffer,
uint64  maxMsgCount,
uint64  maxBytesCount,
MXF_EMBEDDED_DATAREC hostBuffer,
MXF_ASYNCHRONOUS_CALLBACK  readCompletion,
void *  context 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferReadAsync(UInt64 buffer, UInt64 maxMsgCount, UInt64 maxBytesCount, IntPtr hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, IntPtr 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.

Parameters
[in]bufferbuffer handle
[in]maxMsgCountmaximum number of records to read (0 means all messages).
[in]maxBytesCountmaximum number of bytes to read (1 to 100MB).
[out]hostBufferpointer 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]readCompletioncallback function to be called when read process has been completed. Callback function is defined as follow:
1 typedef void (*MXF_ASYNCHRONOUS_CALLBACK)(HMXF_BUFFER bufferHandle, uint32 result, void* context, uint64* output);
[in] bufferHandle: buffer handle.
[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]contextpointer to a value that will be passed to the callback handler (optional).
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferRead()
uint32 mxfEmbeddedRxBufferAsyncEventInit ( HMXF_BUFFER  buffer,
uint64  almostFull,
void *  context,
MXF_ASYNCEVENT_BUFFER_HANDLER  callback 
)
C#
public static extern UInt32 mxfEmbeddedRxBufferAsyncEventInit(UInt64 buffer, UInt64 almostFull, IntPtr 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.

Parameters
[in]bufferRx embedded buffer handle
[in]almostFullalmost full threshold value
[in]contexthandler callback context
[in]callbackRx embedded buffer callback handler

The callback handler function is defined as follow:

1 typedef uint32 (*MXF_ASYNCEVENT_BUFFER_HANDLER)(HMXF_BUFFER buffer, void* context);

[in] buffer: buffer handle [in] context: context pointer

Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.3.1 and later.
See also
mxfEmbeddedRxBufferAsyncEventTerminate()
mxfAsyncEventConditionsSet()
uint32 mxfEmbeddedRxBufferAsyncEventTerminate ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedRxBufferAsyncEventTerminate(UInt64 buffer);

Clears the async event handler for a Rx embedded buffer.

Parameters
[in]bufferRx embedded buffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.3.1 and later.
See also
mxfEmbeddedRxBufferAsyncEventInit()
mxfAsyncEventConditionsSet()
Updated 10/23/2023