The basic transmission method consists in sending one or more data records on the data bus and not care about any timing consideration between the records.
This is the most basic method to send data. The example below shows all the steps required to build a basic ARINC 708 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 mxfA708NextDataRecordPtrGet() function.
- Finally, the mxfA708TxAperiodicWrite() function with the MXF_TXAPERIODIC_FLAG_DEFAULT flag must be used.
Example
ar708_aperiodic.c
uint32 rc;
size_t txBufferSize;
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer;
uint32 delay100ms = 100000000;
uint64 data, word;
...
if(!rc)
{
txBufferSize = 4*1024;
if(!rc)
{
if(!txHostBuffer)
rc = MAXT_ERROR_MEM;
}
}
...
rec=txHostBuffer;
printf("\nAperiodic transmission (Relative Start Time-Default)\n");
for(data=0; data<MAX_TX_RECORDS_TO_TRANSMIT; data++)
{
for(word=0; word < rec->
dataSize/2; word++)
{
switch(word)
{
case 0:
break;
case 1:
case 2:
case 3:
rec->
data[word] = 0x0000;
break;
default:
rec->
data[word] = (uint16)(0x0101*data);
}
}
}
if(!rc)
{
printf("Transmitting ...\n");
rc =
mxfA708TxAperiodicWrite(txBuffer, MXF_TXAPERIODIC_FLAG_DEFAULT, delay100ms, MAX_TX_RECORDS_TO_TRANSMIT, txHostBuffer);
}
...