We have a KBA which explained how to configure BLE peripheral to perform directed advertisement here:
Please kindly review and let us know if you need further help.
Hi nadab_91, how do I do direct advertisement for Central devices that have random public addresses at every turn on of its Bluetooth? Will assigning the "Identity" address of these devices in the cyBle_discoveryModeInfo.advParam->directAddr do the trick?
1. Applying KBA218959, I did direct advertising by assigning bdAddr obtained from CyBle_GapGetPeerBdAddr to cyBle_discoveryModeInfo.advParam->directAddr. It worked for an Android device that uses Resolvable Private Addresses (RPA) but did NOT for an iOS device (iPad) that also uses RPA w/ changing of Addr every ~15mins. What this means is that direct advertising is not the way to go when dealing with devices employing RPA (ie. iPad) that changes every power cycle and time interval.
2. I also did try using the Identity Address of the peer device obtained using CyBle_GapGetPeerDevSecurityKeyInfo() as the directAddr for the direct advertisement. Unfortunately, both devices (Android & iPad) were not able to connect to the BLE. What this means is that devices compare the current RPA it uses, not its Identity Addr, with the address in the direct advertisment; then decides if it is the target device for connection.
Hmmm, that is a bummer. Not sure, but I would think you would be able to just update the address you are using upon failure?
I think the thought with the RPA implementation was to have a similar approach to Private/Public key pairs used in SSL, but I haven't looked too carefully at what the implementation employs.