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

Bond does not work after the bond info delete on NRF connect.

Hello. my name is Alan. I'm a newbie about BLE bonding.

because our new project needs a bonding feature,
I referred to the Heartrate example(ble_app_hrs) to apply bonding to the BLE UART example(ble_app_uart).

But when I flashed the ble_app_hrs example on pca10028, I found a fault.


Fault :
After a bonding using NRF Connect(Android), I deleted the bond info;
when I ask bond again, the bonding does not work.


This symptom is not resolved when the device is rebooted. It's only resolved when the firmware is flashed again.

I'm using s130 2.0.1 with nrf51822.

Parents
  • Check the handling of PM_EVT_CONN_SEC_CONFIG_REQ in the pm_evt_handler() function (and the comment). FYI:I refer to the btle hrs peripherial example in SDK12.3 version.

    Nordic example code explicitly forbids re-bonding here, your application might have other security needs.

    Note that this case would look exactly like a man-in-the-middle attack, hence the reject in the example code.

  • This is my codes in PM_EVT_CONN_SEC_CONFIG_REQ.

    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;

    If I want to allow the device to re-bond, how do I modify these codes?

Reply Children
Related