First ANT message ?

Dear Members,

How can we determine the first ANT message from my transmitter ?

We saw from ant_parameters.h,

Which variable is being used ?

/** @brief Defines for accesssing ANT_MESSAGE members variables */
/** @name ANT serial message structure
 *  @{ */
#define ANT_MESSAGE_ulForceAlign          ulForceAlign
#define ANT_MESSAGE_aucMessage            aucMessage
#define ANT_MESSAGE_ucSize                stMessage.ucSize
#define ANT_MESSAGE_aucFramedData         stMessage.uFramedData.aucFramedData
#define ANT_MESSAGE_ucMesgID              stMessage.uFramedData.stFramedData.ucMesgID
#define ANT_MESSAGE_aucMesgData           stMessage.uFramedData.stFramedData.uMesgData.aucMesgData
#define ANT_MESSAGE_ucChannel             stMessage.uFramedData.stFramedData.uMesgData.stMesgData.uData0.ucChannel
#define ANT_MESSAGE_ucSubID               stMessage.uFramedData.stFramedData.uMesgData.stMesgData.uData0.ucSubID
#define ANT_MESSAGE_aucPayload            stMessage.uFramedData.stFramedData.uMesgData.stMesgData.aucPayload
#define ANT_MESSAGE_sExtMesgBF            stMessage.uFramedData.stFramedData.uMesgData.stMesgData.sExtMesgBF
#define ANT_MESSAGE_ucExtMesgBF           stMessage.uFramedData.stFramedData.uMesgData.stMesgData.sExtMesgBF.ucExtMesgBF
#define ANT_MESSAGE_stExtMesgBF           stMessage.uFramedData.stFramedData.uMesgData.stMesgData.sExtMesgBF.stExtMesgBF
#define ANT_MESSAGE_aucExtData            stMessage.uFramedData.stFramedData.uMesgData.stMesgData.aucExtData
#define ANT_MESSAGE_ucCheckSum            stMessage.ucCheckSum

Kind regards,

Rixtronix

Parents
  • I suggest to read from the ANT Message Protocol and Usage document to understand ANT and Burst transfer:
    https://www.thisisant.com/resources/ant-message-protocol-and-usage/  

    The api naming and event may have slightly changed over time, but the low level implemenation and consept is still the same as in the document.

    In specific chapter 5.4.3, 9.5.5.3 and 9.5.5.4 describes implementation.

    It may also be a good idea to run the advanced burst example for better understanding:
    https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ant_advanced_burst.html   

    Looking at the implementation of ant_evt_handler() in ant_advanced_burst.c you can find handling of EVENT_RX and check for MESG_BURST_DATA_ID. It is extraxting the sequence number of the burst packet from 

    m_sequence_number = SEQUENCE_NUMBER_MASK & p_ant_evt->message.ANT_MESSAGE_ucChannel;

    From chapter 9.5.5.3 you can find:

    "The upper three bits of the channel number field are used as a sequence number to ensure transfer integrity. The transmit MCU must ensure that the sequence numbers are generated correctly in order for the ANT burst state machine to function correctly. The first packet of a burst transfer will have a sequence number of %000. The sequence number is then incremented with %001 for each successive packet in the transfer rolling over back to %001, when a value of %011 is reached. The most significant bit of the sequence bits %100 is used as a flag to indicate the last packet in a Burst Transfer."

    Kenneth

Reply
  • I suggest to read from the ANT Message Protocol and Usage document to understand ANT and Burst transfer:
    https://www.thisisant.com/resources/ant-message-protocol-and-usage/  

    The api naming and event may have slightly changed over time, but the low level implemenation and consept is still the same as in the document.

    In specific chapter 5.4.3, 9.5.5.3 and 9.5.5.4 describes implementation.

    It may also be a good idea to run the advanced burst example for better understanding:
    https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ant_advanced_burst.html   

    Looking at the implementation of ant_evt_handler() in ant_advanced_burst.c you can find handling of EVENT_RX and check for MESG_BURST_DATA_ID. It is extraxting the sequence number of the burst packet from 

    m_sequence_number = SEQUENCE_NUMBER_MASK & p_ant_evt->message.ANT_MESSAGE_ucChannel;

    From chapter 9.5.5.3 you can find:

    "The upper three bits of the channel number field are used as a sequence number to ensure transfer integrity. The transmit MCU must ensure that the sequence numbers are generated correctly in order for the ANT burst state machine to function correctly. The first packet of a burst transfer will have a sequence number of %000. The sequence number is then incremented with %001 for each successive packet in the transfer rolling over back to %001, when a value of %011 is reached. The most significant bit of the sequence bits %100 is used as a flag to indicate the last packet in a Burst Transfer."

    Kenneth

Children
No Data
Related