Part Number:CC2650
I'm developing on the CC2650LP, using the sample project spp_ble_server as a base.
What I would like to implement, is to have the launchpad connect/reconnect to only the first smartphone that successfully bonds with it. It should also clear all bonds upon powering up. In the app, I have added a bond state callback function, changed the gapbond pairing mode to GAPBOND_PAIRING_MODE_INITIATE, and some code which executes after a bond is saved.
The code is simply getting the connected BD_ADDR and adding it to the whitelist, and subsequently changing the filter policy to GAP_FILTER_POLICY_WHITE. However, my android smartphone running nRF Connect/BLE Scanner(bonded to the launchpad) is unable to re-establish a connection to the launchpad after disconnecting. I have noticed that after a while, my smartphone stops receiving advertisements packets from the peripheral, which seems to suggest that the RPA has changed and the original address was not resolved.
This brings me to a couple questions:
1) I understand that you have to enable the Privacy 1.2 features to resolve a peer address into an identity address, which can then be added to the whitelist. I have looked through the code and it seems that it is all already handled in the stack. So, if I wanted to whitelist the bonded smartphone, all I have to do is to call GAPRole_GetParameter to find GAPROLE_CONN_BD_ADDR, and add that address to the whitelist? Is the peer address obtained this way the resolved peer address, or the non-resolved address?
2) After the connection is terminated, via timeout or otherwise, is it possible for a peripheral to reconnect to the bonded device when it is back within range? I have tried using low duty cycle directed advertising, and while my smartphone did receive the directed advertisement, it did not initiate pairing nor was I able to reconnect with the launchpad manually. I am not sure if this reconnection feature is simpler to implement on the central side(android) or the server side(CC2650), but ideally I would like to implement it on the launchpad.