fwupd-client-sync

fwupd-client-sync

Functions

gboolean fwupd_client_connect ()
GPtrArray * fwupd_client_get_devices ()
GPtrArray * fwupd_client_get_plugins ()
GPtrArray * fwupd_client_get_history ()
GPtrArray * fwupd_client_get_releases ()
GPtrArray * fwupd_client_get_downgrades ()
GPtrArray * fwupd_client_get_upgrades ()
GPtrArray * fwupd_client_get_details ()
GPtrArray * fwupd_client_get_details_bytes ()
gboolean fwupd_client_verify ()
gboolean fwupd_client_verify_update ()
gboolean fwupd_client_unlock ()
gboolean fwupd_client_modify_config ()
gboolean fwupd_client_activate ()
gboolean fwupd_client_clear_results ()
FwupdDevice * fwupd_client_get_results ()
GPtrArray * fwupd_client_get_host_security_attrs ()
FwupdDevice * fwupd_client_get_device_by_id ()
GPtrArray * fwupd_client_get_devices_by_guid ()
gboolean fwupd_client_install ()
gboolean fwupd_client_install_bytes ()
gboolean fwupd_client_install_release ()
gboolean fwupd_client_install_release2 ()
gboolean fwupd_client_update_metadata ()
gboolean fwupd_client_update_metadata_bytes ()
gboolean fwupd_client_refresh_remote ()
gboolean fwupd_client_modify_remote ()
gboolean fwupd_client_modify_device ()
GHashTable * fwupd_client_get_report_metadata ()
GPtrArray * fwupd_client_get_remotes ()
FwupdRemote * fwupd_client_get_remote_by_id ()
gchar ** fwupd_client_get_approved_firmware ()
gboolean fwupd_client_set_approved_firmware ()
gchar ** fwupd_client_get_blocked_firmware ()
gboolean fwupd_client_set_blocked_firmware ()
gchar * fwupd_client_self_sign ()
gboolean fwupd_client_set_feature_flags ()
GBytes * fwupd_client_download_bytes ()
gboolean fwupd_client_download_file ()
GBytes * fwupd_client_upload_bytes ()

Description

Functions

fwupd_client_connect ()

gboolean
fwupd_client_connect (FwupdClient *self,
                      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.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 0.7.1


fwupd_client_get_devices ()

GPtrArray *
fwupd_client_get_devices (FwupdClient *self,
                          GCancellable *cancellable,
                          GError **error);

Gets all the devices registered with the daemon.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdDevice][transfer container]

Since: 0.9.2


fwupd_client_get_plugins ()

GPtrArray *
fwupd_client_get_plugins (FwupdClient *self,
                          GCancellable *cancellable,
                          GError **error);

Gets all the plugins being used the daemon.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdPlugin][transfer container]

Since: 1.5.0


fwupd_client_get_history ()

GPtrArray *
fwupd_client_get_history (FwupdClient *self,
                          GCancellable *cancellable,
                          GError **error);

Gets all the history.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdDevice][transfer container]

Since: 1.0.4


fwupd_client_get_releases ()

GPtrArray *
fwupd_client_get_releases (FwupdClient *self,
                           const gchar *device_id,
                           GCancellable *cancellable,
                           GError **error);

Gets all the releases for a specific device

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 0.9.3


fwupd_client_get_downgrades ()

GPtrArray *
fwupd_client_get_downgrades (FwupdClient *self,
                             const gchar *device_id,
                             GCancellable *cancellable,
                             GError **error);

Gets all the downgrades for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 0.9.8


fwupd_client_get_upgrades ()

GPtrArray *
fwupd_client_get_upgrades (FwupdClient *self,
                           const gchar *device_id,
                           GCancellable *cancellable,
                           GError **error);

Gets all the upgrades for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 0.9.8


fwupd_client_get_details ()

GPtrArray *
fwupd_client_get_details (FwupdClient *self,
                          const gchar *filename,
                          GCancellable *cancellable,
                          GError **error);

Gets details about a specific firmware file.

Parameters

self

A FwupdClient

 

filename

the firmware filename, e.g. firmware.cab

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

an array of results.

[transfer container][element-type FwupdDevice]

Since: 1.0.0


fwupd_client_get_details_bytes ()

GPtrArray *
fwupd_client_get_details_bytes (FwupdClient *self,
                                GBytes *bytes,
                                GCancellable *cancellable,
                                GError **error);

Gets details about a specific firmware file.

Parameters

self

A FwupdClient

 

bytes

the firmware blob, e.g. the contents of firmware.cab

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

an array of results.

[transfer container][element-type FwupdDevice]

Since: 1.5.0


fwupd_client_verify ()

gboolean
fwupd_client_verify (FwupdClient *self,
                     const gchar *device_id,
                     GCancellable *cancellable,
                     GError **error);

Verify a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for verification success

Since: 0.7.0


fwupd_client_verify_update ()

gboolean
fwupd_client_verify_update (FwupdClient *self,
                            const gchar *device_id,
                            GCancellable *cancellable,
                            GError **error);

Update the verification record for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for verification success

Since: 0.8.0


fwupd_client_unlock ()

