Hi,
We are using nrf52832 for ANT and BLE for which we use SDK_17.0.2 and s332_nrf52_7.0.1
Our objective is to pair and un-pair ANT sensors. So far pairing multiple ANT sensors and snding the data via BLE works fine. But when we do try to un-pair sensors by closing the channel, the device does restarts.
For that we did try to use sd_ant_channel_close() function. We did use it in our event and in main while loop with a dalay as well. We did try with sd_ant_channel_unassign() function after closing the channel as well.
Is there some sequence that we are missing? Below is our channel init code. Thank you.
static void ANT_profile_HRM_setup(uint8_t ant_channel_no, uint32_t ant_device_no)
{
/** @snippet [ANT HRM RX Profile Setup] */
uint32_t err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
APP_ERROR_CHECK(err_code);
ant_channel_config_t channel_config =
{
.channel_number = ant_channel_no,
.channel_type = CHANNEL_TYPE_SLAVE,
.ext_assign = HRM_EXT_ASSIGN,
.rf_freq = HRM_ANTPLUS_RF_FREQ,
.transmission_type = CHAN_ID_TRANS_TYPE,
.device_type = HRM_DEVICE_TYPE,
.device_number = ant_device_no,
.channel_period = HRM_MSG_PERIOD_1Hz,
.network_number = ANTPLUS_NETWORK_NUM,
};
const ant_search_config_t ant_search_config =
{
.channel_number = ant_channel_no,
.low_priority_timeout = ANT_LOW_PRIORITY_TIMEOUT_DISABLE,
.high_priority_timeout = ANT_HIGH_PRIORITY_SEARCH_DISABLE,
.search_sharing_cycles = ANT_SEARCH_SHARING_CYCLES_DISABLE,
.search_priority = ANT_SEARCH_PRIORITY_DEFAULT,
.waveform = ANT_WAVEFORM_DEFAULT,
};
err_code = ant_hrm_disp_init(&m_ant_hrm, &channel_config, ant_tmp_evt_handler);
APP_ERROR_CHECK(err_code);
// Set search timeout
err_code = ant_search_init(&ant_search_config);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_open(ant_channel_no);
APP_ERROR_CHECK(err_code);
err_code = ant_state_indicator_channel_opened();
APP_ERROR_CHECK(err_code);
/** @snippet [ANT HRM RX Profile Setup] */
}
Best regards, Ram

