if(deallocate_flag) { uint32_t periph_link_cnt=0; deallocate_flag = 0; periph_link_cnt = ble_conn_state_peripheral_conn_count(); #ifdef DEBUG printf("total links :%d\n",periph_link_cnt); #endif if(periph_link_cnt) { for( ;periph_link_cnt>0;periph_link_cnt--) { err_code = sd_ble_gap_disconnect(periph_link_cnt-1,BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); #ifdef DEBUG printf("error value is %x\n",err_code); #endif APP_ERROR_CHECK(err_code); #ifdef DEBUG printf("count value is %d\n%d\n",periph_link_cnt,err_code); #endif } // periph_link_cnt = ble_conn_state_peripheral_conn_count(); if(!periph_link_cnt) { buzzer_for_pair= 1; Buzzer_on_period_for_pairing(&buzzer_for_pair); #ifdef DEBUG printf("deallocation success\n"); #endif } } } ERROR 12290 [Unknown error code] at (null):0 PC at: 0x00000000
Hello,
Please check this code for BLE disconnection.When peripheral tries to disconnect from the central , it is disconnect successfully the first time but second time it gives an unknown error and the whole controller resets.Please do reply to this.
Thanks & Regards,
Suman