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 control field of the MXF_CSDB_DATAREC can be used for injection errors on the data-bus.

Example

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

csdb_buffer_threshold.c

#define TX_MSG_LABEL 0xA0
#define TX_MSG_SI 0x1
#define TXALMOSTFULL 7
uint32 rc=0;
uint32 i;
MXF_CSDB_DATAREC *recPtr=hostBuffer;
static uint64 data=0;
...
// Refills the FIFO in order to produce a ramp
for(i=0; !rc && i<TXALMOSTFULL; i++)
{
// Sends a parity error on first record
recPtr->timeTag=0;
recPtr->control=(i!=0)?0:MXF_CSDB_TX_REC_CTRL_PARITY_ERROR;
recPtr->repeatCount=1;
recPtr->reserved=0;
recPtr->data[0] = TX_MSG_LABEL;
recPtr->data[1] = 0x40 | TX_MSG_SI;
recPtr->data[2] = (uint8)data;
recPtr->data[3] = (uint8)(data >> 8);
recPtr->data[4] = (uint8)data;
recPtr->data[5] = (uint8)(data >> 8);
data++;
rc = mxfCSDBNextDataRecordPtrGet(recPtr, &recPtr);
}
// Adds more data to the buffer
if(!rc)
rc = mxfCSDBTxPeriodicUpdateMsgWrite(buffer, i, hostBuffer);
...
Updated 10/23/2023