Hello ,
I'm working on custom board, I'm trying to disconnect from the Central (Andriod app) when the battery is below certain level and stop re-advertising. Below is the piece of code i used:
/* Disconnect and then disable advertising */
if (m_conn_handle != BLE_CONN_HANDLE_INVALID) { sd_ble_gap_disconnect(m_conn_handle,BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); }
uint32_t err_code = sd_ble_gap_adv_stop();
APP_ERROR_CHECK(err_code);
I'm trying to disconnect and disable advertising but it doesn't work in some cases, I don't really know why.
I use SDK v11 with S132 v2.0.0 (nRF52)