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.

CCS/LAUNCHXL-CC1352R1: Obtain Mac Transmission Timestamp on the Application

Part Number: LAUNCHXL-CC1352R1
Other Parts Discussed in Thread: Z-STACK

Tool/software: Code Composer Studio

Greetings,

I am using the SimpleLink SDK for 13x2 & 26x2 version 3.30. I have managed to obtain the MAC reception timestamp of a message on the application through the member "timestamp" from the struct datatype "zstack_afIncomingMsgInd_t" in the functions of the sample projects (for example: zclSampleLight_processAfIncomingMsgInd( ) ).

My question is how to obtain the MAC transmission timestamps when sending a message? For example, the function Zstackapi_AfDataReq() will return an error/success flag, is there function that will return the TX MAX timestamp? Or a way of sending such a timestamp through an OSAL message?

  • Hi,

    In general this is not available to the application layer.

    You could potentially use the timestamp field of ZMacDataCnf_t (which should be the same units as timestamp field of zstack_afIncomingMsgInd_t), but this will require code modifications. Please see how ZMacDataCnf_t is used in the projects.

    Regards,
    Toby

  • Hi Toby,

    Thank you for the reply. I will check how this structure is used.

  • Just to update whoever checks this post.

    The data confirmation message from Z-Stack to the application is sent in the function INTERP_DataConfirm( ZMacDataCnf_t *dataCnf ) in stub_aps.c by means of calling the function afDataConfirm(...) but the timestamp contained in the type ZMacDataCnf_t is not passed into the second function.

    In order to rescue this timestamp, inside the function INTERP_DataConfirm(...), I write the timestamp in dataCnf->Timestamp2 into a global uint16_t. Notice that the transmission timestamp ZMacDataCnf_t.Timestamp2 is of 16-bits in contrast with the reception timestamp zstack_afIncomingMsgInd_t.timestamp which is of 32-bits.

    Make sure to check for race conditions when using this global variable between two threads. In my case, this is the only instance when this global variable is written to, every other use is for reading only.

  • Thanks for sharing the solution you used.

    Please note that ZMacDataCnf_t has both timestamp (32 bits) and timestamp2 (16 bit) fields.
    These correspond to the data confirm ApiMac_mcpsDataCnf_t used by the 802.15.4 layers.