This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to purge the data request buffer every received beacon in TIMAC?

Hi all!

I have a beacon enabled network (BO=SO=1) with one coordinator and four end devices. The application has to work as follow: the devices try to send to the coordinator one data packet every received beacon. If the transmission fails, the device can try up to 3 retransmissions within the same superframe, if it has retransmissions left but the superframe is over, it is not allowed to retransmit in the following superframe.

My idea was to use the MAC_McpsPurgeReq(msa_handle) function before the MSA_McpsDataReq where 'msa_andle' is the handle associated with the previous data request. I can retrieve the correct msa_handle but the MAC_MCPS_PURGE_CNF always returns MAC_INVALID_HANDLE.

Here is my code:

/* we are inside the MSA_SEND_EVENT which is called every received beacon */

MAC_McpsPurgeReq(msa_handle);
msa_handle = MSA_McpsDataReq((uint8*)msa_Data1,
                                        MSA_PACKET_LENGTH,
                                        TRUE,
                                        msa_CoordShortAddr);
}

Any suggestion?