MX Foundation 4
Error Injection

The normal usage of the aperiodic / periodic services is to send accurate data on the data bus. However, for testing purposes, a facility is needed to send erroneous data on the bus. This functionality allows an application to test if the receiving LRU can recover properly from transmission errors.

The MXF_A708_DATAREC.control field can be used for injection of errors on the data-bus.

Example

The following code shows how to inject errors using the ARINC 708 record control property.

ar708_tx_error_injection.c

#define MAX_TX_RECORDS_TO_TRANSMIT 10
uint32 rc=0;
MXF_A708_DATAREC *txHostBuffer=NULL;
MXF_A708_DATAREC *rec=NULL;
uint64 data, word;
...
if(!rc)
{
rec = txHostBuffer;
//Prepare records to send with an error injection in transmission for the 3rd record
for(data=0; data<MAX_TX_RECORDS_TO_TRANSMIT; data++)
{
rec->timeTag = 0;
if (data==2)
{
rec->control = MXF_A708_TX_REC_CTRL_MANCHESTERBIT_ERROR; //The 3rd record contains manchester error at bit 1000
rec->manchesterBitErr = 1000;
}
else
{
rec->control = 0;
rec->manchesterBitErr = 0;
}
rec->repeatCount = 1;
rec->dataSize = 200; //200 bytes corresponds to 1600 bits (see ARINC 708 specification)
for(word=0; word < rec->dataSize/2; word++) //The first 8 bits of each message have to be 0xB4
{
switch(word)
{
case 0:
rec->data[word] = 055;
break;
case 1:
case 2:
case 3:
case 4:
rec->data[word] = 0x0000;
break;
default:
rec->data[word] = (uint16)(0x0101*word);
}
}
rc = mxfA708NextDataRecordPtrGet(rec, &rec);
}
}
if(!rc)
{
printf("Transmitting ...\n");
// Transmits strings on relative record time
rc = mxfA708TxAperiodicWrite(txBuffer, MXF_TXAPERIODIC_FLAG_DEFAULT, 0, MAX_TX_RECORDS_TO_TRANSMIT, txHostBuffer);
}
...
Updated 10/23/2023