The way to set a basic sampling receive application is as follows:
The MXF_A429_SAMPREC
structure must be used for reading an ARINC 429 message with sampling service.
Example
ar429_rx_sampling.c
The example below shows how to implement an ARINC 429 sampling receive application.
#define BUFFER_SIZE 4096 // 4KB
#define LABEL 3
HMXF_SERVER server;
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
uint32 label=LABEL, sdi, data, ssm, parity;
uint64 msgsCount, bytesCount;
uint64 j;
uint32 rc;
...
if (!rc)
if(!rc)
{
if(!hostBuffer)
rc = MAXT_ERROR_MEM;
}
if(!rc)
if (!rc)
if (!rc)
if(!rc)
...
if(!rc)
{
rc =
mxfA429RxSamplingRead(rxBuffer, MXF_RXSAMPLING_FLAG_DEFAULT, 0, BUFFER_SIZE, &msgsCount, &bytesCount, hostBuffer);
if(!rc)
{
printf("Read %llu messages\n\r", msgsCount);
for (j=0; !rc && j<msgsCount; j++)
{
if(!rc)
{
printf("%02llu: Timetag %llu - ARINC word=[%03llo,%lld,%05llX,%lld,%s]\n",
j, recSamp->
timeTag, label, sdi, data, ssm, (parity==VMXF_A429_PARITY_ODD)?
"ODD":
"EVEN");
if(!rc)
}
}
}
}
...