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

Where I can read transmission type and device number of connected ANT+ device (HRM)?

Hi everyone,

Where I can read transmission type and device number of connected ANT+ device (HRM)? I want save those values and bound later only with currently connected device. Wildcard values are used (0) so any device near can connect. I'm using nRF51422, SD210 and hrt_rx example from sdk 10.0.

Thanks in advance, Krunoslav

Parents
  • You can have a look at the ant_background_scanning example.

    See application_initialize(). To get ANT to pass the Device ID (device number, device type and transmisson type) you can use the following library configuration:

    /* Set library config to report Device ID */
    uint32_t err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    APP_ERROR_CHECK(err_code);
    

    See background_scanner_process(). When you get the EVENT_RX event, you can get the device number with

    uint16_t device_id = (uint16_t)(p_ant_message->ANT_MESSAGE_aucExtData[0]
                       | ((uint16_t)p_ant_message->ANT_MESSAGE_aucExtData[1] << 8));
    

    and transmisson type with

    uint8_t trans_type = p_ant_message->ANT_MESSAGE_aucExtData[3];
    
Reply
  • You can have a look at the ant_background_scanning example.

    See application_initialize(). To get ANT to pass the Device ID (device number, device type and transmisson type) you can use the following library configuration:

    /* Set library config to report Device ID */
    uint32_t err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    APP_ERROR_CHECK(err_code);
    

    See background_scanner_process(). When you get the EVENT_RX event, you can get the device number with

    uint16_t device_id = (uint16_t)(p_ant_message->ANT_MESSAGE_aucExtData[0]
                       | ((uint16_t)p_ant_message->ANT_MESSAGE_aucExtData[1] << 8));
    

    and transmisson type with

    uint8_t trans_type = p_ant_message->ANT_MESSAGE_aucExtData[3];
    
Children
Related