This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52 dk issues with bonding PM_EVT_CONN_SEC_FAILED is called every time

Hi

i am trying to connect ble_app_proximity with ios (10.0.2), but every time it is generating PM_EVT_CONN_SEC_FAILED for pm_evt_handler with sdk 12.2.0

i need to implement whitelist functionality once device is connected.

Thanks

  • @Capricorn: Have you made sure all previously bonded information was deleted on both the phone and the nRF52 device ? Try to press "Forget this device" in Bluetooth setting on the phone and do a full erase on the NRF52 chip when testing.

    Please test with the original proximity example and let us know if the issue remains.

    To know how to use whitelist, please have a look at ble_app_keyboard or ble_app_mouse application.

  • @Hung Bui its working ok after erasing settings on both sides, but do we need to erase everytime we want to connect and bonding the devices.

  • It's up to the application if you want to allow re-bonding or not. If you have a look at pm_evt_handler() in main.c in our examples you can find this:

        case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = false};
            pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
        } break;
    

    Set it to true will allow rebonding.

    But be aware that this may open a security hole that attacker can pretend to be your master and bond with your device as if your master has deleted the bond info and trying to rebond. He then can replace the old bond with the new one. And next time when your master want to connect, it will have to do a new bond and give a chance for attacker to sniff the bond information.

Related