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

Parents
  • Hi Petter,

    yes the problem is that if statement is true, when i delete the bonding information with the function pm_peers_delete.

    So i'm asking why this happens? And , so is it sufficient using only the pm_peers_delete to delete the bonding information? Because seems that using only this function the whitelist didn't became empty, and the if condition is true.

Reply
  • Hi Petter,

    yes the problem is that if statement is true, when i delete the bonding information with the function pm_peers_delete.

    So i'm asking why this happens? And , so is it sufficient using only the pm_peers_delete to delete the bonding information? Because seems that using only this function the whitelist didn't became empty, and the if condition is true.

Children
No Data
Related