This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

whitelist on central

Dear all developers:
     I want to use whitelist on central mode,and using SDK12.3.0. I have see some call be used like this:
pm_whitelist_set(whitelist_load()) 
pm_device_identities_list_setwhitelist_load()) 
pm_whitelist_get
sd_ble_gap_scan_start(&m_scan_param)
I feel some confuse about it.I want add a ble mac addr to whitelist,and delete a mac addr in whitelist.
what should I do. Can show some example about how to use it? 
Thx all of viewer !
Parents
  • 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.

     

Reply
  • 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.

     

Children
No Data
Related