gboolean
fwupd_client_unlock (FwupdClient *self,
                     const gchar *device_id,
                     GCancellable *cancellable,
                     GError **error);

Unlocks a specific device so firmware can be read or wrote.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 0.7.0


fwupd_client_modify_config ()

gboolean
fwupd_client_modify_config (FwupdClient *self,
                            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

Parameters

self

A FwupdClient

 

key

key, e.g. DisabledPlugins

 

value

value, e.g. *

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.2.8


fwupd_client_activate ()

gboolean
fwupd_client_activate (FwupdClient *self,
                       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.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

device_id

a device

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.2.6


fwupd_client_clear_results ()

gboolean
fwupd_client_clear_results (FwupdClient *self,
                            const gchar *device_id,
                            GCancellable *cancellable,
                            GError **error);

Clears the results for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 0.7.0


fwupd_client_get_results ()

FwupdDevice *
fwupd_client_get_results (FwupdClient *self,
                          const gchar *device_id,
                          GCancellable *cancellable,
                          GError **error);

Gets the results of a previous firmware update for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a FwupdDevice, or NULL for failure.

[transfer full]

Since: 0.7.0


fwupd_client_get_host_security_attrs ()

GPtrArray *
fwupd_client_get_host_security_attrs (FwupdClient *self,
                                      GCancellable *cancellable,
                                      GError **error);

Gets all the host security attributes from the daemon.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

attributes.

[element-type FwupdSecurityAttr][transfer container]

Since: 1.5.0


fwupd_client_get_device_by_id ()

FwupdDevice *
fwupd_client_get_device_by_id (FwupdClient *self,
                               const gchar *device_id,
                               GCancellable *cancellable,
                               GError **error);

Gets a device by it's device ID.

Parameters

self

A FwupdClient

 

device_id

the device ID, e.g. usb:00:01:03:03

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a FwupdDevice or NULL.

[transfer full]

Since: 0.9.3


fwupd_client_get_devices_by_guid ()

GPtrArray *
fwupd_client_get_devices_by_guid (FwupdClient *self,
                                  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.

Parameters

self

A FwupdClient

 

guid

the GUID, e.g. e22c4520-43dc-5bb3-8245-5787fead9b63

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

devices or NULL.

[element-type FwupdDevice][transfer container]

Since: 1.4.1


fwupd_client_install ()

gboolean
fwupd_client_install (FwupdClient *self,
                      const gchar *device_id,
                      const gchar *filename,
                      FwupdInstallFlags install_flags,
                      GCancellable *cancellable,
                      GError **error);

Install a file onto a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

filename

the filename to install

 

install_flags

the FwupdInstallFlags, e.g. FWUPD_INSTALL_FLAG_ALLOW_REINSTALL

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 0.7.0


fwupd_client_install_bytes ()

gboolean
fwupd_client_install_bytes (FwupdClient *self,
                            const gchar *device_id,
                            GBytes *bytes,
                            FwupdInstallFlags install_flags,
                            GCancellable *cancellable,
                            GError **error);

Install firmware onto a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

bytes

GBytes

 

install_flags

the FwupdInstallFlags, e.g. FWUPD_INSTALL_FLAG_ALLOW_REINSTALL

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5


fwupd_client_install_release ()

gboolean
fwupd_client_install_release (FwupdClient *self,
                              FwupdDevice *device,
                              FwupdRelease *release,
                              FwupdInstallFlags install_flags,
                              GCancellable *cancellable);

fwupd_client_install_release has been deprecated since version 1.5.6 and should not be used in newly-written code.

Installs a new release on a device, downloading the firmware if required.

Parameters

self

A FwupdClient

 

device

A FwupdDevice

 

release

A FwupdRelease

 

install_flags

the FwupdInstallFlags, e.g. FWUPD_INSTALL_FLAG_ALLOW_REINSTALL

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5


fwupd_client_install_release2 ()

gboolean
fwupd_client_install_release2 (FwupdClient *self,
                               FwupdDevice *device,
                               FwupdRelease *release,
                               FwupdInstallFlags install_flags,
                               FwupdClientDownloadFlags download_flags,
                               GCancellable *cancellable,
                               GError **error);

Installs a new release on a device, downloading the firmware if required.

Parameters

self

A FwupdClient

 

device

A FwupdDevice

 

release

A FwupdRelease

 

install_flags

the FwupdInstallFlags, e.g. FWUPD_INSTALL_FLAG_ALLOW_REINSTALL

 

download_flags

the FwupdClientDownloadFlags, e.g. FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.6


fwupd_client_update_metadata ()

gboolean
fwupd_client_update_metadata (FwupdClient *self,
                              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.

Parameters

self

A FwupdClient

 

remote_id

the remote ID, e.g. lvfs-testing

 

metadata_fn

the XML metadata filename

 

signature_fn

the GPG signature file

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.0.0


fwupd_client_update_metadata_bytes ()

gboolean
fwupd_client_update_metadata_bytes (FwupdClient *self,
                                    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.

Parameters

self

A FwupdClient

 

remote_id

remote ID, e.g. lvfs-testing

 

metadata

XML metadata data

 

signature

signature data

 

cancellable

GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5


fwupd_client_refresh_remote ()

gboolean
fwupd_client_refresh_remote (FwupdClient *self,
                             FwupdRemote *remote,
                             GCancellable *cancellable,
                             GError **error);

Refreshes a remote by downloading new metadata.

Parameters

self

A FwupdClient

 

remote

A FwupdRemote

 

cancellable

A GCancellable, or NULL

 

error

A GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5


fwupd_client_modify_remote ()

gboolean
fwupd_client_modify_remote (FwupdClient *self,
                            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.

Parameters

self

A FwupdClient

 

remote_id

the remote ID, e.g. lvfs-testing

 

key

the key, e.g. Enabled

 

value

the key, e.g. true

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 0.9.8


fwupd_client_modify_device ()

gboolean
fwupd_client_modify_device (FwupdClient *self,
                            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.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

key

the key, e.g. Flags

 

value

the key, e.g. reported

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.0.4


fwupd_client_get_report_metadata ()

GHashTable *
fwupd_client_get_report_metadata (FwupdClient *self,
                                  GCancellable *cancellable,
                                  GError **error);

Gets all the report metadata from the daemon.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

attributes.

[transfer container]

Since: 1.5.0


fwupd_client_get_remotes ()

GPtrArray *
fwupd_client_get_remotes (FwupdClient *self,
                          GCancellable *cancellable,
                          GError **error);

Gets the list of remotes that have been configured for the system.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

list of remotes, or NULL.

[element-type FwupdRemote][transfer container]

Since: 0.9.3


fwupd_client_get_remote_by_id ()

FwupdRemote *
fwupd_client_get_remote_by_id (FwupdClient *self,
                               const gchar *remote_id,
                               GCancellable *cancellable,
                               GError **error);

Gets a specific remote that has been configured for the system.

Parameters

self

A FwupdClient

 

remote_id

the remote ID, e.g. lvfs-testing

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a FwupdRemote, or NULL if not found.

[transfer full]

Since: 0.9.3


fwupd_client_get_approved_firmware ()

gchar **
fwupd_client_get_approved_firmware (FwupdClient *self,
                                    GCancellable *cancellable,
                                    GError **error);

Gets the list of approved firmware.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

checksums, or NULL for error.

[transfer full]

Since: 1.2.6


fwupd_client_set_approved_firmware ()

gboolean
fwupd_client_set_approved_firmware (FwupdClient *self,
                                    gchar **checksums,
                                    GCancellable *cancellable,
                                    GError **error);

Sets the list of approved firmware.

Parameters

self

A FwupdClient

 

checksums

Array of checksums

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.2.6


fwupd_client_get_blocked_firmware ()

gchar **
fwupd_client_get_blocked_firmware (FwupdClient *self,
                                   GCancellable *cancellable,
                                   GError **error);

Gets the list of blocked firmware.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

checksums, or NULL for error.

[transfer full]

Since: 1.4.6


fwupd_client_set_blocked_firmware ()

gboolean
fwupd_client_set_blocked_firmware (FwupdClient *self,
                                   gchar **checksums,
                                   GCancellable *cancellable,
                                   GError **error);

Sets the list of approved firmware.

Parameters

self

A FwupdClient

 

checksums

Array of checksums

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.6


fwupd_client_self_sign ()

gchar *
fwupd_client_self_sign (FwupdClient *self,
                        const gchar *value,
                        FwupdSelfSignFlags flags,
                        GCancellable *cancellable,
                        GError **error);

Signs the data using the client self-signed certificate.

Parameters

self

A FwupdClient

 

value

A string to sign, typically a JSON blob

 

flags

FwupdSelfSignFlags, e.g. FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a signature, or NULL for failure

Since: 1.2.6


fwupd_client_set_feature_flags ()

gboolean
fwupd_client_set_feature_flags (FwupdClient *self,
                                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.

Parameters

self

A FwupdClient

 

feature_flags

FwupdFeatureFlags, e.g. FWUPD_FEATURE_FLAG_UPDATE_TEXT

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5


fwupd_client_download_bytes ()

GBytes *
fwupd_client_download_bytes (FwupdClient *self,
                             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.

Parameters

self

A FwupdClient

 

url

the remote URL

 

flags

FwupdClientDownloadFlags, e.g. FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

downloaded data, or NULL for error.

[transfer full]

Since: 1.4.5


fwupd_client_download_file ()

gboolean
fwupd_client_download_file (FwupdClient *self,
                            const gchar *url,
                            GFile *file,
                            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.

Parameters

self

A FwupdClient

 

url

the remote URL

 

file

a GFile

 

flags

FwupdClientDownloadFlags, e.g. FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

TRUE if the file was written, or NULL for error

Since: 1.5.2


fwupd_client_upload_bytes ()

GBytes *
fwupd_client_upload_bytes (FwupdClient *self,
                           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.

Parameters

self

A FwupdClient

 

url

the remote URL

 

payload

payload string

 

signature

signature string.

[nullable]

flags

FwupdClientDownloadFlags, e.g. FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

response data, or NULL for error.

[transfer full]

Since: 1.4.5

Types and Values