Processing when pairing information remains on only one peer

If an nRF52832 device and a smartphone are paired and only one of the peers deletes the pairing (bonding) information, an error may occur when reconnecting due to a mismatch in pairing information.

I would like to implement a process that allows the device to spontaneously re-pair in this case. (The user simply performs the same operations on the smartphone as they did for the initial connection.)

I would like to handle two cases: when only the device's pairing information is deleted, and when only the smartphone's pairing information is deleted.

Is such an implementation possible in the device software?

ic: nRF52832

SDK: nRF5 SDK 15.2.0

SoftDevice: s132 6.1.1

Project: ble_app_hrs

Parents
  • Hi Masanori, 

    - When the device pairing information is deleted and the bond information is still on the phone, I don't see any other option other than the phone user need to go to Bluetooth setting and delete bond info there. If you want to pair every time you connect to the device,  you should use no bond, only pairing. 

    - When the phone delete bond info and the device still have the bond info, you would need to allow re-pair in the code. Please take a look at this ticket: 
    RE: Please tell me how to achieve re-pairing.

    The reply from Joakim has the code needed. You need to add: 

            case PM_EVT_CONN_SEC_CONFIG_REQ:
                conn_sec_config.allow_repairing = true;
                pm_conn_sec_config_reply(m_conn_handle, &conn_sec_config);
                break;

Reply
  • Hi Masanori, 

    - When the device pairing information is deleted and the bond information is still on the phone, I don't see any other option other than the phone user need to go to Bluetooth setting and delete bond info there. If you want to pair every time you connect to the device,  you should use no bond, only pairing. 

    - When the phone delete bond info and the device still have the bond info, you would need to allow re-pair in the code. Please take a look at this ticket: 
    RE: Please tell me how to achieve re-pairing.

    The reply from Joakim has the code needed. You need to add: 

            case PM_EVT_CONN_SEC_CONFIG_REQ:
                conn_sec_config.allow_repairing = true;
                pm_conn_sec_config_reply(m_conn_handle, &conn_sec_config);
                break;

Children
No Data
Related