MX Foundation 4
|
Functions | |
uint32 | mxfAsyncEventHandlerInit (HMXF_SERVER server, MXF_ASYNCEVENT_HANDLER handler, void *param, HMXF_ASYNCEVENT *asyncEvent) |
uint32 | mxfAsyncEventHandlerTerminate (HMXF_ASYNCEVENT asyncEvent) |
uint32 | mxfAsyncEventConditionsGet (HMXF_ASYNCEVENT asyncEvent, uint64 maxCount, uint64 *count, MXF_ASYNCEVENT_CONDITION *conditions) |
uint32 | mxfAsyncEventConditionsSet (HMXF_ASYNCEVENT asyncEvent, uint64 enable, uint64 count, MXF_ASYNCEVENT_CONDITION *conditions) |
uint32 | mxfAsyncEventPendingCountGet (HMXF_ASYNCEVENT asyncEvent, uint64 *count) |
uint32 | mxfAsyncEventPendingGet (HMXF_ASYNCEVENT asyncEvent, uint64 maxCount, uint64 *count, MXF_ASYNCEVENT_PENDING_INFO *pendingInfo) |
uint32 | mxfAsyncEventPendingClear (HMXF_ASYNCEVENT asyncEvent) |
uint32 | mxfAsyncEventRxMsgSelectSet (HMXF_ASYNCEVENT asyncEvent, HMXF_CHANNEL channel, uint64 select, uint64 count, void *msg) |
uint32 | mxfAsyncEventRxMsgSelectGet (HMXF_ASYNCEVENT asyncEvent, HMXF_CHANNEL channel, uint64 maxCount, uint64 *count, void *msg) |
uint32 | mxfAsyncEventTxPeriodicUpdateMsgSelectSet (HMXF_ASYNCEVENT asyncEvent, HMXF_CHANNEL channel, uint64 select, uint64 count, HMXF_BUFFER *bufferArray) |
uint32 | mxfAsyncEventTxPeriodicUpdateMsgSelectGet (HMXF_ASYNCEVENT asyncEvent, HMXF_CHANNEL channel, uint64 maxCount, uint64 *count, HMXF_BUFFER *bufferArray) |
uint32 mxfAsyncEventHandlerInit | ( | HMXF_SERVER | server, |
MXF_ASYNCEVENT_HANDLER | handler, | ||
void * | param, | ||
HMXF_ASYNCEVENT * | asyncEvent | ||
) |
Attaches the specified asynchronous event handler to all devices detected on your system.
Important: Only one asynchronous event handler can be attached by an application (process).
[in] | server | server handle. |
[in] | handler | address of an handler function defined as follow; [in] asyncEvent: async event handle. [in] param: pointer to a value that has been passed for the async event handler. [return] Not used. Reserved for future use. The specified async event handler will be called whenever an asynchronous event is pending. |
[in] | param | pointer to a value that will be passed to the async event handler. |
[out] | asyncEvent | async event handle returned |
mxfAsyncEventHandlerInit() registers a generic handler that can handle many conditions. This function must be used in conjunction with mxfAsyncEventConditionsSet() in order to register each specific conditions that should be handled. The handler is called from another thread than the main thread.
The code below shows how a minimal handler can be defined:
uint32 mxfAsyncEventHandlerTerminate | ( | HMXF_ASYNCEVENT | asyncEvent | ) |
Unregisters an asynchronous event handler.
[in] | asyncEvent | asynchronous event handle |
uint32 mxfAsyncEventConditionsGet | ( | HMXF_ASYNCEVENT | asyncEvent, |
uint64 | maxCount, | ||
uint64 * | count, | ||
MXF_ASYNCEVENT_CONDITION * | conditions | ||
) |
Returns the list of conditions registered for an asynchronous handler.
[in] | asyncEvent | asyncEvent handle |
[in] | maxCount | maximum number of conditions to read |
[out] | count | number of conditions returned |
[out] | conditions | pointer to condition array structure |
uint32 mxfAsyncEventConditionsSet | ( | HMXF_ASYNCEVENT | asyncEvent, |
uint64 | enable, | ||
uint64 | count, | ||
MXF_ASYNCEVENT_CONDITION * | conditions | ||
) |
Enables or disables asynchronous event conditions to be serviced by the specified asynchronous event handler.
An asynchronous event handler initially defined by mxfAsyncEventHandlerInit() can service several asynchronous event conditions defined by mxfAsyncEventConditionsSet(). These conditions can be modified dynamically while the program is running.
[in] | asyncEvent | channel handle | ||||||
[in] | enable | enable or disable the conditions
| ||||||
[in] | count | number of conditions | ||||||
[in] | conditions | pointer to an array of conditions |
Array of asynchronous Conditions.
Condition ID:
The list of the conditions ID is defined below. For each condition, variables must be set for defining the triggers of the conditions. Refer to the structures MXF_ASYNCEVENT_CONDITION for more details.
Condition ID name | Action |
---|---|
MXF_ASYNCEVENT_COND_RX_MSG: | Causes an asynchronous event to occur when a specific message is received. Structure member to use: rxMsg. The message IDs must be selected with mxfAsyncEventRxMsgSelectSet(). This condition is only available in MIL-STD-1553, CSDB, ARINC 429, ARINC 629 and ARINC 708. |
MXF_ASYNCEVENT_COND_RX_ERROR: | Causes an asynchronous event to occur when a receive RX error is detected. Structure member to use: rxErr. |
MXF_ASYNCEVENT_COND_TX_ERROR: | Causes an asynchronous event to occur when a TX error is detected. Structure member to use: txErr. |
MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified TX FIFO aperiodic buffer threshold is reached. Structure member to use: txAperiodicBufferThreshold. |
MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified acquisition buffer threshold is reached. Structure member to use: rxAcqBufferThreshold. |
MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified TX periodic update message buffer threshold is reached. Structure member to use: txPeriodicUpdateMsgBufferThreshold. The messages must be selected using mxfAsyncEventTxMsgSelectSet(). This condition is only available with channels supporting the TX Periodic Update Message Service (MXF_SCLASS_TXPERIODIC_UPDATEMSG_BUFFER_SRV). |
MXF_ASYNCEVENT_COND_EMBEDDED_RX_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified embedded RX buffer threshold is reached. Structure member to use: embeddedRxBufferThreshold. |
MXF_ASYNCEVENT_COND_EMBEDDED_TX_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified embedded TX buffer threshold is reached. Structure member to use: embeddedTxBufferThreshold. |
MXF_ASYNCEVENT_COND_IRIGB_EVENTS: | Causes an asynchronous event to occur for the IRIG-B event. The IRIG-B event is defined in MXF_ASYNCEVENT_CONDITION.irigbEvents.status field. Refer to the section IRIG Asynchronous Event for a complete discussion about the IRIG-B events. Structure member to use: irigbEvents. |
MXF_ASYNCEVENT_COND_COMM_RX_BUFFER_THRESHOLD: | Causes an asynchronous event to occur when the specified comm RX buffer threshold is reached. Structure member to use: commBufferThreshold. |
MXF_ASYNCEVENT_COND_COMM_TX_BUFFER_THRESHOLD: | Cause an asynchronous event to occur when the specified comm TX buffer threshold is reached. Structure member to use: commBufferThreshold. |
uint32 mxfAsyncEventPendingCountGet | ( | HMXF_ASYNCEVENT | asyncEvent, |
uint64 * | count | ||
) |
Returns the number of conditions pending for an asynchronous handler.
[in] | asyncEvent | asyncEvent handle |
[out] | count | number of conditions pending |
uint32 mxfAsyncEventPendingGet | ( | HMXF_ASYNCEVENT | asyncEvent, |
uint64 | maxCount, | ||
uint64 * | count, | ||
MXF_ASYNCEVENT_PENDING_INFO * | pendingInfo | ||
) |
Gets pending asynchronous event information. The function should be called in an asynchronous event handler to determine why the asynchronous event occurred.
[in] | asyncEvent | asynchronous event handle |
[in] | maxCount | maximum number of interrupts to return (1-1000) |
[out] | count | returned count of pending asynchronous events |
[out] | pendingInfo | returned array of pending asynchronous event info |
The asynchronous event types are:
and the structure MXF_ASYNCEVENT_PENDING_INFO defines sub-structures for each type of asynchronous events.
Array of Interrupt Conditions.
Condition ID:
The list of the conditions ID is defined below. For each condition, variables has been set to define the trigger of the conditions. Refer to the structures MXF_ASYNCEVENT_PENDING_INFO for more details.
Condition ID name | Effect |
---|---|
MXF_ASYNCEVENT_COND_RX_MSG: | A specific message has been received. Structure member to use: rxMsg. |
MXF_ASYNCEVENT_COND_RX_ERROR: | A receive RX error has been detected. Structure member to use: rxErr. |
MXF_ASYNCEVENT_COND_TX_ERROR: | A TX error has been detected. Structure member to use: txErr. |
MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD: | TX FIFO aperiodic buffer almost empty threshold has been reached. Structure member to use: txAperiodicBufferThreshold. |
MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD: | Acquisition buffer almost full threshold has been reached. Structure member to use: rxAcqBufferThreshold. |
MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD: | TX periodic update message buffer almost empty threshold has been reached. Structure member to use: txPeriodicUpdateMsgBufferThreshold. |
MXF_ASYNCEVENT_COND_EMBEDDED_RX_BUFFER_THRESHOLD: | Embedded RX buffer almost full threshold has been reached. Structure member to use: embeddedRxBufferThreshold. |
MXF_ASYNCEVENT_COND_EMBEDDED_TX_BUFFER_THRESHOLD: | Embedded TX buffer almost empty threshold has been reached. Structure member to use: embeddedTxBufferThreshold. |
MXF_ASYNCEVENT_COND_IRIGB_EVENTS: | An IRIG-B event has been detected. Structure member to use: irigbEvents. |
MXF_ASYNCEVENT_COND_RX_COMM_BUFFER_THRESHOLD: | Comm RX buffer almost full threshold has been reached. Structure member to use: commBufferThreshold. |
MXF_ASYNCEVENT_COND_TX_COMM_BUFFER_THRESHOLD: | Comm TX buffer almost empty threshold has been reached. Structure member to use: commBufferThreshold. |
uint32 mxfAsyncEventPendingClear | ( | HMXF_ASYNCEVENT | asyncEvent | ) |
Clears the pending asynchronous events for the asynchronous event handler.
[in] | asyncEvent | asynchronous event handle |
uint32 mxfAsyncEventRxMsgSelectSet | ( | HMXF_ASYNCEVENT | asyncEvent, |
HMXF_CHANNEL | channel, | ||
uint64 | select, | ||
uint64 | count, | ||
void * | msg | ||
) |
Selects or deselects the message IDs for MXF_ASYNCEVENT_COND_RX_MSG condition on a specified RX channel.
This function must be called in addition to mxfAsyncEventConditionsSet() with MXF_ASYNCEVENT_COND_RX_MSG condition to cause an asynchronous event to occur when a specific message ID is received.
The message selection must be made by only one asynchronous event routine for a specific channel. Otherwise, an error code will be returned while conditions of other asynchronous event routines are present.
In this case, you must disable the MXF_ASYNCEVENT_COND_RX_MSG condition using mxfAsyncEventConditionsSet() with another asynchronous event handle.
[in] | asyncEvent | asynchronous event handle | ||||||||||||||||
[in] | channel | channel handle | ||||||||||||||||
[in] | select | action to perform for the message IDs
| ||||||||||||||||
[in] | count | count of messages IDs | ||||||||||||||||
[in] | msg | array of message IDs.
|
uint32 mxfAsyncEventRxMsgSelectGet | ( | HMXF_ASYNCEVENT | asyncEvent, |
HMXF_CHANNEL | channel, | ||
uint64 | maxCount, | ||
uint64 * | count, | ||
void * | msg | ||
) |
Returns the list of message IDs registered for a specified RX channel for MXF_ASYNCEVENT_COND_RX_MSG asynchronous event condition ID.
[in] | asyncEvent | asynchronous event handle | ||||||||||||||||
[in] | channel | channel handle | ||||||||||||||||
[in] | maxCount | maximum message IDs expected | ||||||||||||||||
[out] | count | number of message IDs returned | ||||||||||||||||
[out] | msg | returned message IDs array
|
uint32 mxfAsyncEventTxPeriodicUpdateMsgSelectSet | ( | HMXF_ASYNCEVENT | asyncEvent, |
HMXF_CHANNEL | channel, | ||
uint64 | select, | ||
uint64 | count, | ||
HMXF_BUFFER * | bufferArray | ||
) |
Selects or deselects the TX periodic update message buffers for MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD condition on a specified TX channel.
This function must be called in addition to mxfAsyncEventConditionsSet() with MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD condition to cause an asynchronous event to occur when a specific TX periodic update message buffer threshold is reached.
The message selection must be made by only one asynchronous event routine for a specific channel. Otherwise, an error code will be returned while conditions of other asynchronous event routines are present.
In this case, you must disable MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD condition using mxfAsyncEventConditionsSet() with another asynchronous event handle.
[in] | asyncEvent | asynchronous event handle | ||||||||
[in] | channel | channel handle | ||||||||
[in] | select | action to perform for the buffer array
| ||||||||
[in] | count | number of buffers | ||||||||
[in] | bufferArray | handle to buffer(s) arrays |
uint32 mxfAsyncEventTxPeriodicUpdateMsgSelectGet | ( | HMXF_ASYNCEVENT | asyncEvent, |
HMXF_CHANNEL | channel, | ||
uint64 | maxCount, | ||
uint64 * | count, | ||
HMXF_BUFFER * | bufferArray | ||
) |
Returns the list of buffers registered for a specified TX channel for MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD asynchronous event condition ID.
[in] | asyncEvent | asynchronous event handle |
[in] | channel | channel handle |
[in] | maxCount | maximum of buffers expected |
[out] | count | number of buffers returned |
[out] | bufferArray | handle to buffer(s) arrays |