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?
You guess? Don't guess, use the debugger to find out, and I'm fairly sure it's not a hardfault, unless you're calling it from an interrupt handler of high priority which is unlikely.
And what does this have to do with your first statement that it returns INVALID STATE? First you say you get a return of invalid state, then you tell me the chip resets, which is it?
Either way, if you get invalid state, you're not advertising. If you're in connection, you're not advertising, if you are no-longer in connection because it's closed, you are still not advertising unless you have restarted advertising.
You guess? Don't guess, use the debugger to find out, and I'm fairly sure it's not a hardfault, unless you're calling it from an interrupt handler of high priority which is unlikely.
And what does this have to do with your first statement that it returns INVALID STATE? First you say you get a return of invalid state, then you tell me the chip resets, which is it?
Either way, if you get invalid state, you're not advertising. If you're in connection, you're not advertising, if you are no-longer in connection because it's closed, you are still not advertising unless you have restarted advertising.