Hello king001,
Are you using SoftDevice S130 or S132 (API2 or API3)?
For API 2, the whitelist is simply supplied with the scan parameters in sd_ble_gap_scan_start(). You can load the peers saved by peer manager using pm_whitelist_get() and it should be safe create you own list or modify the list from pm_whitelist_get. The whitelist is recreated when sd_ble_gap_scan_start() is called.
For API 3, you need to call sd_ble_gap_whitelist_set(). This is done inside pm_whitelist_set(), but if you want to populate the list with other members (that don't have a peer ID) it should be safe to call sd_ble_gap_whitelist_set() directly instead.
Hello king001,
Are you using SoftDevice S130 or S132 (API2 or API3)?
For API 2, the whitelist is simply supplied with the scan parameters in sd_ble_gap_scan_start(). You can load the peers saved by peer manager using pm_whitelist_get() and it should be safe create you own list or modify the list from pm_whitelist_get. The whitelist is recreated when sd_ble_gap_scan_start() is called.
For API 3, you need to call sd_ble_gap_whitelist_set(). This is done inside pm_whitelist_set(), but if you want to populate the list with other members (that don't have a peer ID) it should be safe to call sd_ble_gap_whitelist_set() directly instead.