This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error while setting BLE OFF

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?

Parents Reply
  • if you are connected then you aren't advertising, even after you disconnect you're not advertising unless you restart advertising. So that's why stopping advertising gives you an error, because you aren't advertising.

    if you are using the advertising module either configure it not to restart advertising after disconnection or change the code if there is no such option or stop using it.

Children
No Data
Related