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

Why won't Master Control Panel Android App trigger context restore correctly?

Hi!

I'm building an application with one custom service containing a few characteristics, all of which are to be indicated upon. When using the Master Control Panel Android App, this will work fine the first time (Connect->Bond->Enable indications for each characteristic->Receive data->Disconnect) but on subsequent connects the app will say that indications are enabled for the service, but the device doesn't agree and so doesn't send any data. This will, however, work perfectly when using the computer based master control panel in conjunction with a development dongle (Connect->Discover Services->Bond->Enable Services->Disconnect).

Upon enabling logging in the device manager it seems that a series of events are triggered by the computer version of the app on reconnect, specifically BLE_GAP_EVT_SEC_INFO_REQUEST and BLE_GAP_EVT_CONN_SEC_UPDATE, but these are not triggered by the phone version. Since these events are not triggered, the DM won't apply the stored service context on reconnect.

Anyone have any idea what could be causing this?

EDIT: Here are two wireshark logs of the communication, one were it works (our custom board communicating with the development dongle) and one were it doesn't (our custom board communicating with my HTC Desire). Judging by the logs, I would say that it's the fact that the dongle sends an encryption request, which the phone doesn't, that is causing the difference in behaviour.

Computer wireshark log

Phone wireshark log

Cheers, Edward

  • Hi Edward,

    It worked fine for me. In my case nRF Master Control Panel on Android managed to rebond and system attributes were restored correctly.

    Could you capture a sniffer trace when issue occurs ? This will explain if the phone managed to rebond or not.

  • I'll do what I can - I'm still experiencing the problems with the sniffer I mentioned in this post so I'm not sure I'll be able to get anything useful, but I'll give it a shot tomorrow morning.

  • Suddenly the sniffer is working again - this time on a nrf51-DK attached through a D-Link USB hub. At any rate, I have added two wireshark logs of the behaviour to the original post.

  • Hi Edweirdo,

    From the sniffer trace I can confirm what you are suspecting. We don't have a HTC Desire here for testing.

    Could you try again with another phone (different brand) to see if the issue remains ?

    You can also try to read/write an encrypted characteristic when re-connected. This should trigger a bonding. And if it's previously bonded it should re-bond. On Nexus and Samsung Galaxy device we tested here the re-bonding happens automatically.

  • I've now tried using a Samsung Galaxy S4 GT-I9506 running Android 4.4.2, but it doesn't restore the context either. An interesting sidenote however, is that I've now enabled MITM using a static passkey for my peripheral, which works fine on the Samsung, but the HTC refuses to display the passkey query popup. The Desire is running Android 4.4.2 as well, so that shouldn't be the problem.

    If I try to read one of the encrypted characteristics, it will trigger a context restore and I'll receive the indications.

1 2