Hi, I am using following code inside for(;;) in main function
if(diff == 30)
advertising_stop();
else if(diff == 60)
advertising_start();
Following are the advertising_start and advertising_stop function
static void advertising_start(void) {
uint32_t err_code;
err_code = sd_ble_gap_adv_start(&m_adv_params);
APP_ERROR_CHECK(err_code);
err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
APP_ERROR_CHECK(err_code);
}
static void advertising_stop(void) {
uint32_t err_code;
err_code = sd_ble_gap_adv_stop();
APP_ERROR_CHECK(err_code);
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
APP_ERROR_CHECK(err_code);
}
advertising_stop(); works properly when diff(time difference) reaches 30. but when diff reaches 60 and advertising_start() is called then device gets reset. What may be the reason behind this?
I am new to development framework, please guide me on this issue.