The basic logic to send periodic messages is as follows:
The example below illustrates how to put it together:
csdb_periodic.c
#define BUFFER_SIZE 4096 // 4KB
#define TX_MSG_LABEL 5
#define TX_MSG_SI 0
#define BLOCKCOUNT 6
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer[2];
HMXF_SCHED schedule;
HMXF_SCHED_MSG msg=0;
HMXF_SCHED_MSG_BUFFER msgBuf=0;
uint32 rc;
...
if(!rc)
if(!rc)
if (!rc)
{
if (!recCsdb)
rc = MAXT_ERROR_MEM;
}
if(!rc)
if(!rc)
if(!rc)
{
for (i=0; i<BLOCKCOUNT; i++)
}
if(!rc)
{
recCsdb->
data[0] = TX_MSG_LABEL;
recCsdb->
data[1] = TX_MSG_SI;
for (i=2; i<BLOCKCOUNT; i++)
recCsdb->
data[i]= (uint8)i;
}
if(!rc)
{
printf("Running periodic transmission, please wait...\n\r");
}
if(!rc)
{
}
if(recCsdb)
free(recCsdb)
...