Hi Sir/Miss,
I use nRF52832-QFAB
SDK 17.0.2
SoftDevice s112
nRF connect APP
I limit max bonding as 5 PCS central device.
There are two conditions.
Central device deletes bonding, but peripheral not. When they re-connect, central device displays disconnect.
I add below code in pm_evt_handler of main.c
case 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;
It can repairing and bonding. My question is which will peripheral device storage new peers?
If yes, should I add whitelist or find same peers to avoid storing duplicated peer?
Another condition, when max limitation is reached, peripheral will delete oldest one.
But, that oldest one wants to connect again. I refer this link to do this and try to add below code in pm_evt_handler
case PM_EVT_CONN_SEC_FAILED:
{
if (p_evt->params.conn_sec_failed.procedure == PM_LINK_SECURED_PROCEDURE_ENCRYPTION &&
p_evt->params.conn_sec_failed.error == PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING)
{
}
else
{
(void)sd_ble_gap_disconnect(p_evt->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
}
} break;
I found out when they connect, nRF connect display connecting. Peripheral device doesn't force repairing or bonding. And, I see that FW always enters this code.
Please help.
Thank you.