/* Function for processing the BLE_GAP_EVT_DISCONNECT event from the SoftDevice.  */
static void disconnect_process(ble_gap_evt_t *p_gap_evt)
/* Function for processing the BLE_GAP_EVT_DISCONNECT event from the SoftDevice.  */
static void disconnect_process(ble_gap_evt_t *p_gap_evt)
{
    pm_sec_error_code_t error = (p_gap_evt->params.disconnected.reason
                                        == BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE)
                                ? PM_CONN_SEC_ERROR_MIC_FAILURE : PM_CONN_SEC_ERROR_DISCONNECT;
    link_secure_failure(p_gap_evt->conn_handle, error, BLE_GAP_SEC_STATUS_SOURCE_LOCAL);
}