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

Whitelist modification

Hi,

I am developing nRF52832 peripheral, SDK15.

Let me know about whitelisting.

I'd like to below functions.

1. Delete item(device) in white list.

2. Changeing order of priority in whitelist.

3. Adding item(device) at whitelist.

4. changing bonding when I select device from central.

Regards,

Scott

Parents
  • Hi Scott, 

    Could you let me know if you are using peer manager ? or you access the radio/softdevice directly ? 

    From here I assume you are using peer manager

    1. The whitelist can be set and clear using sd_ble_gap_device_identities_set() this is called by pm_device_identities_list_set() 

    2. There is no order or priority in whitelist. What kind of priority you are thinking of  ?  

    3. Yes, same as 1. 

    4. "Changing bonding when I select device from central." what does this mean ? 

    To have an overview of how whitelist is used, please have a look at ble_app_hids_keyboards example.

  • thank you for your reply.

    I am using peer manager.

    1. If I use "sd_ble_gap_device_identities_set(NULL, NULL, 0); ", that was not happened. 

      and I also want to delete each item. is it possible?

    2. I had known BLE device has some rule for connecting sequence. 

    3. Can you explain using example code? I refer below code. I don't know how to set m_whitelist_peers, 

    memset(m_whitelist_peers, PM_PEER_ID_INVALID, sizeof(m_whitelist_peers));
    m_whitelist_peer_cnt = (sizeof(m_whitelist_peers) / sizeof(pm_peer_id_t));

    peer_list_get(m_whitelist_peers, &m_whitelist_peer_cnt);
    ret = pm_whitelist_set(m_whitelist_peers, m_whitelist_peer_cnt);
    APP_ERROR_CHECK(ret);

    // Setup the device identies list.
    // Some SoftDevices do not support this feature.
    ret = pm_device_identities_list_set(m_whitelist_peers, m_whitelist_peer_cnt);

    4. I will refer that example.

    thank you

Reply
  • thank you for your reply.

    I am using peer manager.

    1. If I use "sd_ble_gap_device_identities_set(NULL, NULL, 0); ", that was not happened. 

      and I also want to delete each item. is it possible?

    2. I had known BLE device has some rule for connecting sequence. 

    3. Can you explain using example code? I refer below code. I don't know how to set m_whitelist_peers, 

    memset(m_whitelist_peers, PM_PEER_ID_INVALID, sizeof(m_whitelist_peers));
    m_whitelist_peer_cnt = (sizeof(m_whitelist_peers) / sizeof(pm_peer_id_t));

    peer_list_get(m_whitelist_peers, &m_whitelist_peer_cnt);
    ret = pm_whitelist_set(m_whitelist_peers, m_whitelist_peer_cnt);
    APP_ERROR_CHECK(ret);

    // Setup the device identies list.
    // Some SoftDevices do not support this feature.
    ret = pm_device_identities_list_set(m_whitelist_peers, m_whitelist_peer_cnt);

    4. I will refer that example.

    thank you

Children
  • Hi Scott, 

    To delete one item, you would need to get the list, either from peer manager (peer_list_get ) or from the softdevice APIs(if you don't want to use peer manager to do so). Then you delete the item in the list, then call the _set commands to set the whitelist and identity list again. 

    There are two command to set the whitelist, sd_ble_gap_device_identities_set() and sd_ble_gap_whitelist_set()

    whitelist_set is to be used with public static address. identities_set is to be used for private address (random resolvable addresses, the address with IRK) 

    I would suggest to have a look at the s132_nrf52 v6.0.0 migration document included with the softdevice .zip package. You can find some example code when we introduce the new identities API started from S132 v3.0.0. (page 22)

Related