Hello,
I use nrf51422 to connect the ANT device(Heart rate monitor) and it can work .
My question is , I want to assign a new device_number to 51422 and use this new device_number to search second ANT+ device ,but I found the 51422 will be reset.
I don't want 51422 to reset ,how could I do?
I use below function to assign a new device_number
void change_device_number(uint16_t device_number) {
uint32_t err_code;
err_code = sd_ant_channel_close(ANT_HRMRX_ANT_CHANNEL);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_network_address_set(ANTPLUS_NETWORK_NUMBER, m_ant_network_key);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_assign(ANT_HRMRX_ANT_CHANNEL,
ANT_HRMRX_CHANNEL_TYPE,
ANTPLUS_NETWORK_NUMBER,
ANT_HRMRX_EXT_ASSIGN);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_id_set(ANT_HRMRX_ANT_CHANNEL,
device_number,
ANT_HRMRX_DEVICE_TYPE,
ANT_HRMRX_TRANS_TYPE);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_radio_freq_set(ANT_HRMRX_ANT_CHANNEL, ANTPLUS_RF_FREQ);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_period_set(ANT_HRMRX_ANT_CHANNEL, ANT_HRMRX_MSG_PERIOD);
APP_ERROR_CHECK(err_code);
err_code = sd_ant_channel_open(ANT_HRMRX_ANT_CHANNEL);
APP_ERROR_CHECK(err_code);
}