When an AFDX channel is allocated in raw mode a calling application receives the data directly from a physical port (Port-A or Port-B).
The way the channel is allocated is described below;
- A physical channel must be obtained using the mxfModuleChannelGet() function or with the mxfModuleChannelAllGet() function by specifying the
MXF_SCLASS_ALL
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 mxfA664RxAcqRead() function.
The MXF_A664_DATAREC
structure must be used for reading an ARINC 664 message with acquisition service.
Example
ar664_raw_rx.c
The example below shows how to implement an ARINC 664 basic receive acquisition application using a Raw port.
#define DATARECS_BUFFER_SIZE_MAX 64*1024
HMXF_CHANNEL phyChn = 0;
HMXF_BUFFER rxBuffer = 0;
uint64 usedBytes, freeBytes;
uint64 status, msgsCount, bytesCount;
uint64 recordIdx, dataIdx;
uint32 dataSize;
...
if (!rc)
if (!rc)
{
rec664 = malloc(DATARECS_BUFFER_SIZE_MAX);
memset(rec664, 0, DATARECS_BUFFER_SIZE_MAX);
if (!rec664)
rc = MAXT_ERROR_MEM;
}
if (!rc)
if (!rc)
if (!rc)
{
if (!rc && (status & MXF_RXACQ_STATUS_RUNNING))
printf("Acquisition Running\n\n");
}
...
rc =
mxfA664RxAcqRead(rxBuffer, 0, DATARECS_BUFFER_SIZE_MAX, &status, &msgsCount, &bytesCount, rec664);
if (!rc)
printf("%llu records received\n\n", msgsCount);
recPtr = rec664;
for (recordIdx = 0; recordIdx < msgsCount && !rc; recordIdx++)
{
printf(
" %03llu: timeTag=%012llu, Size=%u", recordIdx, recPtr->
timeTag, recPtr->
dataSize);
printf("\n data=");
for (dataIdx = 0; dataIdx < dataSize; dataIdx++)
{
printf(
"%02X ", recPtr->
data[dataIdx]);
if (!((dataIdx + 1) % 8) && (dataIdx + 1 < recPtr->
dataSize))
printf("\n ");
}
printf("\n\n");
}
...