#include "example.h"
#define NUM_REC_TX 10
#define LOCAL
int main(void)
{
uint32 rc;
uint64 deviceCount;
uint64 moduleCount=0;
uint64 channelCount=0;
HMXF_SERVER server;
HMXF_DEVICE device=0;
HMXF_MODULE module=0;
HMXF_CHANNEL bc=0;
HMXF_BUFFER bcBufferTx=0;
HMXF_BUFFER bcBufferRx=0;
uint32 txBufferSize;
uint32 rxBufferSize=0;
uint64 card, mod, port;
uint64 cmd;
uint64 rxAcqStatus;
uint64 msgCount;
uint64 byteCount;
uint64 rxRec;
uint32 data;
uint64 options;
char errorString[200];
#ifdef LOCAL
#else
#endif
if(!rc)
{
printf("Starting ...\n");
}
if(!rc)
if(!rc)
if (!rc && !moduleCount)
if(!rc && moduleCount)
if(!rc && !channelCount)
rc = MAXT_ERROR_NOT_FOUND;
if (!rc)
printf("BC location is Device:%llu Module:%llu Port:%llu\n", card, mod, port);
if (!rc)
{
if(!rc && (options & VMXF_MIL1553_MODULE_OPTIONS_HYBRID_MODE))
{
if (!rc)
}
}
#ifdef LOOPBACK
if(!rc)
#endif
if(!rc)
{
if(!rc)
{
if(!txBuffer)
rc = MAXT_ERROR_MEM;
}
}
if(!rc)
{
rxBufferSize = 10*1024;
if(!rc)
{
if(!rxBuffer)
rc = MAXT_ERROR_MEM;
}
}
if(!rc)
if(!rc)
txRec1553 = txBuffer;
for(cmd=0; cmd<NUM_REC_TX && !rc; cmd++)
{
if(cmd % 2)
{
txRec1553->
data[1] = 0x0000;
txRec1553->
data[2] = 0x1111;
txRec1553->
data[3] = 0x2222;
txRec1553->
data[4] = 0x3333;
}
else
{
txRec1553->
data[1] = 0x3333;
txRec1553->
data[2] = 0x2222;
txRec1553->
data[3] = 0x1111;
txRec1553->
data[4] = 0x0000;
}
}
if (!rc)
if(!rc)
{
rc =
mxfMIL1553RxAcqRead(bcBufferRx, 0, rxBufferSize, &rxAcqStatus, &msgCount, &byteCount, rxBuffer);
rxRec1553 = rxBuffer;
for(rxRec=0; rxRec<msgCount && !rc; rxRec++)
{
printf(
"\n\r%llu:\t", rxRec1553->
timeTag);
printf(
"Control: 0x%08x", rxRec1553->
control);
for(data=0; data<rxRec1553->
dataSize/2; data++)
{
if(data && !(data%5))
printf("\n\r\t\t\t");
printf(
" 0x%04x", rxRec1553->
data[data]);
}
printf("\n\r");
}
}
if(!rc)
if(!rc)
if(!rc)
if(txBuffer)
free(txBuffer);
if(rxBuffer)
free(rxBuffer);
if(rc)
{
sprintf (errorString,"ERROR # 0x%08X", rc);
printf("%s\n\r", errorString);
}
if (device)
printf("\n\rPress enter to terminate\n\r");
getchar();
return 0;
}