I did find support for handling burst data in the sim, so added the following to the ANTChannel.cpp code
void ANTChannel::ANTChannelEvent(UCHAR ucEvent_, UCHAR* pcBuffer_)
{
...
switch(ucEvent_)
{
...
case EVENT_RX_BURST_PACKET:
{
curSimulator->ANT_eventNotification(ucEvent_, pcBuffer_);
break;
}
case EVENT_RX_SEARCH_TIMEOUT:
...
And in my device code, implemented the following to accept the event and handle it. Note that the HandleBurst function will automatically open and write data to a file
void CalorieDisplay::ANT_eventNotification(UCHAR ucEventCode_, UCHAR* pucEventBuffer_)
{
switch(ucEventCode_)
{
...
case EVENT_RX_BURST_PACKET:
HandleBurst((UCHAR*) pucEventBuffer_);
break;
case EVENT_TRANSFER_TX_COMPLETED:
...
}
}
void CalorieDisplay::HandleBurst(UCHAR* pucRxBuffer_){
DWORD dwWritten;
UCHAR aucMsg[8] = {0,0,0,0,0,0,0,0};
UCHAR I;
if(pucRxBuffer_[0]==0)
{//need to open file on first burst packet
hBurstFile = CreateFileA("F:\\\\LifeChek\\\\PCMdata.bin",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
this->lblFileName->Text = "Downloading...";
}
else
if(pucRxBuffer_[0]==0xC0)
{//need to close file on last burst packet
CloseHandle(hBurstFile);
this->lblFileName->Text = "Download complete!";
}
else
{//
for(I=0;I<8;I++)
{
aucMsg = pucRxBuffer_[I+1];
}
WriteFile(hBurstFile,(CHAR*) aucMsg,8,&dwWritten;,NULL);
}
}