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

iOS7 LL_TERMINATE_IND is delayed if disconnection within a few seconds, then ...

Hi

I see this in our own firmware and also in the sample HRS on the PCA10001

(If you try with the HRS app, then modify the app so that on BLE_GAP_EVT_DISCONNECTED instead of calling system_off_mode_enter() you call advertising_start().

Put a breakpoint on first statement in "case BLE_GAP_EVT_DISCONNECTED:"

Using an app like say BLExpr, make a connection and then immediately (less than 2 seconds) disconnect -- on the phone you will immediately see a confirmation dialog that the connection is dropped. You will see that the breakpoint is not hit for about 5 seconds later.

I have a Frontline BT BPA600 sniffer and it confirms that the LL_TERMINATE_IND is indeed sent about 5 seconds after the connection and yet the disconnect was initiated within a second.

*** Now restart on debugger, for even more weird behavior. Make a connection. Disconnect. Then immediately re-connect. And you get a connection and the Nordic side behaves as if there was never a disconnect request at the iPhone.

The only explanation, is that the iphone app is requesting a disconnection and their BLE stack eventually does it, but when the request came through the app is told immediately that there is no connection. And when the reconnect comes through, it knows the connection is still around so just acks positively.

I have tried the same experiment with the TI USB Dongle as the master and I don't see this behaviour and I bet if I tried with the Nordic USB adapter I will not see the delay either.

It is Sunday and I don't have access to an Android phone to try it. If anyone sees that on an Android in the meantime I will be most interested to hear about it.

Thank you in advance.

Related