![]() |
![]() |
![]() |
fwupd Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define FWUPD_TYPE_CLIENT struct FwupdClientClass; FwupdClient * fwupd_client_new (void
); gboolean fwupd_client_connect (FwupdClient *client
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_devices (FwupdClient *client
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_history (FwupdClient *client
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_releases (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_downgrades (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_upgrades (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); GPtrArray * fwupd_client_get_details (FwupdClient *client
,const gchar *filename
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_verify (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_verify_update (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_unlock (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_clear_results (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); FwupdDevice * fwupd_client_get_results (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); FwupdDevice * fwupd_client_get_device_by_id (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_install (FwupdClient *client
,const gchar *device_id
,const gchar *filename
,FwupdInstallFlags install_flags
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_update_metadata (FwupdClient *client
,const gchar *remote_id
,const gchar *metadata_fn
,const gchar *signature_fn
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_modify_remote (FwupdClient *client
,const gchar *remote_id
,const gchar *key
,const gchar *value
,GCancellable *cancellable
,GError **error
); gboolean fwupd_client_modify_device (FwupdClient *client
,const gchar *device_id
,const gchar *key
,const gchar *value
,GCancellable *cancellable
,GError **error
); FwupdStatus fwupd_client_get_status (FwupdClient *client
); guint fwupd_client_get_percentage (FwupdClient *client
); const gchar * fwupd_client_get_daemon_version (FwupdClient *client
); GPtrArray * fwupd_client_get_remotes (FwupdClient *client
,GCancellable *cancellable
,GError **error
); FwupdRemote * fwupd_client_get_remote_by_id (FwupdClient *client
,const gchar *remote_id
,GCancellable *cancellable
,GError **error
);
An object that allows client code to call the daemon methods synchronously.
See also: FwupdDevice
struct FwupdClientClass { GObjectClass parent_class; void (*changed) (FwupdClient *client); void (*status_changed) (FwupdClient *client, FwupdStatus status); void (*device_added) (FwupdClient *client, FwupdDevice *result); void (*device_removed) (FwupdClient *client, FwupdDevice *result); void (*device_changed) (FwupdClient *client, FwupdDevice *result); };
FwupdClient * fwupd_client_new (void
);
Creates a new client.
Returns : |
a new FwupdClient |
Since 0.7.0
gboolean fwupd_client_connect (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Sets up the client ready for use. Most other methods call this for you, and do you only need to call this if you are just watching the client.
|
A FwupdClient |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 0.7.1
GPtrArray * fwupd_client_get_devices (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets all the devices registered with the daemon.
|
A FwupdClient |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
results. [element-type FwupdDevice][transfer container] |
Since 0.9.2
GPtrArray * fwupd_client_get_history (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets all the history.
|
A FwupdClient |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
results. [element-type FwupdDevice][transfer container] |
Since 1.0.4
GPtrArray * fwupd_client_get_releases (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Gets all the releases for a specific device
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
results. [element-type FwupdRelease][transfer container] |
Since 0.9.3
GPtrArray * fwupd_client_get_downgrades (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Gets all the downgrades for a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
results. [element-type FwupdRelease][transfer container] |
Since 0.9.8
GPtrArray * fwupd_client_get_upgrades (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Gets all the upgrades for a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
results. [element-type FwupdRelease][transfer container] |
Since 0.9.8
GPtrArray * fwupd_client_get_details (FwupdClient *client
,const gchar *filename
,GCancellable *cancellable
,GError **error
);
Gets details about a specific firmware file.
|
A FwupdClient |
|
the firmware filename, e.g. `firmware.cab` |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
an array of results. [transfer container][element-type FwupdDevice] |
Since 1.0.0
gboolean fwupd_client_verify (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Verify a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for verification success |
Since 0.7.0
gboolean fwupd_client_verify_update (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Update the verification record for a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for verification success |
Since 0.8.0
gboolean fwupd_client_unlock (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Unlocks a specific device so firmware can be read or wrote.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 0.7.0
gboolean fwupd_client_clear_results (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Clears the results for a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 0.7.0
FwupdDevice * fwupd_client_get_results (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Gets the results of a previous firmware update for a specific device.
|
A FwupdClient |
|
the device ID |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
a FwupdDevice, or NULL for failure. [transfer full]
|
Since 0.7.0
FwupdDevice * fwupd_client_get_device_by_id (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Gets a device by it's device ID.
|
A FwupdClient |
|
the device ID, e.g. `usb:00:01:03:03` |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
a FwupdDevice or NULL . [transfer full]
|
Since 0.9.3
gboolean fwupd_client_install (FwupdClient *client
,const gchar *device_id
,const gchar *filename
,FwupdInstallFlags install_flags
,GCancellable *cancellable
,GError **error
);
Install a file onto a specific device.
|
A FwupdClient |
|
the device ID |
|
the filename to install |
|
the FwupdInstallFlags, e.g. FWUPD_INSTALL_FLAG_ALLOW_REINSTALL
|
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 0.7.0
gboolean fwupd_client_update_metadata (FwupdClient *client
,const gchar *remote_id
,const gchar *metadata_fn
,const gchar *signature_fn
,GCancellable *cancellable
,GError **error
);
Updates the metadata. This allows a session process to download the metadata and metadata signing file to be passed into the daemon to be checked and parsed.
The remote_id
allows the firmware to be tagged so that the remote can be
matched when the firmware is downloaded.
|
A FwupdClient |
|
the remote ID, e.g. `lvfs-testing` |
|
the XML metadata filename |
|
the GPG signature file |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 1.0.0
gboolean fwupd_client_modify_remote (FwupdClient *client
,const gchar *remote_id
,const gchar *key
,const gchar *value
,GCancellable *cancellable
,GError **error
);
Modifies a system remote in a specific way.
NOTE: User authentication may be required to complete this action.
|
A FwupdClient |
|
the remote ID, e.g. `lvfs-testing` |
|
the key, e.g. `Enabled` |
|
the key, e.g. `true` |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 0.9.8
gboolean fwupd_client_modify_device (FwupdClient *client
,const gchar *device_id
,const gchar *key
,const gchar *value
,GCancellable *cancellable
,GError **error
);
Modifies a device in a specific way. Not all properties on the FwupdDevice
are settable by the client, and some may have other restrictions on value
.
NOTE: User authentication may be required to complete this action.
|
A FwupdClient |
|
the device ID |
|
the key, e.g. `Flags` |
|
the key, e.g. `reported` |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
TRUE for success |
Since 1.0.4
FwupdStatus fwupd_client_get_status (FwupdClient *client
);
Gets the last returned status value.
|
A FwupdClient |
Returns : |
a FwupdStatus, or FWUPD_STATUS_UNKNOWN for unknown. |
Since 0.7.3
guint fwupd_client_get_percentage (FwupdClient *client
);
Gets the last returned percentage value.
|
A FwupdClient |
Returns : |
a percentage, or 0 for unknown. |
Since 0.7.3
const gchar * fwupd_client_get_daemon_version (FwupdClient *client
);
Gets the daemon version number.
|
A FwupdClient |
Returns : |
a string, or NULL for unknown. |
Since 0.9.6
GPtrArray * fwupd_client_get_remotes (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets the list of remotes that have been configured for the system.
|
A FwupdClient |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
list of remotes, or NULL . [element-type FwupdRemote][transfer container]
|
Since 0.9.3
FwupdRemote * fwupd_client_get_remote_by_id (FwupdClient *client
,const gchar *remote_id
,GCancellable *cancellable
,GError **error
);
Gets a specific remote that has been configured for the system.
|
A FwupdClient |
|
the remote ID, e.g. `lvfs-testing` |
|
the GCancellable, or NULL
|
|
the GError, or NULL
|
Returns : |
a FwupdRemote, or NULL if not found. [transfer full]
|
Since 0.9.3