Fwupd.Device – fwupd Reference Manual
Packages
fwupd
Fwupd
Device
battery_level
battery_threshold
flags
id
parent
percentage
problems
request_flags
status
update_error
update_state
vendor
version
version_format
array_ensure_parents
array_filter_flags
flag_from_string
flag_to_string
id_is_valid
problem_from_string
problem_to_string
Device
add_checksum
add_child
add_flag
add_guid
add_icon
add_instance_id
add_issue
add_problem
add_protocol
add_release
add_request_flag
add_vendor_id
compare
get_battery_level
get_battery_threshold
get_branch
get_checksums
get_children
get_composite_id
get_created
get_details_url
get_flags
get_flashes_left
get_guid_default
get_guids
get_icons
get_id
get_id_display
get_install_duration
get_instance_ids
get_issues
get_modified
get_name
get_parent
get_parent_id
get_percentage
get_plugin
get_problems
get_protocols
get_release_default
get_releases
get_request_flags
get_root
get_serial
get_status
get_summary
get_update_error
get_update_state
get_vendor
get_vendor_ids
get_version
get_version_bootloader
get_version_bootloader_raw
get_version_build_date
get_version_format
get_version_highest
get_version_highest_raw
get_version_lowest
get_version_lowest_raw
get_version_raw
has_checksum
has_flag
has_guid
has_icon
has_instance_id
has_problem
has_protocol
has_request_flag
has_vendor_id
incorporate
match_flags
remove_child
remove_children
remove_flag
remove_problem
remove_request_flag
set_battery_level
set_battery_threshold
set_branch
set_composite_id
set_created
set_details_url
set_flags
set_flashes_left
set_id
set_install_duration
set_modified
set_name
set_parent
set_parent_id
set_percentage
set_plugin
set_problems
set_request_flags
set_serial
set_status
set_summary
set_update_error
set_update_state
set_vendor
set_version
set_version_bootloader
set_version_bootloader_raw
set_version_build_date
set_version_format
set_version_highest
set_version_highest_raw
set_version_lowest
set_version_lowest_raw
set_version_raw
Device
Object Hierarchy:
Description:
[
CCode
( type_id =
"fwupd_device_get_type ()"
) ]
public
class
Device
:
Object
,
Codec
A physical device on the host with optionally updatable firmware.
See also: [class@FwupdRelease]
Namespace:
Fwupd
Package:
fwupd
Content:
Properties:
public
uint
battery_level
{
get
;
set
; }
The device battery level in percent.
public
uint
battery_threshold
{
get
;
set
; }
The device battery threshold in percent.
public
uint64
flags
{
get
;
set
; }
The device flags.
public
string
id
{
get
;
set
; }
The device ID.
public
Device
parent
{
get
;
set
construct
; }
The device parent.
public
uint
percentage
{
get
;
set
; }
The current device percentage.
public
uint64
problems
{
get
;
set
; }
The problems with the device that the user could fix, e.
public
uint64
request_flags
{
get
;
set
; }
The device request flags.
public
uint
status
{
get
;
set
; }
The current device status.
public
string
update_error
{
get
;
set
; }
The device update error.
public
uint
update_state
{
get
;
set
; }
The device update state.
public
string
vendor
{
get
;
set
; }
The device vendor.
public
string
version
{
get
;
set
; }
The device version.
public
uint
version_format
{
get
;
set
; }
The version format of the device.
Static methods:
public
static
void
array_ensure_parents
(
GenericArray
<
Device
> devices)
Sets the parent object on all devices in the array using the parent ID.
public
static
GenericArray
<
unowned
Device
>
array_filter_flags
(
GenericArray
<
Device
> devices,
DeviceFlags
include,
DeviceFlags
exclude)
throws
Error
Creates an array of new devices that match using
match_flags
.
public
static
DeviceFlags
flag_from_string
(
string
? val)
Converts a string to an enumerated value.
public
static
unowned
string
flag_to_string
(
DeviceFlags
val)
Converts an enumerated value to a string.
public
static
bool
id_is_valid
(
string
device_id)
Checks the string is a valid non-partial device ID.
public
static
DeviceProblem
problem_from_string
(
string
? val)
Converts a string to an enumerated value.
public
static
unowned
string
problem_to_string
(
DeviceProblem
val)
Converts an enumerated value to a string.
Creation methods:
public
Device
()
Creates a new device.
Methods:
public
void
add_checksum
(
string
checksum)
Adds a device checksum.
public
void
add_child
(
Device
child)
Adds a child device.
public
void
add_flag
(
DeviceFlags
flag)
Adds a specific device flag to the device.
public
void
add_guid
(
string
guid)
Adds the GUID if it does not already exist.
public
void
add_icon
(
string
icon)
Adds the icon name if it does not already exist.
public
void
add_instance_id
(
string
instance_id)
Adds the instance ID if it does not already exist.
public
void
add_issue
(
string
issue)
Adds an current issue to this device.
public
void
add_problem
(
DeviceProblem
problem)
Adds a specific device problem kind to the device.
public
void
add_protocol
(
string
protocol)
Adds a device protocol name.
public
void
add_release
(
Release
release)
Adds a release for this device.
public
void
add_request_flag
(
RequestFlags
request_flag)
Adds a specific device request flag to the device.
public
void
add_vendor_id
(
string
vendor_id)
Adds a device vendor ID.
public
int
compare
(
Device
self2)
Comparison function for comparing two device objects.
public
uint32
get_battery_level
()
Returns the battery level.
public
uint32
get_battery_threshold
()
Returns the battery threshold under which a firmware update cannot be performed.
public
unowned
string
get_branch
()
Gets the current device branch.
public
unowned
GenericArray
<
string
>
get_checksums
()
Gets the device checksums.
public
unowned
GenericArray
<
Device
>
get_children
()
Gets the device children.
public
unowned
string
?
get_composite_id
()
Gets the composite ID, falling back to the device ID if unset.
public
uint64
get_created
()
Gets when the device was created.
public
unowned
string
get_details_url
()
Gets the device URL.
public
uint64
get_flags
()
Gets device flags.
public
uint32
get_flashes_left
()
Gets the number of flash cycles left on the device
public
unowned
string
get_guid_default
()
Gets the default GUID.
public
unowned
GenericArray
<
string
>
get_guids
()
Gets the GUIDs.
public
unowned
GenericArray
<
string
>
get_icons
()
Gets the icon names to use for the device.
public
unowned
string
get_id
()
Gets the ID.
public
string
get_id_display
()
Gets the device ID suffixed with the display name if set.
public
uint32
get_install_duration
()
Gets the time estimate for firmware installation (in seconds)
public
unowned
GenericArray
<
string
>
get_instance_ids
()
Gets the instance IDs.
public
unowned
GenericArray
<
string
>
get_issues
()
Gets the list of issues currently affecting this device.
public
uint64
get_modified
()
Gets when the device was modified.
public
unowned
string
get_name
()
Gets the device name.
public
unowned
Device
get_parent
()
Gets the parent.
public
unowned
string
get_parent_id
()
Gets the parent ID.
public
uint
get_percentage
()
Returns the percentage completion of the device.
public
unowned
string
get_plugin
()
Gets the plugin that created the device.
public
uint64
get_problems
()
Gets device problems.
public
unowned
GenericArray
<
string
>
get_protocols
()
Gets the device protocol names.
public
unowned
Release
get_release_default
()
Gets the default release for this device.
public
unowned
GenericArray
<
Release
>
get_releases
()
Gets all the releases for this device.
public
uint64
get_request_flags
()
Gets device request flags.
public
unowned
Device
get_root
()
Gets the device root.
public
unowned
string
get_serial
()
Gets the serial number for the device.
public
Status
get_status
()
Returns what the device is currently doing.
public
unowned
string
get_summary
()
Gets the device summary.
public
unowned
string
get_update_error
()
Gets the update error string.
public
UpdateState
get_update_state
()
Gets the update state.
public
unowned
string
get_vendor
()
Gets the device vendor.
public
unowned
GenericArray
<
string
>
get_vendor_ids
()
Gets the device vendor ID.
public
unowned
string
get_version
()
Gets the device version.
public
unowned
string
get_version_bootloader
()
Gets the version of the bootloader.
public
uint64
get_version_bootloader_raw
()
Gets the bootloader version of firmware the device will accept in raw format.
public
uint64
get_version_build_date
()
Gets the date when the firmware was built.
public
VersionFormat
get_version_format
()
Gets the version format.
public
unowned
string
get_version_highest
()
Gets the highest version of firmware the device will accept.
public
uint64
get_version_highest_raw
()
Gets the highest version of firmware the device will accept in raw format.
public
unowned
string
get_version_lowest
()
Gets the lowest version of firmware the device will accept.
public
uint64
get_version_lowest_raw
()
Gets the lowest version of firmware the device will accept in raw format.
public
uint64
get_version_raw
()
Gets the raw version number from the hardware before converted to a string.
public
bool
has_checksum
(
string
checksum)
Finds out if the device has this specific checksum.
public
bool
has_flag
(
DeviceFlags
flag)
Finds if the device has a specific device flag.
public
bool
has_guid
(
string
guid)
Finds out if the device has this specific GUID.
public
bool
has_icon
(
string
icon)
Finds out if the device has this specific icon.
public
bool
has_instance_id
(
string
instance_id)
Finds out if the device has this specific instance ID.
public
bool
has_problem
(
DeviceProblem
problem)
Finds if the device has a specific device problem kind.
public
bool
has_protocol
(
string
protocol)
Finds out if the device has this specific protocol name.
public
bool
has_request_flag
(
RequestFlags
request_flag)
Finds if the device has a specific device request flag.
public
bool
has_vendor_id
(
string
vendor_id)
Finds out if the device has this specific vendor ID.
public
void
incorporate
(
Device
donor)
Copy all properties from the donor object if they have not already been set.
public
bool
match_flags
(
DeviceFlags
include,
DeviceFlags
exclude)
Check if the device flags match.
public
void
remove_child
(
Device
child)
Removes a child device.
public
void
remove_children
()
Removes all child devices.
public
void
remove_flag
(
DeviceFlags
flag)
Removes a specific device flag from the device.
public
void
remove_problem
(
DeviceProblem
problem)
Removes a specific device problem kind from the device.
public
void
remove_request_flag
(
RequestFlags
request_flag)
Removes a specific device request flag from the device.
public
void
set_battery_level
(
uint32
battery_level)
Sets the battery level, or
fwupd_battery_level_invalid
.
public
void
set_battery_threshold
(
uint32
battery_threshold)
Sets the battery level, or
fwupd_battery_level_invalid
for the default.
public
void
set_branch
(
string
? branch)
Sets the current device branch.
public
void
set_composite_id
(
string
? composite_id)
Sets the composite ID, which is usually a SHA1 hash of a grandparent or parent device.
public
void
set_created
(
uint64
created)
Sets when the device was created.
public
void
set_details_url
(
string
? details_url)
Sets the device URL.
public
void
set_flags
(
uint64
flags)
Sets device flags.
public
void
set_flashes_left
(
uint32
flashes_left)
Sets the number of flash cycles left on the device
public
void
set_id
(
string
? id)
Sets the ID.
public
void
set_install_duration
(
uint32
duration)
Sets the time estimate for firmware installation (in seconds)
public
void
set_modified
(
uint64
modified)
Sets when the device was modified.
public
void
set_name
(
string
? name)
Sets the device name.
public
void
set_parent
(
Device
? parent)
Sets the parent.
public
void
set_parent_id
(
string
? parent_id)
Sets the parent ID.
public
void
set_percentage
(
uint
percentage)
Sets the percentage completion of the device.
public
void
set_plugin
(
string
? plugin)
Sets the plugin that created the device.
public
void
set_problems
(
uint64
problems)
Sets device problems.
public
void
set_request_flags
(
uint64
request_flags)
Sets device request flags.
public
void
set_serial
(
string
? serial)
Sets the serial number for the device.
public
void
set_status
(
Status
status)
Sets what the device is currently doing.
public
void
set_summary
(
string
? summary)
Sets the device summary.
public
void
set_update_error
(
string
? update_error)
Sets the update error string.
public
void
set_update_state
(
UpdateState
update_state)
Sets the update state.
public
void
set_vendor
(
string
? vendor)
Sets the device vendor.
public
void
set_version
(
string
? version)
Sets the device version.
public
void
set_version_bootloader
(
string
? version_bootloader)
Sets the bootloader version.
public
void
set_version_bootloader_raw
(
uint64
version_bootloader_raw)
Sets the raw bootloader version number from the hardware before converted to a string.
public
void
set_version_build_date
(
uint64
version_build_date)
Sets the date when the firmware was built.
public
void
set_version_format
(
VersionFormat
version_format)
Sets the version format.
public
void
set_version_highest
(
string
? version_highest)
Sets the highest version of firmware the device will accept.
public
void
set_version_highest_raw
(
uint64
version_highest_raw)
Sets the raw highest version number from the hardware before being converted to a string.
public
void
set_version_lowest
(
string
? version_lowest)
Sets the lowest version of firmware the device will accept.
public
void
set_version_lowest_raw
(
uint64
version_lowest_raw)
Sets the raw lowest version number from the hardware before converted to a string.
public
void
set_version_raw
(
uint64
version_raw)
Sets the raw version number from the hardware before converted to a string.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Fwupd.Codec
add_json
add_string
add_variant
array_from_variant
array_to_json
array_to_variant
from_json
from_json_string
from_variant
json_append
json_append_bool
json_append_int
json_append_map
json_append_strv
string_append
string_append_bool
string_append_hex
string_append_int
string_append_size
string_append_time
to_json
to_json_string
to_string
to_variant