The way to setup a basic sampling receive application is as follows:
The MXF_CSDB_SAMPREC
structure must be used for reading a CSDB message with the sampling service.
Example
csdb_rx_sampling.c
The example below shows how to implement a CSDB sampling receive application.
#define BUFFER_SIZE 4096 // 4KB
#define LABEL 0x3
#define BLOCKCOUNT 6
HMXF_SERVER server;
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
uint64 label=0xA5;
uint64 msgsCount, bytesCount;
uint64 j;
uint32 rc;
...
if (!rc)
if(!rc)
{
if(!hostBuffer)
rc = MAXT_ERROR_MEM;
}
if(!rc)
if (!rc)
if (!rc)
if(!rc)
...
if(!rc)
{
rc =
mxfCSDBRxSamplingRead(rxBuffer, MXF_RXSAMPLING_FLAG_DEFAULT, 0, BUFFER_SIZE, &msgsCount, &bytesCount, hostBuffer);
if(!rc)
{
printf("Read %llu messages\n\r", msgsCount);
for (j=0; !rc && j<msgsCount; j++)
{
printf(
"%02llu: Timetag=%016llu: CSDB data=[ ", j, recSamp->
timeTag);
for (dataIndex=0; dataIndex<BLOCKCOUNT; dataIndex++)
printf(
"0x%02X ", recSamp->
data[dataIndex]);
printf("]\n\r");
}
}
}
...