#include "example.h"
#define M_ADDRESS 5
#define M_SUBADDRESS 3
#define LOCAL
int main(void)
{
uint32 rc;
uint64 deviceCount=0;
uint64 moduleCount=0;
uint64 channelCount=0;
HMXF_SERVER server;
HMXF_DEVICE device=0;
HMXF_MODULE module=0;
HMXF_CHANNEL bc=0;
HMXF_BUFFER tx=0;
HMXF_BUFFER tx2=0;
HMXF_BUFFER rx=0;
size_t txBufferSize=0;
size_t rxBufferSize=0;
uint64 rxAcqStatus;
uint64 msgCount;
uint64 byteCount;
uint64 rxRec;
uint64 loop=0;
uint64 address, subAddress, dir, wordCount;
uint64 card=0, mod=0, port=0;
uint32 data;
char errorString[200];
#ifdef LOCAL
#else
#endif
if(!rc)
{
if(rc == MAXT_ERROR_ANOTHER_PROCESS_RUNNING)
{
}
}
if(!rc)
if(!rc && deviceCount)
{
if (!rc && !moduleCount)
}
if(!rc && moduleCount)
if(!rc && !channelCount)
rc = MAXT_ERROR_NOT_FOUND;
if(!rc)
if (!rc)
printf("BC location is Device:%llu Module:%llu Port:%llu\n\r", card, mod, port);
if(!rc)
{
txBufferSize = 1024;
if(!rc)
if(!rc)
{
if(!txBuffer)
rc = MAXT_ERROR_MEM;
}
}
if(!rc)
{
rxBufferSize = 20*1024;
if(!rc)
{
if(!rxBuffer)
rc = MAXT_ERROR_MEM;
}
}
if(!rc)
if(!rc)
if(!rc)
{
memset(minorFrame, 0, sizeof(minorFrame));
if(!rc)
{
}
if(!rc)
{
}
if(!rc)
}
if(!rc)
{
txRec1553->
data[0] = 0x0000;
txRec1553->
data[1] = 0x0000;
txRec1553->
data[2] = 0x1111;
txRec1553->
data[3] = 0x2222;
txRec1553->
data[4] = 0x3333;
txRec1553->
data[5] = 0x4444;
txRec1553->
data[6] = 0x5555;
txRec1553->
data[7] = 0x6666;
txRec1553->
data[8] = 0x7777;
txRec1553->
data[9] = 0x8888;
txRec1553->
data[10] = 0x9999;
txRec1553->
data[11] = 0xAAAA;
txRec1553->
data[12] = 0xBBBB;
txRec1553->
data[13] = 0xCCCC;
txRec1553->
data[14] = 0xDDDD;
txRec1553->
data[15] = 0xEEEE;
txRec1553->
data[16] = 0xFFFF;
}
if(!rc)
if(!rc)
if(!rc)
{
do
{
if (rc)
{
printf("mxfMIL1553RxAcqRead() failed; rc=0x%08x\n\r", rc);
break;
}
for(rxRec=0; rxRec<msgCount && !rc; rxRec++)
{
if(!rc)
{
if(!rc)
{
printf(
"\n\r%llu:\t", rxRec1553->
timeTag);
{
case MXF_MIL1553_MSGINFO_TYPE_BCRT:
printf(
"BC to RT%llu SA%llu WC%llu (0x%04x)\n\r", address, subAddress, wordCount, rxRec1553->
data[0]);
printf(
"\t\tRT status: 0x%04x\n\r", rxRec1553->
data[msgInfo.
statusIndex[0]]);
break;
case MXF_MIL1553_MSGINFO_TYPE_RTBC:
printf(
"RT%llu SA%llu WC%llu to BC (0x%04x)\n\r", address, subAddress, wordCount, rxRec1553->
data[0]);
printf(
"\t\tRT status: 0x%04x\n\r", rxRec1553->
data[msgInfo.
statusIndex[0]]);
printf("\t\tRT data:");
for(data=0; data<msgInfo.dataWordCount; data++)
{
if(data && !(data%4))
printf("\n\r\t\t\t");
}
printf("\n\r");
break;
case MXF_MIL1553_MSGINFO_TYPE_MODECODE_TXDATA:
printf(
"BC Mode Command %llu to RT%llu SA%llu (0x%04x)\n\r", wordCount, address, subAddress, rxRec1553->
data[0]);
{
printf(
"\t\tRT status: 0x%04x\n\r", rxRec1553->
data[msgInfo.
statusIndex[0]]);
printf(
"\t\tRT data: 0x%04x\n\r", rxRec1553->
data[msgInfo.
dataIndex]);
}
break;
}
}
}
}
loop++;
} while(loop < 300);
}
if(!rc)
if(!rc)
if(!rc)
if(rc)
{
sprintf (errorString,"ERROR # 0x%08X", rc);
printf("%s\n\r", errorString);
}
if(txBuffer)
free(txBuffer);
if(rxBuffer)
free(rxBuffer);
if (rc == MAXT_ERROR_ANOTHER_PROCESS_RUNNING)
{
}
printf("\n\rPress enter to terminate\n\r");
getchar();
return 0;
}