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

delayed disconnect with sd_ble_gap_disconnect()?

Hello,

Are there any conditions where the sd_ble_gap_disconnect() will not immediately terminate the link?

My Setup: Nrf52, SDK 13.0.0, own board, based from HRM code(exteeeensive modification).

On initial bootup, I fast advertise. Once I get a connection to the central, I utilize the CTS to get time, pull a few packets of data onto the peripheral, shut down the connection and stop advertising.

a few minutes later via external interrupt, I start advertising( do I need to reinitialize the advertising code again??) connect to the central and pull in time to the peripheral using the CTS. This time, when I call the sd_ble_gap_disconnect, the m_conn_handle keeps it value of 0x0 instead of doing the expected disconnect value of 0xFFFF. I monitor m_conn_handle with a WHILE loop, so when it doesn't change to the expected 0xFFFF, I camp there and softdevice faults me to a halt.

So, the first time around, it works like a charm. The second time through, it doesn't look like it releases the link. What would cause the sd_ble_gap_disconnect() function to hold onto the link?

Thanks for looking!

Related