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

bonding doesn't work after deleting bond info 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
  • Hello,

    The peer manager will reject pairing requests from an already bonded peer to prevent a potential attacker to update the bonding information. The solution is to delete the existing bond on the nrf51, or configure the peer manager to allow re-pairing by setting .allow_repairing flag:

            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 = true}; <-- allow repairing
                pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
            } break;

    Also, since you plan to integrate the module with the ble_app_uart example: remember to remove handling of the BLE_GAP_EVT_SEC_PARAMS_REQUEST and the BLE_GATTS_EVT_SYS_ATTR_MISSING event in the on_ble_evt() callback as these shall be handled internally by the peer manager. 

Reply
  • Hello,

    The peer manager will reject pairing requests from an already bonded peer to prevent a potential attacker to update the bonding information. The solution is to delete the existing bond on the nrf51, or configure the peer manager to allow re-pairing by setting .allow_repairing flag:

            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 = true}; <-- allow repairing
                pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
            } break;

    Also, since you plan to integrate the module with the ble_app_uart example: remember to remove handling of the BLE_GAP_EVT_SEC_PARAMS_REQUEST and the BLE_GATTS_EVT_SYS_ATTR_MISSING event in the on_ble_evt() callback as these shall be handled internally by the peer manager. 

Children
No Data
Related