I want to stop advertising and be in a non-connectable state, if someone connected sends the wrong data through a characteristic three times in a row. I will start a timer, and after x amount of seconds, start advertising again for people to connect.
I've tried calling sd_ble_gap_disconnect() and sd_ble_gap_adv_stop(), but the device goes straight into advertising again. How can I stop this?
// Stop advertising
sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
m_conn_handle = BLE_CONN_HANDLE_INVALID;
NRF_LOG_INFO("Stopping advertising");
sd_ble_gap_adv_stop(m_advertising.adv_handle)