Hi,
I'm working on a legacy program (Peripheral) using nRF52833 and nRF5 SDK using SoftDevice S113.
I'm using the Peer Manager module to manage bonded hosts/data. It seems the Peripheral is failing to bond (the second time, via JustWorks pairing) with an already bonded Central, even though I'm adding the following call in response to Peer Manager event PM_EVT_CONN_SEC_CONFIG_REQ:
case PM_EVT_CONN_SEC_CONFIG_REQ:
{
NRF_LOG_INFO("PM_EVT_CONN_SEC_CONFIG_REQ");
pm_conn_sec_config_t conn_sec_config = { .allow_repairing = true };
pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
}
break;
Here is the list of BLE/PM events my application is getting, that result in Bonding failing:
<info> app: pm_evt_handler Event: 0x1 <info> app: pm_evt_handler Event: 0x6 <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change <info> app: pm_evt_handler Event: 0x9 <info> app: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED <info> app: pm_evt_handler Event: 0x0 <info> app: PM_EVT_BONDED_PEER_CONNECTED <info> app: pm_evt_handler Event: 0xF <info> app: ble_evt_handler Event: 0x10 <info> app: Connected <info> app: pm_evt_handler Event: 0x2 <info> app: pm_evt_handler Event: 0x6 <info> app: pm_evt_handler Event: 0x5 <info> app: PM_EVT_CONN_SEC_CONFIG_REQ <info> app: ble_evt_handler Event: 0x13 <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST <info> app: ble_evt_handler Event: 0x3A <info> app: ble_evt_handler Event: 0x19 <info> app: BLE_GAP_EVT_AUTH_STATUS <info> app: Authorization failed with code: 133!
I was expecting that passing
allow_repairingbool to true would allow the new bonding attempt to succeed and update the Peer Data information in FDS, but it doesn't seem to be the case.
Can you advise on what should I do differently to allow re-bonding to a Central? Should I handle event BLE_GAP_EVT_SEC_PARAMS_REQUEST? If so, what API and parameters should I call?
Thanks,
Marco

