Hello,
sd_ble_gap_adv_stop()
returns NRF_ERROR_INVALID_STATE
sd_ble_gap_disconnect(m_connx_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
Disconnects the device, but it reconnects in the following seconds.
Any idea?
Hello,
sd_ble_gap_adv_stop()
returns NRF_ERROR_INVALID_STATE
sd_ble_gap_disconnect(m_connx_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
Disconnects the device, but it reconnects in the following seconds.
Any idea?
If sd_ble_gap_adv_stop() returns NRF_ERROR_INVALID_STATE then you are not advertising when you call it.
and if the device reconnects after disconnecting it it's because the device is set to reconnect after it's been disconnected, what's the device?
No - we know the peripheral device is nRF52, what's the central which is connecting to it? The central initiates the connection when it sees an advertising peripheral it wants to connect to. If the central is another nRF52 then change the code on that not to attempt reconnection on disconnection. If the central isn't another nRF52, what is it? If you want nobody to connect to you after you (as peripheral) force-disconnect them, don't re-start advertising. if you only want a specific list of devices to connect to you, use a whitelist.
No - we know the peripheral device is nRF52, what's the central which is connecting to it? The central initiates the connection when it sees an advertising peripheral it wants to connect to. If the central is another nRF52 then change the code on that not to attempt reconnection on disconnection. If the central isn't another nRF52, what is it? If you want nobody to connect to you after you (as peripheral) force-disconnect them, don't re-start advertising. if you only want a specific list of devices to connect to you, use a whitelist.