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

Forget Device on IOS side handling

Hello,

I am working with nRF52840 and started with SDK15 examples with BLE security mode 1 level 2, No MITM.  I have a question regarding bond handling and the deletion of bond data on the central side which for us is an IOS app.  When the user "Forgets Device" in settings of IOS, the peripheral cannot recognize this and during the next attempt to connect will try to use previous bond keys while the app tries to pair and re bond.  I am attempting to handle this in PM_EVT_CONN_SEC_FAILED with a pm_peer_id_get and then pm_peer_delete.  I want the devices to rebond in one connection so the user does not have to try again.  Is this the right way to handle this / safe place to delete a bond, etc?

        case PM_EVT_CONN_SEC_FAILED:
            m_conn_handle = BLE_CONN_HANDLE_INVALID;

            // Check if failure was because peer was already bonded
            if(pm_peer_id_get(p_evt->conn_handle, p_evt->peer_id) == NRF_SUCCESS)
            {
                NRF_LOG_INFO("PEER ALREADY BONDED...DELETING BOND FOR REBOND");
                err_code = pm_peer_delete(current_bonded_peer);
                APP_ERROR_CHECK(err_code);
            }
            break;

Thanks in advanced,
Bloq

Parents
  • I have located the PM_EVT_BONDED_PEER_CONNECTED event from the peer manager.  The only problem with this is that the event occurs whether or not the central is looking to pair or bond.  Is there something that I can check for in the pm_evt that signifies the central is looking to pair instead of re encrypt the link with the bond data so I can delete the current keys and rebond?

    Thanks,
    Bloq

Reply
  • I have located the PM_EVT_BONDED_PEER_CONNECTED event from the peer manager.  The only problem with this is that the event occurs whether or not the central is looking to pair or bond.  Is there something that I can check for in the pm_evt that signifies the central is looking to pair instead of re encrypt the link with the bond data so I can delete the current keys and rebond?

    Thanks,
    Bloq

Children
No Data
Related