Top | ![]() |
![]() |
![]() |
![]() |
#define | FU_TYPE_DEVICE |
struct | FuDeviceClass |
enum | FuDeviceInstanceFlags |
#define | FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE |
#define | FU_DEVICE_REMOVE_DELAY_USER_REPLUG |
enum | FuDeviceInternalFlags |
FuDevice |
gboolean (*FuDeviceRetryFunc) (FuDevice *device
,gpointer user_data
,GError **error
);
#define fu_device_remove_flag(d,v) fwupd_device_remove_flag(FWUPD_DEVICE(d),v)
#define fu_device_has_instance_id(d,v) fwupd_device_has_instance_id(FWUPD_DEVICE(d),v)
#define fu_device_has_vendor_id(d,v) fwupd_device_has_vendor_id(FWUPD_DEVICE(d),v)
#define fu_device_has_protocol(d,v) fwupd_device_has_protocol(FWUPD_DEVICE(d),v)
#define fu_device_add_checksum(d,v) fwupd_device_add_checksum(FWUPD_DEVICE(d),v)
#define fu_device_add_release(d,v) fwupd_device_add_release(FWUPD_DEVICE(d),v)
#define fu_device_set_created(d,v) fwupd_device_set_created(FWUPD_DEVICE(d),v)
#define fu_device_set_description(d,v) fwupd_device_set_description(FWUPD_DEVICE(d),v)
#define fu_device_set_modified(d,v) fwupd_device_set_modified(FWUPD_DEVICE(d),v)
#define fu_device_set_summary(d,v) fwupd_device_set_summary(FWUPD_DEVICE(d),v)
#define fu_device_set_update_message(d,v) fwupd_device_set_update_message(FWUPD_DEVICE(d),v)
#define fu_device_set_update_image(d,v) fwupd_device_set_update_image(FWUPD_DEVICE(d),v)
#define fu_device_set_update_error(d,v) fwupd_device_set_update_error(FWUPD_DEVICE(d),v)
#define fu_device_set_update_state(d,v) fwupd_device_set_update_state(FWUPD_DEVICE(d),v)
#define fu_device_add_vendor_id(d,v) fwupd_device_add_vendor_id(FWUPD_DEVICE(d),v)
#define fu_device_add_protocol(d,v) fwupd_device_add_protocol(FWUPD_DEVICE(d),v)
#define fu_device_set_version_raw(d,v) fwupd_device_set_version_raw(FWUPD_DEVICE(d),v)
#define fu_device_set_version_lowest_raw(d,v) fwupd_device_set_version_lowest_raw(FWUPD_DEVICE(d),v)
#define fu_device_set_version_bootloader_raw(d,v) fwupd_device_set_version_bootloader_raw(FWUPD_DEVICE(d),v)
#define fu_device_set_flashes_left(d,v) fwupd_device_set_flashes_left(FWUPD_DEVICE(d),v)
#define fu_device_set_install_duration(d,v) fwupd_device_set_install_duration(FWUPD_DEVICE(d),v)
#define fu_device_get_checksums(d) fwupd_device_get_checksums(FWUPD_DEVICE(d))
#define fu_device_get_modified(d) fwupd_device_get_modified(FWUPD_DEVICE(d))
#define fu_device_get_guid_default(d) fwupd_device_get_guid_default(FWUPD_DEVICE(d))
#define fu_device_get_instance_ids(d) fwupd_device_get_instance_ids(FWUPD_DEVICE(d))
#define fu_device_get_update_error(d) fwupd_device_get_update_error(FWUPD_DEVICE(d))
#define fu_device_get_update_state(d) fwupd_device_get_update_state(FWUPD_DEVICE(d))
#define fu_device_get_version_lowest(d) fwupd_device_get_version_lowest(FWUPD_DEVICE(d))
#define fu_device_get_version_bootloader(d) fwupd_device_get_version_bootloader(FWUPD_DEVICE(d))
#define fu_device_get_version_format(d) fwupd_device_get_version_format(FWUPD_DEVICE(d))
#define fu_device_get_version_raw(d) fwupd_device_get_version_raw(FWUPD_DEVICE(d))
#define fu_device_get_version_lowest_raw(d) fwupd_device_get_version_lowest_raw(FWUPD_DEVICE(d))
#define fu_device_get_version_bootloader_raw(d) fwupd_device_get_version_bootloader_raw(FWUPD_DEVICE(d))
#define fu_device_get_vendor_ids(d) fwupd_device_get_vendor_ids(FWUPD_DEVICE(d))
#define fu_device_get_protocols(d) fwupd_device_get_protocols(FWUPD_DEVICE(d))
#define fu_device_get_flashes_left(d) fwupd_device_get_flashes_left(FWUPD_DEVICE(d))
#define fu_device_get_install_duration(d) fwupd_device_get_install_duration(FWUPD_DEVICE(d))
gchar *
fu_device_to_string (FuDevice *self
);
This allows us to easily print the FwupdDevice, the FwupdRelease and the daemon-specific metadata.
Since: 0.9.8
const gchar *
fu_device_get_alternate_id (FuDevice *self
);
Gets any alternate device ID. An alternate device may be linked to the primary device in some way.
Since: 1.1.0
void fu_device_set_alternate_id (FuDevice *self
,const gchar *alternate_id
);
Sets any alternate device ID. An alternate device may be linked to the primary device in some way.
Since: 1.1.0
const gchar *
fu_device_get_equivalent_id (FuDevice *self
);
Gets any equivalent ID for a device
Since: 0.6.1
void fu_device_set_equivalent_id (FuDevice *self
,const gchar *equivalent_id
);
Sets any equivalent ID for a device
Since: 0.6.1
void fu_device_add_guid (FuDevice *self
,const gchar *guid
);
Adds a GUID to the device. If the guid
argument is not a valid GUID then it
is converted to a GUID using fwupd_guid_hash_string()
.
Since: 0.7.2
gboolean fu_device_has_guid (FuDevice *self
,const gchar *guid
);
Finds out if the device has a specific GUID.
Since: 1.2.2
void fu_device_add_instance_id (FuDevice *self
,const gchar *instance_id
);
Adds an instance ID to the device. If the instance_id
argument is already a
valid GUID then fu_device_add_guid()
should be used instead.
Since: 1.2.5
void fu_device_add_instance_id_full (FuDevice *self
,const gchar *instance_id
,FuDeviceInstanceFlags flags
);
Adds an instance ID with all parameters set
Since: 1.2.9
FuDevice *
fu_device_get_alternate (FuDevice *self
);
Gets any alternate device. An alternate device may be linked to the primary device in some way.
The alternate object will be matched from the ID set in fu_device_set_alternate_id()
and will be assigned by the daemon. This means if the ID is not found as an
added device, then this function will return NULL
.
Since: 0.7.2
FuDevice *
fu_device_get_root (FuDevice *self
);
Gets the root parent device. A parent device is logically "above" the current device and this may be reflected in client tools.
If there is no parent device defined, then self
is returned.
Since: 1.4.0
FuDevice *
fu_device_get_parent (FuDevice *self
);
Gets any parent device. An parent device is logically "above" the current device and this may be reflected in client tools.
This information also allows the plugin to optionally verify the parent device, for instance checking the parent device firmware version.
The parent object is not refcounted and if destroyed this function will then
return NULL
.
Since: 1.0.8
GPtrArray *
fu_device_get_children (FuDevice *self
);
Gets any child devices. A child device is logically "below" the current device and this may be reflected in client tools.
Since: 1.0.8
void fu_device_add_child (FuDevice *self
,FuDevice *child
);
Sets any child device. An child device is logically linked to the primary device in some way.
Since: 1.0.8
void fu_device_add_parent_guid (FuDevice *self
,const gchar *guid
);
Sets any parent device using a GUID. An parent device is logically linked to
the primary device in some way and can be added before or after self
.
The GUIDs are searched in order, and so the order of adding GUIDs may be important if more than one parent device might match.
If the parent device is removed, any children logically linked to it will also be removed.
Since: 1.0.8
void fu_device_add_counterpart_guid (FuDevice *self
,const gchar *guid
);
Adds a GUID to the device. If the guid
argument is not a valid GUID then it
is converted to a GUID using fwupd_guid_hash_string()
.
A counterpart GUID is typically the GUID of the same device in bootloader or runtime mode, if they have a different device PCI or USB ID. Adding this type of GUID does not cause a "cascade" by matching using the quirk database.
Since: 1.1.2
FuDevice *
fu_device_get_proxy (FuDevice *self
);
Gets any proxy device. A proxy device can be used to perform an action on
behalf of another device, for instance attach()
ing it after a successful
update.
The proxy object is not refcounted and if destroyed this function will then
return NULL
.
Since: 1.4.1
void fu_device_set_proxy (FuDevice *self
,FuDevice *proxy
);
Sets any proxy device. A proxy device can be used to perform an action on
behalf of another device, for instance attach()
ing it after a successful
update.
Since: 1.4.1
const gchar * fu_device_get_metadata (FuDevice *self
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.1.0
gboolean fu_device_get_metadata_boolean (FuDevice *self
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.9.7
guint fu_device_get_metadata_integer (FuDevice *self
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.9.7
void fu_device_remove_metadata (FuDevice *self
,const gchar *key
);
Removes an item of metadata on the device.
Since: 1.3.3
void fu_device_set_metadata (FuDevice *self
,const gchar *key
,const gchar *value
);
Sets an item of metadata on the device.
Since: 0.1.0
void fu_device_set_metadata_boolean (FuDevice *self
,const gchar *key
,gboolean value
);
Sets an item of metadata on the device. When value
is set to TRUE
the actual stored value is "true".
Since: 0.9.7
void fu_device_set_metadata_integer (FuDevice *self
,const gchar *key
,guint value
);
Sets an item of metadata on the device. The integer is stored as a base-10 string internally.
Since: 0.9.7
void fu_device_set_id (FuDevice *self
,const gchar *id
);
Sets the ID on the device. The ID should represent the *connection* of the
device, so that any similar device plugged into a different slot will
have a different id
string.
The id
will be converted to a SHA1 hash if required before the device is
added to the daemon, and plugins should not assume that the ID that is set
here is the same as what is returned by fu_device_get_id()
.
Since: 0.7.1
void fu_device_set_version_format (FuDevice *self
,FwupdVersionFormat fmt
);
Sets the version format.
Since: 1.4.0
void fu_device_set_version (FuDevice *self
,const gchar *version
);
Sets the device version, sanitizing the string if required.
Since: 1.2.9
void fu_device_set_version_lowest (FuDevice *self
,const gchar *version
);
Sets the device lowest version, sanitizing the string if required.
Since: 1.4.0
void fu_device_set_version_bootloader (FuDevice *self
,const gchar *version
);
Sets the device bootloader version, sanitizing the string if required.
Since: 1.4.0
const gchar *
fu_device_get_physical_id (FuDevice *self
);
Gets the physical ID set for the device, which represents the electrical connection used to compare devices.
Multiple FuDevices can share a single physical ID.
Since: 1.1.2
void fu_device_set_physical_id (FuDevice *self
,const gchar *physical_id
);
Sets the physical ID on the device which represents the electrical connection of the device to the system. Multiple FuDevices can share a physical ID.
The physical ID is used to remove logical devices when a physical device has been removed from the system.
A sysfs or devpath is not a physical ID, but could be something like
PCI_SLOT_NAME=0000:3e:00.0
.
Since: 1.1.2
const gchar *
fu_device_get_logical_id (FuDevice *self
);
Gets the logical ID set for the device, which disambiguates devices with the same physical ID.
Since: 1.1.2
void fu_device_set_logical_id (FuDevice *self
,const gchar *logical_id
);
Sets the logical ID on the device. This is designed to disambiguate devices with the same physical ID.
Since: 1.1.2
const gchar *
fu_device_get_backend_id (FuDevice *self
);
Gets the ID set for the device as recognised by the backend. This is typically a Linux sysfs path or USB platform ID. If unset, it also falls back to the physical ID as this may be the same value.
Since: 1.5.8
void fu_device_set_backend_id (FuDevice *self
,const gchar *backend_id
);
Sets the backend ID on the device. This is designed to disambiguate devices with the same physical ID. This is typically a Linux sysfs path or USB platform ID.
Since: 1.5.8
const gchar *
fu_device_get_proxy_guid (FuDevice *self
);
Gets the proxy GUID device, which which is set to let the engine match up the proxy between plugins.
Since: 1.4.1
void fu_device_set_proxy_guid (FuDevice *self
,const gchar *proxy_guid
);
Sets the GUID of the proxy device. The proxy device may update self
.
Since: 1.4.1
const gchar *
fu_device_get_protocol (FuDevice *self
);
fu_device_get_protocol
is deprecated and should not be used in newly-written code.
Gets the protocol ID on the device.
Since: 1.3.5
void fu_device_set_protocol (FuDevice *self
,const gchar *protocol
);
fu_device_set_protocol
is deprecated and should not be used in newly-written code.
Sets the protocol ID on the device.
Since: 1.3.5
guint
fu_device_get_priority (FuDevice *self
);
Gets the device priority, where higher numbers are better.
Since: 1.1.1
void fu_device_set_priority (FuDevice *self
,guint priority
);
Sets the device priority, where higher numbers are better.
Since: 1.1.1
void fu_device_add_flag (FuDevice *self
,FwupdDeviceFlags flag
);
Adds a device flag to the device
Since: 0.1.0
const gchar *
fu_device_get_custom_flags (FuDevice *self
);
Gets the custom flags for the device from the quirk system.
Since: 1.1.0
gboolean fu_device_has_custom_flag (FuDevice *self
,const gchar *hint
);
Checks if the custom flag exists for the device from the quirk system.
It may be more efficient to call fu_device_get_custom_flags()
and split the
string locally if checking for lots of different flags.
Since: 1.1.0
void fu_device_set_custom_flags (FuDevice *self
,const gchar *custom_flags
);
Sets the custom flags from the quirk system that can be used to affect device matching. The actual string format is defined by the plugin.
Since: 1.1.0
void fu_device_set_name (FuDevice *self
,const gchar *value
);
Sets the name on the device. Any invalid parts will be converted or removed.
Since: 0.7.1
guint
fu_device_get_remove_delay (FuDevice *self
);
Returns the maximum delay expected when replugging the device going into bootloader mode.
Since: 1.0.2
void fu_device_set_remove_delay (FuDevice *self
,guint remove_delay
);
Sets the amount of time a device is allowed to return in bootloader mode.
NOTE: this should be less than 3000ms for devices that just have to reset and automatically re-enumerate, but significantly longer if it involves a user removing a cable, pressing several buttons and removing a cable. A suggested value for this would be 10,000ms.
Since: 1.0.2
FwupdStatus
fu_device_get_status (FuDevice *self
);
Returns what the device is currently doing.
Since: 1.0.3
void fu_device_set_status (FuDevice *self
,FwupdStatus status
);
Sets what the device is currently doing.
Since: 1.0.3
void fu_device_set_firmware_size (FuDevice *self
,guint64 size
);
Sets the exact allowed size of the firmware blob.
Since: 1.2.6
void fu_device_set_firmware_size_min (FuDevice *self
,guint64 size_min
);
Sets the minimum allowed size of the firmware blob.
Since: 1.1.2
void fu_device_set_firmware_size_max (FuDevice *self
,guint64 size_max
);
Sets the maximum allowed size of the firmware blob.
Since: 1.1.2
guint64
fu_device_get_firmware_size_min (FuDevice *self
);
Gets the minimum size of the firmware blob.
Since: 1.2.6
guint64
fu_device_get_firmware_size_max (FuDevice *self
);
Gets the maximum size of the firmware blob.
Since: 1.2.6
guint
fu_device_get_progress (FuDevice *self
);
Returns the progress completion.
Since: 1.0.3
void fu_device_set_progress (FuDevice *self
,guint progress
);
Sets the progress completion.
Since: 1.0.3
guint
fu_device_get_battery_level (FuDevice *self
);
Returns the battery level.
Since: 1.5.8
void fu_device_set_battery_level (FuDevice *self
,guint battery_level
);
Sets the battery level, or 0 for invalid. Setting this allows fwupd to show a warning if the device change is too low to perform the update.
Since: 1.5.8
void fu_device_set_progress_full (FuDevice *self
,gsize progress_done
,gsize progress_total
);
Sets the progress completion using the raw progress values.
self |
A FuDevice |
|
progress_done |
the bytes already done |
|
progress_total |
the total number of bytes |
Since: 1.0.3
void fu_device_sleep_with_progress (FuDevice *self
,guint delay_secs
);
Sleeps, setting the device progress from 0..100% as time continues. The value is gven in whole seconds as it does not make sense to show the progressbar advancing so quickly for durations of less than one second.
Since: 1.5.0
void fu_device_set_quirks (FuDevice *self
,FuQuirks *quirks
);
Sets the optional quirk information which may be useful to this device. This is typically set after the FuDevice has been created, but before the device has been opened or probed.
Since: 1.0.3
FuQuirks *
fu_device_get_quirks (FuDevice *self
);
Gets the quirk information which may be useful to this device.
Since: 1.0.3
FwupdRelease *
fu_device_get_release_default (FuDevice *self
);
Gets the default release for the device, creating one if not found.
Since: 1.0.5
GType
fu_device_get_specialized_gtype (FuDevice *self
);
Gets the specialized type of the device
Since: 1.3.3
void fu_device_add_internal_flag (FuDevice *self
,FuDeviceInternalFlags flag
);
Adds a private flag that stays internal to the engine and is not leaked to the client.
Since: 1.5.5
void fu_device_remove_internal_flag (FuDevice *self
,FuDeviceInternalFlags flag
);
Removes a private flag that stays internal to the engine and is not leaked to the client.
Since: 1.5.5
gboolean fu_device_has_internal_flag (FuDevice *self
,FuDeviceInternalFlags flag
);
Tests for a private flag that stays internal to the engine and is not leaked to the client.
Since: 1.5.5
gboolean fu_device_write_firmware (FuDevice *self
,GBytes *fw
,FwupdInstallFlags flags
,GError **error
);
Writes firmware to the device by calling a plugin-specific vfunc.
Since: 1.0.8
FuFirmware * fu_device_prepare_firmware (FuDevice *self
,GBytes *fw
,FwupdInstallFlags flags
,GError **error
);
Prepares the firmware by calling an optional device-specific vfunc for the device, which can do things like decompressing or parsing of the firmware data.
For all firmware, this checks the size of the firmware if limits have been
set using fu_device_set_firmware_size_min()
, fu_device_set_firmware_size_max()
or using a quirk entry.
Since: 1.1.2
FuFirmware * fu_device_read_firmware (FuDevice *self
,GError **error
);
Reads firmware from the device by calling a plugin-specific vfunc. The device subclass should try to ensure the firmware does not contain any serial numbers or user-configuration values and can be used to calculate the device checksum.
The return value can be converted to a blob of memory using fu_firmware_write()
.
Since: 1.0.8
GBytes * fu_device_dump_firmware (FuDevice *self
,GError **error
);
Reads the raw firmware image from the device by calling a plugin-specific vfunc. This raw firmware image may contain serial numbers or device-specific configuration but should be a byte-for-byte match compared to using an external SPI programmer.
Since: 1.5.0
gboolean fu_device_attach (FuDevice *self
,GError **error
);
Attaches a device from the bootloader into application mode.
Since: 1.0.8
gboolean fu_device_detach (FuDevice *self
,GError **error
);
Detaches a device from the application into bootloader mode.
Since: 1.0.8
gboolean fu_device_reload (FuDevice *self
,GError **error
);
Reloads a device that has just gone from bootloader into application mode.
Since: 1.3.3
gboolean fu_device_prepare (FuDevice *self
,FwupdInstallFlags flags
,GError **error
);
Prepares a device for update. A different plugin can handle each of
FuDevice->prepare()
, FuDevice->detach()
and FuDevice->write_firmware()
.
Since: 1.3.3
gboolean fu_device_cleanup (FuDevice *self
,FwupdInstallFlags flags
,GError **error
);
Cleans up a device after an update. A different plugin can handle each of
FuDevice->write_firmware()
, FuDevice->attach()
and FuDevice->cleanup()
.
Since: 1.3.3
void fu_device_incorporate (FuDevice *self
,FuDevice *donor
);
Copy all properties from the donor object if they have not already been set.
Since: 1.1.0
void fu_device_incorporate_flag (FuDevice *self
,FuDevice *donor
,FwupdDeviceFlags flag
);
Copy the value of a specific flag from the donor object.
Since: 1.3.5
gboolean fu_device_open (FuDevice *self
,GError **error
);
Opens a device, optionally running a object-specific vfunc.
Plugins can call fu_device_open()
multiple times without calling
fu_device_close()
, but only the first call will actually invoke the vfunc.
It is expected that plugins issue the same number of fu_device_open()
and
fu_device_close()
methods when using a specific self
.
Since: 1.1.2
gboolean fu_device_close (FuDevice *self
,GError **error
);
Closes a device, optionally running a object-specific vfunc.
Plugins can call fu_device_close()
multiple times without calling
fu_device_open()
, but only the last call will actually invoke the vfunc.
It is expected that plugins issue the same number of fu_device_open()
and
fu_device_close()
methods when using a specific self
.
An error is returned if this method is called without having used the
fu_device_open()
method beforehand.
Since: 1.1.2
gboolean fu_device_probe (FuDevice *self
,GError **error
);
Probes a device, setting parameters on the object that does not need the device open or the interface claimed. If the device is not compatible then an error should be returned.
Since: 1.1.2
gboolean fu_device_setup (FuDevice *self
,GError **error
);
Sets up a device, setting parameters on the object that requires the device to be open and have the interface claimed. If the device is not compatible then an error should be returned.
Since: 1.1.2
gboolean fu_device_rescan (FuDevice *self
,GError **error
);
Rescans a device, re-adding GUIDs or flags based on some hardware change.
Since: 1.3.1
gboolean fu_device_activate (FuDevice *self
,GError **error
);
Activates up a device, which normally means the device switches to a new firmware version. This should only be called when data loss cannot occur.
Since: 1.2.6
void
fu_device_probe_invalidate (FuDevice *self
);
Normally when calling fu_device_probe()
multiple times it is only done once.
Calling this method causes the next requests to fu_device_probe()
and
fu_device_setup()
actually probe the hardware.
This should be done in case the backing device has changed, for instance if a USB device has been replugged.
Since: 1.1.2
gboolean fu_device_poll (FuDevice *self
,GError **error
);
Polls a device, typically querying the hardware for status.
Since: 1.1.2
void fu_device_set_poll_interval (FuDevice *self
,guint interval
);
Polls the hardware every interval period. If the subclassed ->
method
returns poll()
FALSE
then a warning is printed to the console and the poll is
disabled until the next call to fu_device_set_poll_interval()
.
Since: 1.1.2
void fu_device_retry_set_delay (FuDevice *self
,guint delay
);
Sets the recovery delay between failed retries.
Since: 1.4.0
void fu_device_retry_add_recovery (FuDevice *self
,GQuark domain
,gint code
,FuDeviceRetryFunc func
);
Sets the optional function to be called when fu_device_retry()
fails, which
is possibly a device reset.
If func
is NULL
then recovery is not possible and an error is returned
straight away.
self |
A FuDevice |
|
domain |
A GQuark, or |
|
code |
A GError code |
|
func |
A function to recover the device. |
[scope async][nullable] |
Since: 1.4.0
gboolean fu_device_retry (FuDevice *self
,FuDeviceRetryFunc func
,guint count
,gpointer user_data
,GError **error
);
Calls a specific function a number of times, optionally handling the error with a reset action.
If fu_device_retry_add_recovery()
has not been used then all errors are
considered non-fatal until the last try.
If the reset function returns FALSE
, then the function returns straight away
without processing any pending retries.
self |
A FuDevice |
|
func |
A function to execute. |
[scope async] |
count |
The number of tries to try the function |
|
user_data |
a helper to pass to |
[nullable] |
error |
A GError |
Since: 1.4.0
gboolean fu_device_retry_full (FuDevice *self
,FuDeviceRetryFunc func
,guint count
,guint delay
,gpointer user_data
,GError **error
);
Calls a specific function a number of times, optionally handling the error with a reset action.
If fu_device_retry_add_recovery()
has not been used then all errors are
considered non-fatal until the last try.
If the reset function returns FALSE
, then the function returns straight away
without processing any pending retries.
self |
A FuDevice |
|
func |
A function to execute. |
[scope async] |
count |
The number of tries to try the function |
|
delay |
The delay between each try in ms |
|
user_data |
a helper to pass to |
[nullable] |
error |
A GError |
Since: 1.5.5
gboolean fu_device_bind_driver (FuDevice *self
,const gchar *subsystem
,const gchar *driver
,GError **error
);
Binds a driver to the device, which normally means the kernel driver takes control of the hardware.
self |
A FuDevice |
|
subsystem |
A subsystem string, e.g. |
|
driver |
A kernel module name, e.g. |
|
error |
A GError, or |
Since: 1.5.0
gboolean fu_device_unbind_driver (FuDevice *self
,GError **error
);
Unbinds the driver from the device, which normally means the kernel releases the hardware so it can be used from userspace.
If there is no driver bound then this function will return with success without actually doing anything.
Since: 1.5.0
GHashTable *
fu_device_report_metadata_pre (FuDevice *self
);
Collects metadata that would be useful for debugging a failed update report.
Since: 1.5.0
struct FuDeviceClass { FwupdDeviceClass parent_class; void (*to_string) (FuDevice *self, guint indent, GString *str); gboolean (*write_firmware) (FuDevice *self, FuFirmware *firmware, FwupdInstallFlags flags, GError **error) G_GNUC_WARN_UNUSED_RESULT; FuFirmware *(*read_firmware) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*detach) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*attach) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*open) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*close) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*probe) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*rescan) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; FuFirmware *(*prepare_firmware) (FuDevice *self, GBytes *fw, FwupdInstallFlags flags, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*set_quirk_kv) (FuDevice *self, const gchar *key, const gchar *value, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*setup) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; void (*incorporate) (FuDevice *self, FuDevice *donor); gboolean (*poll) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*activate) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*reload) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*prepare) (FuDevice *self, FwupdInstallFlags flags, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*cleanup) (FuDevice *self, FwupdInstallFlags flags, GError **error) G_GNUC_WARN_UNUSED_RESULT; void (*report_metadata_pre) (FuDevice *self, GHashTable *metadata); void (*report_metadata_post)(FuDevice *self, GHashTable *metadata); gboolean (*bind_driver) (FuDevice *self, const gchar *subsystem, const gchar *driver, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean (*unbind_driver) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; GBytes *(*dump_firmware) (FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT; };
#define FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE 10000
The default removal delay for device re-enumeration taking into account a chain of slow USB hubs. This should be used when the device is able to reset itself between bootloader->runtime->bootloader.
#define FU_DEVICE_REMOVE_DELAY_USER_REPLUG 40000
The default removal delay for device re-plug taking into account humans being slow and clumsy. This should be used when the user has to do something, e.g. unplug, press a magic button and then replug.
The device internal flags.
No flags set |
||
Do not add instance IDs from the device baseclass |
||
Ensure the version is a valid semantic version, e.g. numbers separated with dots |
||
Only devices supported in the metadata will be opened |
||
Set the device name from the metadata |
||
Set the device name from the metadata |
||
Set the device version format from the metadata if available |
||
Set the device icon from the metadata if available |
||
Retry the device open up to 5 times if it fails |
||
Match GUIDs on device replug where the physical and logical IDs will be different |
||
Inherit activation status from the history database on startup |