FwupdPlugin.Backend
Description: Reference for FwupdPlugin.Backend

### Class

# FwupdPluginBackend

#### Description [src]

    class FwupdPlugin.Backend : GObject.Object
      implements Fwupd.Codec {
      /* No available fields */
    }

An device discovery backend, for instance USB, BlueZ or UDev.

See also: `FuDevice`.

#### Hierarchy

#### Ancestors

- GObject

#### Implements

- FwupdCodec

#### Instance methods

###### fu_backend_add_string

Add backend-specific device metadata to an existing string.

since: 1.8.4

###### fu_backend_coldplug

Adds devices using the subclassed backend. If `fu_backend_setup()` has not already been called then it is run before this function automatically.

since: 1.6.1

###### fu_backend_create_device

Asks the backend to create a device (of the correct type) for a given device backend ID.

since: 2.0.0

###### fu_backend_create_device_for_donor

Asks the backend to create a device (of the correct type) for a given donor device.

since: 2.0.0

###### fu_backend_device_added

Emits a signal that indicates the device has been added.

since: 1.6.1

###### fu_backend_device_changed

Emits a signal that indicates the device has been changed.

since: 1.6.1

###### fu_backend_device_removed

Emits a signal that indicates the device has been removed.

since: 1.6.1

###### fu_backend_get_context

Gets the context for a backend.

since: 1.6.1

###### fu_backend_get_device_parent

Asks the backend to create the parent device (of the correct type) for a given device subsystem.

since: 2.0.0

###### fu_backend_get_devices

Gets all the devices added by the backend.

since: 1.6.1

###### fu_backend_get_enabled

Return the boolean value of a key if it’s been configured.

since: 1.6.1

###### fu_backend_get_name

Return the name of the backend, which is normally set by the subclass.

since: 1.6.1

###### fu_backend_invalidate

Normally when calling `fu_backend_setup()` multiple times it is only actually done once. Calling this method causes the next requests to `fu_backend_setup()` to actually probe the hardware.

since: 1.8.0

###### fu_backend_lookup_by_id

Gets a device previously added by the backend.

since: 1.6.1

###### fu_backend_registered

Calls the ->registered() vfunc for the backend. This allows the backend to perform shared backend actions on superclassed devices.

since: 1.7.4

###### fu_backend_set_enabled

Sets the backend enabled state.

since: 1.6.1

###### fu_backend_setup

Sets up the backend ready for use, which typically calls the subclassed setup function. No devices should be added or removed at this point.

since: 1.6.1

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from FwupdCodec (8)

###### fwupd_codec_add_string

Converts an object that implements `FwupdCodec` to a debug string, appending it to `str`.

###### fwupd_codec_from_json

Converts an object that implements `FwupdCodec` from a JSON object.

###### fwupd_codec_from_json_string

Converts an object that implements `FwupdCodec` from a JSON string.

###### fwupd_codec_from_variant

Converts an object that implements `FwupdCodec` from a `GVariant` value.

###### fwupd_codec_to_json

Converts an object that implements `FwupdCodec` to a JSON builder object.

###### fwupd_codec_to_json_string

Converts an object that implements `FwupdCodec` to a JSON string.

###### fwupd_codec_to_string

Converts an object that implements `FwupdCodec` to a debug string.

###### fwupd_codec_to_variant

Converts an object that implements `FwupdCodec` to a `GVariant`.

#### Properties

###### FwupdPlugin.Backend:can-invalidate

If the backend can be invalidated.

since: 1.8.0

###### FwupdPlugin.Backend:context

The `FuContent` to use.

since: 1.6.1

###### FwupdPlugin.Backend:device-gtype

The `GType` to use when creating emulated devices.

since: 2.0.0

###### FwupdPlugin.Backend:name

The backend name.

since: 1.6.1

#### Signals

###### FwupdPlugin.Backend::device-added

The ::device-added signal is emitted when a device has been added.

since: 1.6.1

###### FwupdPlugin.Backend::device-changed

The ::device-changed signal is emitted when a device has been changed.

since: 1.6.1

###### FwupdPlugin.Backend::device-removed

The ::device-removed signal is emitted when a device has been removed.

since: 1.6.1

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct FwupdPluginBackendClass {
      GObjectClass parent_class;
      gboolean (* setup) (
        FuBackend* self,
        FuBackendSetupFlags flags,
        FuProgress* progress,
        GError** error
      );
      gboolean (* coldplug) (
        FuBackend* self,
        FuProgress* progress,
        GError** error
      );
      void (* registered) (
        FuBackend* self,
        FuDevice* device
      );
      void (* invalidate) (
        FuBackend* self
      );
      void (* to_string) (
        FuBackend* self,
        guint indent,
        GString* str
      );
      FuDevice* (* get_device_parent) (
        FuBackend* self,
        FuDevice* device,
        const gchar* subsystem,
        GError** error
      );
      FuDevice* (* create_device) (
        FuBackend* self,
        const gchar* backend_id,
        GError** error
      );
      FuDevice* (* create_device_for_donor) (
        FuBackend* self,
        FuDevice* donor,
        GError** error
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`setup: gboolean (* setup) ( FuBackend* self, FuBackendSetupFlags flags, FuProgress* progress, GError** error )`

  No description available.

`coldplug: gboolean (* coldplug) ( FuBackend* self, FuProgress* progress, GError** error )`

  No description available.

`registered: void (* registered) ( FuBackend* self, FuDevice* device )`

  No description available.

`invalidate: void (* invalidate) ( FuBackend* self )`

  No description available.

`to_string: void (* to_string) ( FuBackend* self, guint indent, GString* str )`

  No description available.

`get_device_parent: FuDevice* (* get_device_parent) ( FuBackend* self, FuDevice* device, const gchar* subsystem, GError** error )`

  No description available.

`create_device: FuDevice* (* create_device) ( FuBackend* self, const gchar* backend_id, GError** error )`

  No description available.

`create_device_for_donor: FuDevice* (* create_device_for_donor) ( FuBackend* self, FuDevice* donor, GError** error )`

  No description available.

#### Virtual methods

###### FwupdPlugin.BackendClass.coldplug

Adds devices using the subclassed backend. If `fu_backend_setup()` has not already been called then it is run before this function automatically.

since: 1.6.1

###### FwupdPlugin.BackendClass.create_device

Asks the backend to create a device (of the correct type) for a given device backend ID.

since: 2.0.0

###### FwupdPlugin.BackendClass.create_device_for_donor

Asks the backend to create a device (of the correct type) for a given donor device.

since: 2.0.0

###### FwupdPlugin.BackendClass.get_device_parent

Asks the backend to create the parent device (of the correct type) for a given device subsystem.

since: 2.0.0

###### FwupdPlugin.BackendClass.invalidate

Normally when calling `fu_backend_setup()` multiple times it is only actually done once. Calling this method causes the next requests to `fu_backend_setup()` to actually probe the hardware.

since: 1.8.0

###### FwupdPlugin.BackendClass.registered

Calls the ->registered() vfunc for the backend. This allows the backend to perform shared backend actions on superclassed devices.

since: 1.7.4

###### FwupdPlugin.BackendClass.setup

Sets up the backend ready for use, which typically calls the subclassed setup function. No devices should be added or removed at this point.

since: 1.6.1

###### FwupdPlugin.BackendClass.to_string

No description available.