This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to get ant sensor serial number?

I want to read the serial number of the second page package,use the SDK 13.0,\examples\ant\ant_continuous_scanning_controller,it can't get the serial number,how to do?

  • I believe the Ant Message Protocol and Usage -document describe how you can enable Extended Messages Format. The <SDK>\examples\ant\experimental\ant_shared_channel\master_to_master in asc_master_to_master.c show for instance how to extract the peer device number and compare with it's own to select which should be the master or slave, I believe similar approach is what you want:

    Fullscreen
    1
    2
    3
    4
    5
    6
    //determine whether this device is to be a master or a slave, and continue to the connected state
    if (p_ant_message[ANT_MESSAGE_FLAG_OFFSET] == ANT_EXT_MESG_BITFIELD_DEVICE_ID)
    {
    //Fill the temporary neighbor with the device number and rssi value from the received message
    //page number and payload are not relevant at the moment, so ignore them
    m_neighbor.device_number = p_ant_message[ANT_MESSAGE_EXTENDED0_OFFSET] | (((uint16_t) p_ant_message[ANT_MESSAGE_EXTENDED1_OFFSET]) << 8);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • I want to get the extended device number,it is 24bits data。I can’t get the high 8 bits realtime。