Top | ![]() |
![]() |
![]() |
![]() |
#define | FU_TYPE_DEVICE |
struct | FuDeviceClass |
#define | FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE |
#define | FU_DEVICE_REMOVE_DELAY_USER_REPLUG |
FuDevice |
#define fu_device_remove_flag(d,v) fwupd_device_remove_flag(FWUPD_DEVICE(d),v)
#define fu_device_add_checksum(d,v) fwupd_device_add_checksum(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_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_set_vendor_id(d,v) fwupd_device_set_vendor_id(FWUPD_DEVICE(d),v)
#define fu_device_set_version(d,v) fwupd_device_set_version(FWUPD_DEVICE(d),v)
#define fu_device_set_version_lowest(d,v) fwupd_device_set_version_lowest(FWUPD_DEVICE(d),v)
#define fu_device_set_version_bootloader(d,v) fwupd_device_set_version_bootloader(FWUPD_DEVICE(d),v)
#define fu_device_set_flashes_left(d,v) fwupd_device_set_flashes_left(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_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_vendor_id(d) fwupd_device_get_vendor_id(FWUPD_DEVICE(d))
#define fu_device_get_flashes_left(d) fwupd_device_get_flashes_left(FWUPD_DEVICE(d))
gchar *
fu_device_to_string (FuDevice *device
);
This allows us to easily print the FwupdDevice, the FwupdRelease and the daemon-specific metadata.
Since: 0.9.8
void fu_device_set_equivalent_id (FuDevice *device
,const gchar *equivalent_id
);
void fu_device_add_guid (FuDevice *device
,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 as_utils_guid_from_string()
.
Since: 0.7.2
FuDevice *
fu_device_get_alternate (FuDevice *device
);
Gets any alternate device. An alternate device may be linked to the primary device in some way.
Since: 0.7.2
void fu_device_set_alternate (FuDevice *device
,FuDevice *alternate
);
Sets any alternate device. An alternate device may be linked to the primary device in some way.
Since: 0.7.2
const gchar * fu_device_get_metadata (FuDevice *device
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.1.0
gboolean fu_device_get_metadata_boolean (FuDevice *device
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.9.7
guint fu_device_get_metadata_integer (FuDevice *device
,const gchar *key
);
Gets an item of metadata from the device.
Since: 0.9.7
void fu_device_set_metadata (FuDevice *device
,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 *device
,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 *device
,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 *device
,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 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
const gchar *
fu_device_get_platform_id (FuDevice *device
);
Gets the Platform ID set for the device, which represents the connection string used to compare devices.
Since: 1.0.2
void fu_device_set_platform_id (FuDevice *device
,const gchar *platform_id
);
Sets the Platform ID on the device. If unset, the ID will automatically
be set using a hash of the platform_id
value.
Since: 1.0.2
const gchar *
fu_device_get_serial (FuDevice *device
);
Gets the serial number for the device.
Since: 1.0.3
void fu_device_set_serial (FuDevice *device
,const gchar *serial
);
Sets the serial number for the device.
Since: 1.0.3
const gchar *
fu_device_get_plugin_hints (FuDevice *device
);
Gets the plugin hint for the device from the quirk system.
Since: 1.0.3
void fu_device_set_plugin_hints (FuDevice *device
,const gchar *plugin_hints
);
Sets the hint the the plugin from the quirk system that can be used to do affect device matching. The actual string format is defined by the plugin.
Since: 1.0.3
void fu_device_set_name (FuDevice *device
,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 *device
);
Returns the maximum delay expected when replugging the device going into bootloader mode.
Since: 1.0.2
void fu_device_set_remove_delay (FuDevice *device
,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 *device
);
Returns what the device is currently doing.
Since: 1.0.3
void fu_device_set_status (FuDevice *device
,FwupdStatus status
);
Sets what the device is currently doing.
Since: 1.0.3
guint
fu_device_get_progress (FuDevice *device
);
Returns the progress completion.
Since: 1.0.3
void fu_device_set_progress (FuDevice *device
,guint progress
);
Sets the progress completion.
Since: 1.0.3
void fu_device_set_progress_full (FuDevice *device
,gsize progress_done
,gsize progress_total
);
Sets the progress completion using the raw progress values.
device |
A FuDevice |
|
progress_done |
the bytes already done |
|
progress_total |
the total number of bytes |
Since: 1.0.3
void fu_device_set_quirks (FuDevice *device
,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 *device
);
Gets the quirk information which may be useful to this device.
Since: 1.0.3
FwupdRelease *
fu_device_get_release_default (FuDevice *device
);
Gets the default release for the device, creating one if not found.
Since: 1.0.5
struct FuDeviceClass { FwupdDeviceClass parent_class; void (*to_string) (FuDevice *device, GString *str); };
#define FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE 5000
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 20000
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.