Top | ![]() |
![]() |
![]() |
![]() |
#define | FWUPD_TYPE_CLIENT |
struct | FwupdClientClass |
enum | FwupdClientDownloadFlags |
enum | FwupdClientUploadFlags |
FwupdClient |
An object that allows client code to call the daemon methods synchronously.
See also: FwupdDevice
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.
Since: 0.7.1
GPtrArray * fwupd_client_get_devices (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets all the devices registered with the daemon.
Since: 0.9.2
GPtrArray * fwupd_client_get_history (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets all the history.
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
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
filename |
the firmware filename, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.0.0
gboolean fwupd_client_verify (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Verify a specific device.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 0.7.0
gboolean fwupd_client_modify_config (FwupdClient *client
,const gchar *key
,const gchar *value
,GCancellable *cancellable
,GError **error
);
Modifies a daemon config option. The daemon will only respond to this request with proper permissions
client |
||
key |
key, e.g. |
|
value |
value, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.2.8
gboolean fwupd_client_activate (FwupdClient *client
,GCancellable *cancellable
,const gchar *device_id
,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.
client |
||
cancellable |
the GCancellable, or |
|
device_id |
a device |
|
error |
the GError, or |
Since: 1.2.6
gboolean fwupd_client_clear_results (FwupdClient *client
,const gchar *device_id
,GCancellable *cancellable
,GError **error
);
Clears the results for a specific device.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 0.9.3
GPtrArray * fwupd_client_get_devices_by_guid (FwupdClient *client
,const gchar *guid
,GCancellable *cancellable
,GError **error
);
Gets any devices that provide a specific GUID. An error is returned if no devices contains this GUID.
client |
||
guid |
the GUID, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.1
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.
client |
||
device_id |
the device ID |
|
filename |
the filename to install |
|
install_flags |
the FwupdInstallFlags, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 0.7.0
gboolean fwupd_client_install_bytes (FwupdClient *client
,const gchar *device_id
,GBytes *bytes
,FwupdInstallFlags install_flags
,GCancellable *cancellable
,GError **error
);
Install firmware onto a specific device.
client |
||
device_id |
the device ID |
|
bytes |
GBytes |
|
install_flags |
the FwupdInstallFlags, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.5
gboolean fwupd_client_install_release (FwupdClient *client
,FwupdDevice *device
,FwupdRelease *release
,FwupdInstallFlags install_flags
,GCancellable *cancellable
,GError **error
);
Installs a new release on a device, downloading the firmware if required.
client |
||
device |
||
release |
||
install_flags |
the FwupdInstallFlags, e.g. |
|
cancellable |
A GCancellable, or |
|
error |
A GError, or |
Since: 1.4.5
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.
client |
||
remote_id |
the remote ID, e.g. |
|
metadata_fn |
the XML metadata filename |
|
signature_fn |
the GPG signature file |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.0.0
gboolean fwupd_client_update_metadata_bytes (FwupdClient *client
,const gchar *remote_id
,GBytes *metadata
,GBytes *signature
,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.
client |
||
remote_id |
remote ID, e.g. |
|
metadata |
XML metadata data |
|
signature |
signature data |
|
cancellable |
GCancellable, or |
|
error |
the GError, or |
Since: 1.4.5
gboolean fwupd_client_refresh_remote (FwupdClient *client
,FwupdRemote *remote
,GCancellable *cancellable
,GError **error
);
Refreshes a remote by downloading new metadata.
Since: 1.4.5
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.
client |
||
remote_id |
the remote ID, e.g. |
|
key |
the key, e.g. |
|
value |
the key, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
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.
client |
||
device_id |
the device ID |
|
key |
the key, e.g. |
|
value |
the key, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.0.4
FwupdStatus
fwupd_client_get_status (FwupdClient *client
);
Gets the last returned status value.
Since: 0.7.3
gboolean
fwupd_client_get_tainted (FwupdClient *client
);
Gets if the daemon has been tainted by 3rd party code.
Since: 1.2.4
gboolean
fwupd_client_get_daemon_interactive (FwupdClient *client
);
Gets if the daemon is running in an interactive terminal.
Since: 1.3.4
guint
fwupd_client_get_percentage (FwupdClient *client
);
Gets the last returned percentage value.
Since: 0.7.3
const gchar *
fwupd_client_get_daemon_version (FwupdClient *client
);
Gets the daemon version number.
Since: 0.9.6
const gchar *
fwupd_client_get_host_product (FwupdClient *client
);
Gets the string that represents the host running fwupd
Since: 1.3.1
const gchar *
fwupd_client_get_host_machine_id (FwupdClient *client
);
Gets the string that represents the host machine ID
Since: 1.3.2
GPtrArray * fwupd_client_get_remotes (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets the list of remotes that have been configured for the system.
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.
client |
||
remote_id |
the remote ID, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 0.9.3
gchar ** fwupd_client_get_approved_firmware (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets the list of approved firmware.
Since: 1.2.6
gboolean fwupd_client_set_approved_firmware (FwupdClient *client
,gchar **checksums
,GCancellable *cancellable
,GError **error
);
Sets the list of approved firmware.
client |
||
checksums |
Array of checksums |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.2.6
gchar ** fwupd_client_get_blocked_firmware (FwupdClient *client
,GCancellable *cancellable
,GError **error
);
Gets the list of blocked firmware.
Since: 1.4.6
gboolean fwupd_client_set_blocked_firmware (FwupdClient *client
,gchar **checksums
,GCancellable *cancellable
,GError **error
);
Sets the list of blocked firmware.
client |
||
checksums |
Array of checksums |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.6
gchar * fwupd_client_self_sign (FwupdClient *client
,const gchar *value
,FwupdSelfSignFlags flags
,GCancellable *cancellable
,GError **error
);
Signs the data using the client self-signed certificate.
client |
||
value |
A string to sign, typically a JSON blob |
|
flags |
||
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.2.6
gboolean fwupd_client_set_feature_flags (FwupdClient *client
,FwupdFeatureFlags feature_flags
,GCancellable *cancellable
,GError **error
);
Sets the features the client supports. This allows firmware to depend on specific front-end features, for instance showing the user an image on how to detach the hardware.
Clients can call this none or multiple times.
client |
||
feature_flags |
FwupdFeatureFlags, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.5
void fwupd_client_set_user_agent (FwupdClient *client
,const gchar *user_agent
);
Manually sets the user agent that is used for downloading. The user agent should contain the runtime version of fwupd somewhere in the provided string.
Since: 1.4.5
void fwupd_client_set_user_agent_for_package (FwupdClient *client
,const gchar *package_name
,const gchar *package_version
);
Builds a user-agent to use for the download.
Supplying harmless details to the server means it knows more about each client. This allows the web service to respond in a different way, for instance sending a different metadata file for old versions of fwupd, or returning an error for Solaris machines.
Before freaking out about theoretical privacy implications, much more data than this is sent to each and every website you visit.
client |
||
package_name |
client program name, e.g. "gnome-software" |
|
package_version |
client program version, e.g. "3.28.1" |
Since: 1.4.5
GBytes * fwupd_client_download_bytes (FwupdClient *client
,const gchar *url
,FwupdClientDownloadFlags flags
,GCancellable *cancellable
,GError **error
);
Downloads data from a remote server. The fwupd_client_set_user_agent()
function
should be called before this method is used.
client |
||
url |
the remote URL |
|
flags |
FwupdClientDownloadFlags, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.5
GBytes * fwupd_client_upload_bytes (FwupdClient *client
,const gchar *url
,const gchar *payload
,const gchar *signature
,FwupdClientUploadFlags flags
,GCancellable *cancellable
,GError **error
);
Uploads data to a remote server. The fwupd_client_set_user_agent()
function
should be called before this method is used.
client |
||
url |
the remote URL |
|
payload |
payload string |
|
signature |
signature string. |
[nullable] |
flags |
FwupdClientDownloadFlags, e.g. |
|
cancellable |
the GCancellable, or |
|
error |
the GError, or |
Since: 1.4.5
gboolean fwupd_client_ensure_networking (FwupdClient *client
,GError **error
);
Sets up the client networking support ready for use. Most other download and upload methods call this automatically, and do you only need to call this if the session is being used outside the FwupdClient.
Since: 1.4.5
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); };