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

BLE_GAP_EVT_SEC_INFO_REQUEST what if keys mismatch?

Hello all,

Lets assume that central bonded with nRF51822 peripheral and than disconnected. If bond is saved on peripheral- ok, cental send BLE_GAP_EVT_SEC_INFO_REQUEST and will receive sd_ble_gap_sec_info_reply with stored LTK from peripheral. But if peripheral didn't saved bonding context after disconnection the central will request BLE_GAP_EVT_SEC_INFO_REQUESTeach time on reconnection and peripheral will respond sd_ble_gap_sec_info_reply with NULLs. Connection will be broken with reason BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED or BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE (as I experienced).

The question is: Whether it possible to notify central in some way that bond is lost on peripheral and not to sent BLE_GAP_EVT_SEC_INFO_REQUEST but BLE_GAP_EVT_SEC_PARAMS_REQUEST or BLE_GAP_EVT_CONN_SEC_UPDATE to reestablish new keys?