/* Function for cleaning up after a failed encryption procedure.  */
static void encryption_failure(uint16_t conn_handle, pm_sec_error_code_t error, uint8_t error_src)
/* Function for cleaning up after a failed encryption procedure.  */
static void encryption_failure(uint16_t conn_handle, pm_sec_error_code_t error, uint8_t error_src)
{
    smd_evt_t evt =
    {
        .evt_id = SMD_EVT_LINK_ENCRYPTION_FAILED,
        .conn_handle = conn_handle,
        .params =
        {
            .link_encryption_failed =
            {
                .error     = error,
                .error_src = error_src,
            }
        }
    };
    ble_conn_state_user_flag_set(conn_handle, m_smd.flag_id_sec_proc, false);
    evt_send(&evt);
    return;
}