I have a peripheral device based on the nRF51822, s130 and SDK 11.0.0. It's designed to only ever have one central device to which it's bonded. Out of the box, without a bond yet, it does undirected advertising until it gets its first connection and bonds. After that, it only ever does directed advertising.
How do I respond to the BLE_ADV_EVT_PEER_ADDR_REQUEST
advertising event in this case?
I want to ask the Peer Manager for the address of the bonded central, then pass that to ble_advertising_peer_addr_reply()
. But the call to pm_peer_data_bonding_load()
takes a peer ID, which I don't have. After the first connection and bonding, I'll have gone into sys off or reset before the subsequent connections.