An application can register condition(s) to be monitored by the receive firmware.
When a callback handler is defined, the condition(s) are reported to the application asynchronously from the firmware to the handler.
The way to define an handler is as follows:
After this registration, the application can read acquisition data as usual and/or received asynchronous events through the callback handler.
The receive queue can also be read from the callback handler if necessary.
List of Conditions
The event conditions that can be monitored are as follows:
Condition | Description |
MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD | Acquisition buffer threshold exceeded. |
Example
adc_buffer_threshold.c
In the example below a condition handler is defined for monitoring MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD condition and ADC acquisition channel started for receiving data.
#define BUFFER_SIZE 4096
uint32 asyncEventHandler(HMXF_ASYNCEVENT asyncEvent, void *param)
{
uint64 i, maxCount=64, pendingCount, status;
uint32 rc=MAXT_SUCCESS;
for (i=0; i < pendingCount && !rc; i++)
{
switch(pendingList[i].condID)
{
case MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD:
{
HMXF_BUFFER buffer;
uint64 msgCount, byteCount;
uint64 msg;
uint32 rc=MAXT_SUCCESS;
break;
}
default:
printf("Unknown condID 0x%llx)", pendingList[i].condID);
break;
}
}
return rc;
}
int main()
{
HMXF_SERVER server;
HMXF_DEVICE device=NULL;
HMXF_MODULE module=NULL;
HMXF_CHANNEL channel=NULL;
HMXF_BUFFER buffer=NULL;
HMXF_ASYNCEVENT asyncEvent=NULL;
uint64 count;
uint32 rc;
if (!rc)
{
if (!rc)
{
if (!rc)
}
}
if (!rc)
if (!rc)
if(!rc)
{
if(!hostBuffer)
rc = MAXT_ERROR_MEM;
}
if (!rc)
memset(&asyncEventInfo, 0, sizeof(asyncEventInfo));
asyncEventInfo[0].
condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
if (!rc)
if (!rc)
if (!rc)
if (!rc)
if (buffer)
if (!rc)
if (rc)
printf("Error code=0x%lX\n", rc);
if (asyncEvent)
if (device)
}