Hello!
I'm trying to get my whitelist work, but I think I'm missing something. Let me present you my problem:
- Power up both central and peripheral1
- Central enters in non-selective scan
- Central connects to peripheral1 but whitelist is not created (I get device_instance_find err_code 5)
- Peripheral1 sends bond request using dm_security_setup_req().
- Central bonds with peripheral and stores the context (peripheral1 addr and device type, among other)
- Peripheral1 auto sleeps
- Peripheral1 is powered up
- Central connects (selective scan now) with peripheral1 via whitelist and returns err 0 in device_instance_find. Connection is established via bonded device.
- Peripheral1 auto sleeps
- I power down the central. Whitelist is lost and I have to repeat all the steps to whitelist work again.
A) I see this behaviour after adding dm_security_setup_req in the peripheral code: The peripheral does not promptly register the device in the whitelist, as other examples do (HRS and HRS_C). Actually, it needs 2 connections (as explained above) to get the addr added to the whitelist.
B) I adjusted central's settings to bond to only 1 peripheral at time.
Do you guys know what I'm missing?
Thanks