The basic logic to send periodic messages is as follows:
The example below illustrates how to put it together:
ar708_periodic.c
#define BUFFER_SIZE 4096 // 4KB
uint32 rc;
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer;
HMXF_SCHED schedule;
HMXF_SCHED_MSG msg=0;
uint64 data, word;
...
if (!rc)
if(!rc)
if (!rc)
{
if (!txHostBuffer)
rc = MAXT_ERROR_MEM;
}
if(!rc)
if(!rc)
if(!rc)
{
rec = txHostBuffer;
for(data=0; data<MAX_TX_RECORDS_TO_TRANSMIT; data++)
{
for(word=0; word < rec->
dataSize/2; word++)
{
switch(word)
{
case 0:
break;
case 1:
case 2:
case 3:
case 4:
rec->
data[word] = 0x0000;
break;
default:
rec->
data[word] = (uint16)(0x0101*data);
}
}
}
}
if (!rc)
if(!rc)
{
printf("Running periodic transmission, please wait...\n\r");
}
if(!rc)
{
}
...