#include "example.h"
#define ADDRESS 5
#define SUBADDRESS 3
#define ALMOST_FULL 10
#define ALMOST_EMPTY 5
#define MIL1553_IDX 0
#define A429_IDX 1
#define CSDB_IDX 2
#define ASYNC_IDX 3
#define DISCRETE_IDX 4
#define HDLC_IDX 5
#define BUFFER_SIZE 1*1024*1024 // 1MB
#define RATE 250*1000*1000 // 250msec
#define MIL1553
#define A429
#define CSDB
#define ASYNC
#define DISCRETE
#define HDLC
typedef struct
{
HMXF_CHANNEL txChannel;
HMXF_CHANNEL rxChannel;
HMXF_BUFFER txBuffer;
HMXF_BUFFER rxBuffer;
HMXF_SCHED sched;
}
EVENT_INFO_CHANNEL;
typedef struct
{
EVENT_INFO_CHANNEL channel[6];
void* hostBuffer;
void* reserved;
}
EVENT_INFO;
uint32 initHandler(HMXF_SERVER server, uint64 deviceIndex, uint64 moduleIndex, uint64 channelIndex, uint64 attrib, uint64* value);
uint32 eventHandler(HMXF_HANDLE asyncEvent, void* pParam);
#ifdef MIL1553
uint32 startMil1553(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopMil1553(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
#ifdef A429
uint32 startA429(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopA429(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
#ifdef CSDB
uint32 startCSDB(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopCSDB(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
#ifdef ASYNC
uint32 startASYNC(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopASYNC(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
#ifdef DISCRETE
uint32 startDiscrete(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopDiscrete(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
#ifdef HDLC
uint32 startHDLC(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
uint32 stopHDLC(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn);
#endif
int main(void)
{
uint32 rc;
uint64 deviceCount=0;
HMXF_SERVER server;
HMXF_DEVICE device=0;
EVENT_INFO eventInfo;
HMXF_ASYNCEVENT asyncEvent=0;
char errorString[200];
#ifdef LOCAL
#else
#endif
if(rc!=MAXT_SUCCESS)
{
printf("Failed to connect; rc=0x%08x", rc);
getchar();
return 0;
}
printf("\n\rStarting\n\r");
memset(&eventInfo, 0, sizeof(eventInfo));
if(!rc)
{
if(!rc && (deviceCount == 0))
rc = MAXT_ERROR_DEVICE_NOT_DETECTED;
}
if(!rc)
if (!rc)
if(!rc)
if(!rc)
{
eventInfo.hostBuffer = malloc(BUFFER_SIZE);
if(!eventInfo.hostBuffer)
rc = MAXT_ERROR_MEM;
}
if(!rc)
#ifdef MIL1553
if(!rc)
rc = startMil1553(device, asyncEvent, &eventInfo.channel[MIL1553_IDX]);
#endif
#ifdef A429
if(!rc)
rc = startA429(device, asyncEvent, &eventInfo.channel[A429_IDX]);
#endif
#ifdef CSDB
if(!rc)
rc = startCSDB(device, asyncEvent, &eventInfo.channel[CSDB_IDX]);
#endif
#ifdef ASYNC
if(!rc)
rc = startASYNC(device, asyncEvent, &eventInfo.channel[ASYNC_IDX]);
#endif
#ifdef DISCRETE
if(!rc)
rc = startDiscrete(device, asyncEvent, &eventInfo.channel[DISCRETE_IDX]);
#endif
#ifdef HDLC
if(!rc)
rc = startHDLC(device, asyncEvent, &eventInfo.channel[HDLC_IDX]);
#endif
if(!rc)
#ifdef MIL1553
if(!rc)
rc = stopMil1553(asyncEvent, &eventInfo.channel[MIL1553_IDX]);
#endif
#ifdef A429
if(!rc)
rc = stopA429(asyncEvent, &eventInfo.channel[A429_IDX]);
#endif
#ifdef CSDB
if(!rc)
rc = stopCSDB(asyncEvent, &eventInfo.channel[CSDB_IDX]);
#endif
#ifdef ASYNC
if(!rc)
rc = stopASYNC(asyncEvent, &eventInfo.channel[ASYNC_IDX]);
#endif
#ifdef DISCRETE
if(!rc)
rc = stopDiscrete(asyncEvent, &eventInfo.channel[DISCRETE_IDX]);
#endif
#ifdef HDLC
if(!rc)
rc = stopHDLC(asyncEvent, &eventInfo.channel[HDLC_IDX]);
#endif
if(asyncEvent)
if(rc)
{
sprintf (errorString,"ERROR # 0x%08X", rc);
printf("%s\n\r", errorString);
}
if(eventInfo.hostBuffer)
free(eventInfo.hostBuffer);
printf("\n\rPress a key to terminate\n\r");
getchar();
return 0;
}
uint32 initHandler(HMXF_SERVER server, uint64 deviceIndex, uint64 moduleIndex, uint64 channelIndex, uint64 attrib, uint64* value)
{
HMXF_DEVICE device;
uint32 rc;
server=server;
deviceIndex=deviceIndex;
if(attrib == KMXF_CHANNEL_CLASS)
{
if (!rc)
if(!rc && (deviceInfo.
modules[moduleIndex].
type == MXF_MODULE_ASYNC_EH))
{
if ((channelIndex == 0) || (channelIndex == deviceInfo.
modules[moduleIndex].
txCount))
{
*value = MXF_CLASS_CSDB;
return TRUE;
}
}
else
{
if ((channelIndex == 0) || (channelIndex == 8))
{
*value = MXF_CLASS_HDLC;
return TRUE;
}
else if ((channelIndex == 4) || (channelIndex == 12))
{
*value = MXF_CLASS_CLOCK;
return TRUE;
}
}
}
return FALSE;
}
uint32 startMil1553(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
uint64 count;
if(!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
if(!rc)
if(!rc)
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
if(!rc)
if(!rc)
{
memset(minorFrame, 0, sizeof(minorFrame));
minorFrame[0].
buffer = eventInfoChn->txBuffer;
}
if(!rc)
if(!rc)
{
printf("Starting MIL1553\n\r");
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.channel = eventInfoChn->txChannel;
}
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
if(!rc)
return rc;
}
uint32 startA429(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
HMXF_SCHED_MSG msgSched=0;
uint64 count;
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
if(!rc)
if(!rc)
{
rc =
mxfModuleChannelAllGet(module, MXF_CLASS_A429, MXF_SCLASS_RX_CHANNEL, 1, &count, &eventInfoChn->rxChannel);
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
}
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
if(!rc)
if(!rc)
{
printf("Starting A429\n\r");
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.channel = eventInfoChn->txChannel;
}
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
if(!rc)
if(!rc)
if(!rc)
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
if(!rc)
return rc;
}
uint32 startCSDB(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
HMXF_SCHED_MSG msgSched=0;
HMXF_BUFFER txSyncBuffer=0;
HMXF_BUFFER txBuffer[2];
uint64 count;
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
if(!rc)
if(!rc)
{
rc =
mxfModuleChannelAllGet(module, MXF_CLASS_CSDB, MXF_SCLASS_RX_CHANNEL, 1, &count, &eventInfoChn->rxChannel);
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
}
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
if(!rc)
if(!rc)
if(!rc)
{
printf("Starting CSDB\n\r");
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txPeriodicUpdateMsgBufferThreshold.channel = eventInfoChn->txChannel;
}
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
if(!rc)
if(!rc)
{
txBuffer[0] = txSyncBuffer;
txBuffer[1] = eventInfoChn->txBuffer;
}
if(!rc)
{
recTXCsdb[0].
data[0] = 0xA5;
recTXCsdb[0].
data[1] = 0xA5;
recTXCsdb[0].
data[2] = 0xA5;
recTXCsdb[0].
data[3] = 0xA5;
recTXCsdb[0].
data[4] = 0xA5;
recTXCsdb[0].
data[5] = 0xA5;
}
if(!rc)
if(!rc)
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
if(!rc)
return rc;
}
uint32 startASYNC(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
uint64 count;
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
if (!rc)
if (!rc)
{
rc =
mxfModuleChannelAllGet(module, MXF_CLASS_ASYNC_ENHANCED, MXF_SCLASS_RX_CHANNEL, 1, &count, &eventInfoChn->rxChannel);
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
}
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
if(!rc)
rc =
mxfTxAperiodicBufferAlloc(eventInfoChn->txChannel, MXF_TXAPERIODIC_PRIORITY_NORMAL, BUFFER_SIZE, &eventInfoChn->txBuffer, NULL);
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
{
printf("Starting ASYNC\n\r");
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.buffer = eventInfoChn->txBuffer;
}
return rc;
}
uint32 startDiscrete(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
uint64 moduleCount;
if(!rc)
if(!rc)
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
rc =
mxfTxAperiodicBufferAlloc(eventInfoChn->txChannel, MXF_TXAPERIODIC_PRIORITY_NORMAL, BUFFER_SIZE, &eventInfoChn->txBuffer, NULL);
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
{
printf("Starting Discrete\n\r");
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.buffer = eventInfoChn->txBuffer;
}
return rc;
}
uint32 startHDLC(HMXF_DEVICE device, HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
HMXF_MODULE module;
uint64 count;
if(!rc && count)
rc =
mxfModuleChannelAllGet(module, MXF_CLASS_HDLC, MXF_SCLASS_TX_CHANNEL, 1, &count, &eventInfoChn->txChannel);
if (!rc && count)
rc =
mxfModuleChannelAllGet(module, MXF_CLASS_HDLC, MXF_SCLASS_RX_CHANNEL, 1, &count, &eventInfoChn->rxChannel);
if (!rc && !count)
rc = MAXT_ERROR_NOT_FOUND;
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
rc =
mxfTxAperiodicBufferAlloc(eventInfoChn->txChannel, MXF_TXAPERIODIC_PRIORITY_NORMAL, BUFFER_SIZE, &eventInfoChn->txBuffer, NULL);
if(!rc)
if(!rc)
{
memset(&eventInfoChn->rxCondition, 0, sizeof(eventInfoChn->rxCondition));
eventInfoChn->rxCondition.condID = MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->rxCondition.condition.rxAcqBufferThreshold.buffer = eventInfoChn->rxBuffer;
}
if(!rc)
{
printf("Starting HDLC\n\r");
rc =
mxfRxAcqStart(eventInfoChn->rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
}
if(!rc)
{
memset(&eventInfoChn->txCondition, 0, sizeof(eventInfoChn->txCondition));
eventInfoChn->txCondition.condID = MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostEmpty = ALMOST_EMPTY;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.almostFull = ALMOST_FULL;
eventInfoChn->txCondition.condition.txAperiodicBufferThreshold.buffer = eventInfoChn->txBuffer;
}
return rc;
}
uint32 stopMil1553(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping MIL1553\n\r");
if(!rc)
if(!rc)
if(!rc)
return rc;
}
uint32 stopA429(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping A429\n\r");
if(!rc)
if(!rc)
if(!rc)
return rc;
}
uint32 stopCSDB(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping CSDB\n\r");
if(!rc)
if(!rc)
if(!rc)
return rc;
}
uint32 stopASYNC(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping ASYNC\n\r");
if(!rc)
if(!rc)
return rc;
}
uint32 stopDiscrete(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping Discrete\n\r");
if(!rc)
if(!rc)
return rc;
}
uint32 stopHDLC(HMXF_ASYNCEVENT asyncEvent, EVENT_INFO_CHANNEL *eventInfoChn)
{
uint32 rc;
printf("Stopping HDLC\n\r");
if(!rc)
if(!rc)
return rc;
}
uint32 eventHandler(HMXF_HANDLE asyncEvent, void* pParam)
{
EVENT_INFO* eventInfo=(EVENT_INFO*)pParam;
uint32 rc=0;
uint64 eventCount;
uint64 rec;
if(!rc)
{
{
case MXF_ASYNCEVENT_COND_TXPERIODIC_UPDATEMSG_BUFFER_THRESHOLD:
{
{
memset(txRec, 0, BUFFER_SIZE);
{
txRec->
data[1] = (uint16)rec;
txRec->
data[2] = (uint16)rec;
txRec->
data[3] = (uint16)rec;
txRec->
data[4] = (uint16)rec;
}
}
{
memset(txRec, 0, BUFFER_SIZE);
{
}
}
{
memset(txRec, 0, BUFFER_SIZE);
{
txRec->
data[0] = (uint8)rec;
txRec->
data[1] = (uint8)rec;
txRec->
data[2] = (uint8)rec;
txRec->
data[3] = (uint8)rec;
txRec->
data[4] = (uint8)rec;
txRec->
data[5] = (uint8)rec;
}
}
break;
}
case MXF_ASYNCEVENT_COND_TXAPERIODIC_BUFFER_THRESHOLD:
{
{
int i;
memset(txRec, 0, BUFFER_SIZE);
{
for(i=0; i<10; i++)
txRec->
data[i] = (uint8)rec;
}
}
{
static uint64 timer=0;
if(timer == 0)
{
uint64 device;
if(!rc)
if(rc)
break;
}
memset(txRec, 0, BUFFER_SIZE);
{
txRec->
data = (uint8)rec;
timer += RATE;
}
}
{
uint64 i;
memset(txRec, 0, BUFFER_SIZE);
{
txRec->
data[i] = (uint16)rec;
}
}
break;
}
case MXF_ASYNCEVENT_COND_RXACQ_BUFFER_THRESHOLD:
{
uint64 rxAcqStatus, msgCount, byteCount;
if(rc)
break;
{
uint64 data;
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"MIL1553 --> %012llu ", rxRec->
timeTag);
for(data=0; data < min(8, rxRec->
dataSize/2); data++)
{
printf(
"%04X ", rxRec->
data[data]);
}
printf("\n\r");
}
}
{
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"A429 --> %012llu ", rxRec->
timeTag);
printf(
"%08X \n\r", rxRec->
data);
}
}
{
uint64 data;
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"CSDB --> %012llu ", rxRec->
timeTag);
for(data=0; data < 6; data++)
{
printf(
"%02X ", rxRec->
data[data]);
}
printf("\n\r");
}
}
{
uint64 data;
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"ASYNC --> %012llu ", rxRec->
timeTag);
for(data=0; data < rxRec->
dataSize; data++)
{
printf(
"%02X ", rxRec->
data[data]);
}
printf("\n\r");
}
}
{
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"DISCRETE --> %012llu ", rxRec->
timeTag);
printf(
"%02X ", (uint8)rxRec->
edge);
printf(
"%02X \n\r", (uint8)rxRec->
data);
}
}
{
uint64 data;
for(rec=0; !rc && rec<msgCount; rec++)
{
printf(
"HDLC --> %012llu ", rxRec->
timeTag);
for(data=0; data < min(8, rxRec->
dataSize/2); data++)
{
printf(
"%04X ", rxRec->
data[data]);
}
printf("\n\r");
}
}
break;
}
}
}
if(rc)
printf("event handler rc=0x%08x\n\r", rc);
return rc;
}