MX Foundation 4
Error Injection

The BC allows the user to send messages with many error types (per message basis).

In order to send an erroneous message, the mxfASCBTxPeriodicUpdateMsgWrite() function may be used. The MXF_ASCB_DATAREC structure contains the control field that specifies the errors to inject.

To inject an error to a command that has no data associated to it (for example, a user request), the dataSize field of MXF_ASCB_DATAREC structure can be set to 0. That way, there is no need to provide any data.

uint32 rc;
HMXF_CHANNEL bc;
HMXF_BUFFER bcBufferTx[1];
MXF_ASCB_DATAREC* txBuffer;
MXF_ASCB_DATAREC* txRecAscb;
...
// Override hardware CRC value
if(!rc)
{
txRecAscb = (MXF_ASCB_DATAREC *)txBuffer;
memset(txRecAscb, 0, sizeof(MXF_ASCB_DATAREC));
txRecAscb->repeatCount = 1;
txRecAscb->control = MXF_ASCB_TX_REC_CTRL_HWCRC_NOT_SENT;
txRecAscb->dataSize = 4;
txRecAscb->data[0] = 0x0000;
txRecAscb->data[1] = 0x0000;
rc = mxfASCBTxPeriodicUpdateMsgWrite(bcBufferTx[0], 1, txBuffer);
}
...
Updated 10/23/2023