The way to set a basic acquisition receive application is as follows:
- A receive channel must be obtained using the mxfModuleChannelGet() function or with the mxfModuleChannelAllGet() function by specifying the
MXF_SCLASS_RXACQ_SRV
subclass.
- The acquisition buffer must be allocated using the mxfRxAcqBufferAlloc() function.
- The acquisition mode can be set using the mxfRxAcqModeSet() function.
Two modes of acquisition are defined;
Condition | Description |
MXF_RXACQ_MODE_LINEAR | In this mode the acquisition stops when the buffer is full. |
MXF_RXACQ_MODE_CIRCULAR | In this mode the acquisition buffer is circular and never stops receiving.
Whenever the acquisition queue becomes full, the acquisition process will discard the newest received record. |
- The acquisition must be started using the mxfRxAcqStart() function.
- A read loop can be implemented using the mxfCSDBRxAcqRead() function.
The MXF_CSDB_DATAREC
structure must be used for reading a CSDB message with acquisition service.
Example
csdb_periodic.c
#define BUFFER_SIZE 4096
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
uint32 rc;
uint64 status, msgsCount, bytesCount;
uint64 i, j;
...
if (!rc)
if (!rc)
{
if (!rec)
rc = MAXT_ERROR_MEM;
}
if (!rc)
if (!rc)
{
if (!rc)
printf("\nAcquisition started\n\r");
}
...
rc =
mxfCSDBRxAcqRead(rxBuffer, 0, BUFFER_SIZE, &status, &msgsCount, &bytesCount, rec);
for (j=0; j<msgsCount && !rc; j++)
{
printf(
"%02llu: Timetag=%016llu: CSDB data=[ ", j, recPtr->
timeTag);
for (i=0; i<BLOCKCOUNT; i++)
printf(
"0x%02X ", recPtr->
data[i]);
printf("]\n\r");
}
...