/**@brief Function for SDM Profile initialization. * * @details Initializes the SDM Profile and opens the ANT channel. */ static void profile_setup(void) { /** @snippet [ANT SDM TX Profile Setup] */ uint32_t err_code; err_code = ant_sdm_sens_init(&m_ant_sdm, SDM_SENS_CHANNEL_CONFIG(m_ant_sdm), SDM_SENS_PROFILE_CONFIG(m_ant_sdm)); APP_ERROR_CHECK(err_code); // fill manufacturer's common data page. m_ant_sdm.page_80 = ANT_COMMON_page80(HW_REVISION, MANUFACTURER_ID, MODEL_NUMBER); // fill product's common data page. m_ant_sdm.page_81 = ANT_COMMON_page81(SW_REVISION_MAJOR, SW_REVISION_MINOR, SERIAL_NUMBER); // fill capabilities. m_ant_sdm.SDM_PROFILE_capabilities.cadency_is_valid = true; m_ant_sdm.SDM_PROFILE_capabilities.speed_is_valid = true; m_ant_sdm.SDM_PROFILE_capabilities.calorie_is_valid = true; m_ant_sdm.SDM_PROFILE_capabilities.time_is_valid = true; m_ant_sdm.SDM_PROFILE_capabilities.latency_is_valid = true; m_ant_sdm.SDM_PROFILE_capabilities.distance_is_valid = true; // fill status. m_ant_sdm.SDM_PROFILE_status.state = ANT_SDM_USE_STATE_ACTIVE; m_ant_sdm.SDM_PROFILE_status.health = ANT_SDM_HEALTH_OK; m_ant_sdm.SDM_PROFILE_status.battery = ANT_SDM_BATTERY_STATUS_GOOD; m_ant_sdm.SDM_PROFILE_status.location = ANT_SDM_LOCATION_ANKLE; err_code = ant_sdm_sens_open(&m_ant_sdm); APP_ERROR_CHECK(err_code); err_code = ant_state_indicator_channel_opened(); APP_ERROR_CHECK(err_code); /** @snippet [ANT SDM TX Profile Setup] */ }
/** * @brief Function for HRM profile initialization. * * @details Initializes the HRM profile and open ANT channel. */ static void profile_setup(void) { /** @snippet [ANT HRM TX Profile Setup] */ uint32_t err_code; err_code = ant_hrm_sens_init(&m_ant_hrm, HRM_SENS_CHANNEL_CONFIG(m_ant_hrm), HRM_SENS_PROFILE_CONFIG(m_ant_hrm)); APP_ERROR_CHECK(err_code); m_ant_hrm.HRM_PROFILE_manuf_id = HRM_MFG_ID; m_ant_hrm.HRM_PROFILE_serial_num = HRM_SERIAL_NUMBER; m_ant_hrm.HRM_PROFILE_hw_version = HRM_HW_VERSION; m_ant_hrm.HRM_PROFILE_sw_version = HRM_SW_VERSION; m_ant_hrm.HRM_PROFILE_model_num = HRM_MODEL_NUMBER; err_code = ant_hrm_sens_open(&m_ant_hrm); APP_ERROR_CHECK(err_code); err_code = ant_state_indicator_channel_opened(); APP_ERROR_CHECK(err_code); /** @snippet [ANT HRM TX Profile Setup] */ }
/** * @brief Function for BSC profile initialization. * * @details Initializes the BSC profile and open ANT channel. */ static void profile_setup(void) { /** @snippet [ANT BSC TX Profile Setup] */ uint32_t err_code; err_code = ant_bsc_sens_init(&m_ant_bsc, BSC_SENS_CHANNEL_CONFIG(m_ant_bsc), BSC_SENS_PROFILE_CONFIG(m_ant_bsc)); APP_ERROR_CHECK(err_code); m_ant_bsc.BSC_PROFILE_manuf_id = BSC_MF_ID; m_ant_bsc.BSC_PROFILE_serial_num = BSC_SERIAL_NUMBER; m_ant_bsc.BSC_PROFILE_hw_version = BSC_HW_VERSION; m_ant_bsc.BSC_PROFILE_sw_version = BSC_SW_VERSION; m_ant_bsc.BSC_PROFILE_model_num = BSC_MODEL_NUMBER; err_code = ant_bsc_sens_open(&m_ant_bsc); APP_ERROR_CHECK(err_code); err_code = ant_state_indicator_channel_opened(); APP_ERROR_CHECK(err_code); /** @snippet [ANT BSC TX Profile Setup] */ }