fwupd/libfwupdplugin/fu-backend.h
Richard Hughes dbdb207561 Increase the chances of success of WAIT_FOR_REPLUG on WIN32
Decrease the GUsb polling interval when any of the devices is in
`WAIT_FOR_REPLUG` on when running on Windows. Any device that can
re-enumerate much faster than the default 1000ms may be missed and the
detach may fail.

Linux doesn't have this problem as it has `LIBUSB_CAP_HAS_HOTPLUG`.
2022-01-06 13:20:34 -06:00

49 lines
1.4 KiB
C

/*
* Copyright (C) 2021 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include "fu-context.h"
#include "fu-device.h"
#define FU_TYPE_BACKEND (fu_backend_get_type())
G_DECLARE_DERIVABLE_TYPE(FuBackend, fu_backend, FU, BACKEND, GObject)
struct _FuBackendClass {
GObjectClass parent_class;
/* signals */
gboolean (*setup)(FuBackend *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
gboolean (*coldplug)(FuBackend *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
void (*registered)(FuBackend *self, FuDevice *device);
/*< private >*/
gpointer padding[28];
};
const gchar *
fu_backend_get_name(FuBackend *self);
FuContext *
fu_backend_get_context(FuBackend *self);
gboolean
fu_backend_get_enabled(FuBackend *self);
void
fu_backend_set_enabled(FuBackend *self, gboolean enabled);
GPtrArray *
fu_backend_get_devices(FuBackend *self);
FuDevice *
fu_backend_lookup_by_id(FuBackend *self, const gchar *device_id);
gboolean
fu_backend_setup(FuBackend *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
gboolean
fu_backend_coldplug(FuBackend *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fu_backend_device_added(FuBackend *self, FuDevice *device);
void
fu_backend_device_removed(FuBackend *self, FuDevice *device);
void
fu_backend_device_changed(FuBackend *self, FuDevice *device);
void
fu_backend_registered(FuBackend *self, FuDevice *device);