In order to transmit data using an AFDX COM Queuing port you must:
- Create the transmission virtual link using the mxfA664VlCreate() function.
- Create the queuing port using the mxfA664PortCreate() function.
- The messages to be sent must be stored in a MXF_A664_DATAREC structure.
- Start transmission using the mxfA664TxAperiodicWrite() function with the port handle. No timing option is available, the transmission timing is controlled by the VL BAG scheduler.
Example
ar664_com_queuing_basic.c
The code snippets below demonstrate the basic steps needed to setup a COM port transmission.
if (!rc)
{
vlParam.
frameType = MXF_A664_FRAME_TYPE_ARINC664;
}
if (!rc)
{
inet_pton(AF_INET, DST_IP_ADRS, &srcIpAdrs);
inet_pton(AF_INET, SRC_IP_ADRS, &dstIpAdrs);
portParam.
portType = MXF_A664_PORT_TYPE_COM;
portParam.
family = MXF_A664_PORT_FAMILY_IPV4;
portParam.
mode = MXF_A664_PORT_MODE_QUEUING;
}
if (!rc)
{
txRec = malloc(DATARECS_BUFFER_SIZE_MAX);
memset(txRec, 0, DATARECS_BUFFER_SIZE_MAX);
if (!txRec)
rc = MAXT_ERROR_MEM;
}
for (iRecord = 0, data = txRec; iRecord < maxTxRecords && !rc; iRecord++)
{
data->control = 0;
data->dataSize = TEST_DATASIZE;
data->repeatCount = 1;
for (iData = 0; iData < TEST_DATASIZE; iData++)
data->data[iData] = (uint8)((iData + ((iRecord*TEST_DATASIZE) & 0xff)));
}
if (!rc)
{
printf("%llu frames transmitted\n\n", count);
}
...
if (!rc)
...