The basic transmission method consists in sending one or more data records on the data bus and does not care about any timing consideration between the records.
This is the most basic method of sending data. The example below shows all the steps required to build a basic ARINC 717 transmission function.
- How to initialize and set a transmit channel was discussed in a previous section.
- Allocate the specific aperiodic buffer for transmission
- Build the data record.
- The time tag is set to 0 : transmit as soon as possible.
- The repeat count is set to 1 : the record will be not be repeated.
- The records in the buffer must be indexed by using the mxfA717NextDataRecordPtrGet() function.
- Finally, the mxfA717TxAperiodicWrite() function with
MXF_TXAPERIODIC_FLAG_DEFAULT
flag must be used.
Example
ar717.c
#define MAX_TX_SUBFRAMES_TO_TRANSMIT 4
uint32 rc;
HMXF_CHANNEL txChannel;
size_t txBufferSize;
HMXF_BUFFER txBuffer;
uint64 data;
uint64 word, subframeSize=VMXF_A717_SUBFRAME_SIZE_128;
...
if(!rc)
{
if(!rc)
{
if(!txHostBuffer)
rc = MAXT_ERROR_MEM;
}
}
if(!rc)
{
rec = txHostBuffer;
for(data=0; data<MAX_TX_SUBFRAMES_TO_TRANSMIT; data++)
{
rec->
dataSize = 2 * (uint32)subframeSize;
for(word=0; word < subframeSize; word++)
{
if (word == 0)
{
switch (data%4)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
}
else
rec->
data[word] = (uint16)(0x11*word);
}
}
}
if(!rc)
{
printf("Transmitting ...\n");
rc =
mxfA717TxAperiodicWrite(txBuffer, MXF_TXAPERIODIC_FLAG_DEFAULT, 0, MAX_TX_SUBFRAMES_TO_TRANSMIT, txHostBuffer);
}
...