I have a problem using ble_advertising_restart_without_whitelist(). According to the documentation (as I understood) it should start advertising without whitelist even if a whitelist exists (hence it skips BLE_ADV_EVT_WHITELIST_REQUEST). In the next call of ble_advertising_start() advertising should use the whitelist again. But in my application it's not the case, BLE_ADV_EVT_WHITELIST_REQUEST is skipped when calling ble_advertising_start() if ble_advertising_restart_without_whitelist() has been called once before.
So the sequence is:
- load previously bonded peers from flash and add them to the whitelist of the peer manager
- ble_advertising_start(BLE_ADV_MODE_SLOW) starts BLE_ADV_EVT_SLOW_WHITELIST
- ble_advertising_restart_without_whitelist() starts BLE_ADV_EVT_SLOW
- a bonded peer is connected and then disconnected
- ble_advertising_start(BLE_ADV_MODE_SLOW) is called and triggers BLE_ADV_EVT_SLOW instead of BLE_ADV_EVT_SLOW_WHITELIST
Do I misunderstand the documentation or am I missing something?
My goal is to have an application that is always whitelist advertising (no timeout) for bonded peers and starts "public" advertising only on request (with a certain timeout). How can I switch easily between public and whitelist advertising? Deleting the whitelist on "public" advertising request always returns errors (BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE & BLE_ERROR_GAP_WHITELIST_IN_USE). And what is this device identities list anyway?