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

Delete bonding/Whitelist clear

Hi All,

i need some helps. I need a device that can connect with one phone only, so i have created a whitelist wih size of 1.

During the life of device the device can be delete the bonding information. i use the function pm_peers_delete to do it. But seems that the whitelist is not clear. Becasue when i delete the bonding information on both side ( phone and device) and try connect again the im_ble_evt_handler consider the peer match with wgitelist, i mean:

void im_ble_evt_handler(ble_evt_t * ble_evt)
{
    ret_code_t err_code;
    switch (ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
        {
            pm_peer_id_t bonded_matching_peer_id = PM_PEER_ID_INVALID;

            if (ble_evt->evt.gap_evt.params.connected.irk_match == 1)
            {
                // The peer was matched using a whitelist.
                bonded_matching_peer_id
                  = m_im.irk_whitelist_peer_ids[ble_evt->evt.gap_evt.params.connected.irk_match_idx];
            }

The if statement is true and cause an assert after.

I'm using an SDK11 and is not clear how resolve the problem. My idea is delete also the whitelist, when delete the peers to avoid that the statment became true. Is it correct?

How can i delete the whitelist with SDK 11?

Regards, -Anna

Related