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 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 newest received record. |
- The acquisition must be started using the mxfRxAcqStart() function.
- A read loop can be implemented using the mxfA708RxAcqRead() function. The mxfA708NextDataRecordPtrGet() function needs to be used to navigate in the receive buffer.
The MXF_A708_DATAREC structure must be used for reading ARINC 708 messages with acquisition service.
Example
The example below shows how to implement an ARINC 708 basic receive acquisition application.
ar708.c
uint64 rxBufferSize;
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
uint64 rxBufferAllocatedSize;
uint64 rxAcqStatus, msgCount, byteCount;
uint32 rc;
...
if(!rc)
{
rxBufferSize = 4*1024;
if(!rc)
{
if(!rxHostBuffer)
rc = MAXT_ERROR_MEM;
}
}
if (!rc)
if (!rc)
{
if (!rc)
printf("\nAcquisition started\n\r");
}
...
if(!rc)
{
printf("Receiving ...\n");
rc =
mxfA708RxAcqRead(rxBuffer, 0, rxBufferSize, &rxAcqStatus, &msgCount, &byteCount, rxHostBuffer);
}
if(!rc)
printf("String received count = %llu \n", msgCount);
if(!rc)
{
uint64 iRec,
iData;
printf("\n");
for(iRec=0; iRec < msgCount; iRec++)
{
for(iData=0; iData < p->
dataSize/2; iData++)
{
printf(
"%04x ", p->
data[iData]);
if(!((iData+1)%8) && (iData+1 < p->
dataSize/2))
printf("\n ");
}
printf("\n");
}
}
if(!rc)
...