Is it possible to add a static bluetooth address to the whitelist?
I am using SDK 14.2.0, device is nrf52832 + peer manager.
Whitelist can be used both by peripheral (to filter which centrals can connect) and by central (to filter what peripherals to connect to.) I assume that you need this for a peripheral.
If you use the Advertising Module then it is your responsibility to provide a whitelist on the BLE_ADV_EVT_WHITELIST_REQUEST event.
You may then choose to fetch a whitelist from peer manager using pm_whitelist_get(), as is done for instance in the HID Mouse Application example.
Or, in your case, you may make a whitelist manually using any bluetooth addresses that you would like. The whitelist is an array of ble_gap_addr_t structures and an array of ble_gap_irk_t structures. (The IRK structure is only needed for resolvable addresses, not for static ones.)
In any case you must reply to the whitelist request event with a call to ble_advertising_whitelist_reply(), where you provide the whitelist.
I can't get it to work with SDK 14 and softdevice 5. It seems that whitelist depends on peer manager and the creation of a peer ID. But I cant get a static address set and whitelisted.
I am very sorry for not getting back to you previously. I was out-of-office for some time lately.
Sadly it looks like Peer Manager is not designed to work together with a custom whitelist. From Peer Manager documentation: "Note that if you include the Peer Manager in an application and want to use whitelisting, the whitelist must be created by the Peer Manager." I will do some investigation into what is possible, and see if the whitelist functionality within Peer Manager can be altered or disabled, or if there is some way to get Peer Manager to accept a non-peer address for the whitelist. I should have a clear answer within a couple of days, and hopefully a working example.
Ok thanks. I will be waiting.
How is the progress?
It have been a month now...
Hi I am also trying to the same but I dont get it run with static address. It would be nice to have a solution for that.