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?

Parents
  • 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:

                //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);
    

Reply
  • 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:

                //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);
    

Children
Related