FwupdClient

FwupdClient — a way of interfacing with the daemon

Functions

FwupdClient * fwupd_client_new ()
GMainContext * fwupd_client_get_main_context ()
void fwupd_client_set_main_context ()
void fwupd_client_connect_async ()
gboolean fwupd_client_connect_finish ()
void fwupd_client_get_devices_async ()
GPtrArray * fwupd_client_get_devices_finish ()
void fwupd_client_get_plugins_async ()
GPtrArray * fwupd_client_get_plugins_finish ()
void fwupd_client_get_history_async ()
GPtrArray * fwupd_client_get_history_finish ()
void fwupd_client_get_releases_async ()
GPtrArray * fwupd_client_get_releases_finish ()
void fwupd_client_get_downgrades_async ()
GPtrArray * fwupd_client_get_downgrades_finish ()
void fwupd_client_get_upgrades_async ()
GPtrArray * fwupd_client_get_upgrades_finish ()
void fwupd_client_get_details_bytes_async ()
GPtrArray * fwupd_client_get_details_bytes_finish ()
void fwupd_client_verify_async ()
gboolean fwupd_client_verify_finish ()
void fwupd_client_verify_update_async ()
gboolean fwupd_client_verify_update_finish ()
void fwupd_client_unlock_async ()
gboolean fwupd_client_unlock_finish ()
void fwupd_client_modify_config_async ()
gboolean fwupd_client_modify_config_finish ()
void fwupd_client_activate_async ()
gboolean fwupd_client_activate_finish ()
void fwupd_client_clear_results_async ()
gboolean fwupd_client_clear_results_finish ()
void fwupd_client_get_results_async ()
FwupdDevice * fwupd_client_get_results_finish ()
void fwupd_client_get_host_security_attrs_async ()
GPtrArray * fwupd_client_get_host_security_attrs_finish ()
void fwupd_client_get_device_by_id_async ()
FwupdDevice * fwupd_client_get_device_by_id_finish ()
void fwupd_client_get_devices_by_guid_async ()
GPtrArray * fwupd_client_get_devices_by_guid_finish ()
void fwupd_client_install_async ()
gboolean fwupd_client_install_finish ()
void fwupd_client_install_bytes_async ()
gboolean fwupd_client_install_bytes_finish ()
void fwupd_client_install_release_async ()
void fwupd_client_install_release2_async ()
gboolean fwupd_client_install_release_finish ()
void fwupd_client_update_metadata_bytes_async ()
gboolean fwupd_client_update_metadata_bytes_finish ()
void fwupd_client_refresh_remote_async ()
gboolean fwupd_client_refresh_remote_finish ()
void fwupd_client_modify_remote_async ()
gboolean fwupd_client_modify_remote_finish ()
void fwupd_client_modify_device_async ()
gboolean fwupd_client_modify_device_finish ()
void fwupd_client_get_report_metadata_async ()
GHashTable * fwupd_client_get_report_metadata_finish ()
FwupdStatus fwupd_client_get_status ()
gboolean fwupd_client_get_tainted ()
gboolean fwupd_client_get_daemon_interactive ()
guint fwupd_client_get_percentage ()
const gchar * fwupd_client_get_daemon_version ()
const gchar * fwupd_client_get_host_product ()
const gchar * fwupd_client_get_host_machine_id ()
const gchar * fwupd_client_get_host_security_id ()
void fwupd_client_get_remotes_async ()
GPtrArray * fwupd_client_get_remotes_finish ()
void fwupd_client_get_remote_by_id_async ()
FwupdRemote * fwupd_client_get_remote_by_id_finish ()
void fwupd_client_get_approved_firmware_async ()
GPtrArray * fwupd_client_get_approved_firmware_finish ()
void fwupd_client_set_approved_firmware_async ()
gboolean fwupd_client_set_approved_firmware_finish ()
void fwupd_client_get_blocked_firmware_async ()
GPtrArray * fwupd_client_get_blocked_firmware_finish ()
void fwupd_client_set_blocked_firmware_async ()
gboolean fwupd_client_set_blocked_firmware_finish ()
void fwupd_client_self_sign_async ()
gchar * fwupd_client_self_sign_finish ()
void fwupd_client_set_feature_flags_async ()
gboolean fwupd_client_set_feature_flags_finish ()
const gchar * fwupd_client_get_user_agent ()
void fwupd_client_set_user_agent ()
void fwupd_client_set_user_agent_for_package ()
void fwupd_client_download_bytes_async ()
GBytes * fwupd_client_download_bytes_finish ()
void fwupd_client_upload_bytes_async ()
GBytes * fwupd_client_upload_bytes_finish ()
gboolean fwupd_client_ensure_networking ()

Types and Values

Description

An object that allows client code to call the daemon methods synchronously.

See also: FwupdDevice

Functions

fwupd_client_new ()

FwupdClient *
fwupd_client_new (void);

Creates a new client.

Returns

a new FwupdClient

Since: 0.7.0


fwupd_client_get_main_context ()

GMainContext *
fwupd_client_get_main_context (FwupdClient *self);

Gets the internal GMainContext to use for synchronous methods. By default the value is set a new GMainContext.

Parameters

self

A FwupdClient

 

Returns

the GMainContext.

[transfer full]

Since: 1.5.3


fwupd_client_set_main_context ()

void
fwupd_client_set_main_context (FwupdClient *self,
                               GMainContext *main_ctx);

Sets the internal GMainContext to use for returning progress signals.

Parameters

self

A FwupdClient

 

main_ctx

GMainContext or NULL to use the global default main context.

[nullable]

Since: 1.5.3


fwupd_client_connect_async ()

void
fwupd_client_connect_async (FwupdClient *self,
                            GCancellable *cancellable,
                            GAsyncReadyCallback callback,
                            gpointer callback_data);

Sets up the client ready for use. This is probably the first method you call when wanting to use libfwupd in an asynchronous manner.

Other methods such as fwupd_client_get_devices_async() should only be called after fwupd_client_connect_finish() has been called without an error.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_connect_finish ()

gboolean
fwupd_client_connect_finish (FwupdClient *self,
                             GAsyncResult *res,
                             GError **error);

Gets the result of fwupd_client_connect_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_get_devices_async ()

void
fwupd_client_get_devices_async (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets all the devices registered with the daemon.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_devices_finish ()

GPtrArray *
fwupd_client_get_devices_finish (FwupdClient *self,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result of fwupd_client_get_devices_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdDevice][transfer container]

Since: 1.5.0


fwupd_client_get_plugins_async ()

void
fwupd_client_get_plugins_async (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets all the plugins being used by the daemon.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_plugins_finish ()

GPtrArray *
fwupd_client_get_plugins_finish (FwupdClient *self,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result of fwupd_client_get_plugins_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdDevice][transfer container]

Since: 1.5.0


fwupd_client_get_history_async ()

void
fwupd_client_get_history_async (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets all the history.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_history_finish ()

GPtrArray *
fwupd_client_get_history_finish (FwupdClient *self,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result of fwupd_client_get_history_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdDevice][transfer container]

Since: 1.5.0


fwupd_client_get_releases_async ()

void
fwupd_client_get_releases_async (FwupdClient *self,
                                 const gchar *device_id,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer callback_data);

Gets all the releases for a specific device

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_releases_finish ()

GPtrArray *
fwupd_client_get_releases_finish (FwupdClient *self,
                                  GAsyncResult *res,
                                  GError **error);

Gets the result of fwupd_client_get_releases_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 1.5.0


fwupd_client_get_downgrades_async ()

void
fwupd_client_get_downgrades_async (FwupdClient *self,
                                   const gchar *device_id,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer callback_data);

Gets all the downgrades for a specific device.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_downgrades_finish ()

GPtrArray *
fwupd_client_get_downgrades_finish (FwupdClient *self,
                                    GAsyncResult *res,
                                    GError **error);

Gets the result of fwupd_client_get_downgrades_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 1.5.0


fwupd_client_get_upgrades_async ()

void
fwupd_client_get_upgrades_async (FwupdClient *self,
                                 const gchar *device_id,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer callback_data);

Gets all the upgrades for a specific device.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_upgrades_finish ()

GPtrArray *
fwupd_client_get_upgrades_finish (FwupdClient *self,
                                  GAsyncResult *res,
                                  GError **error);

Gets the result of fwupd_client_get_upgrades_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 1.5.0


fwupd_client_get_details_bytes_async ()

void
fwupd_client_get_details_bytes_async (FwupdClient *self,
                                      GBytes *bytes,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer callback_data);

Gets details about a specific firmware file.

Parameters

self

A FwupdClient

 

bytes

a GBytes for the firmware, e.g. firmware.cab

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_details_bytes_finish ()

GPtrArray *
fwupd_client_get_details_bytes_finish (FwupdClient *self,
                                       GAsyncResult *res,
                                       GError **error);

Gets the result of fwupd_client_get_details_bytes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

an array of results.

[transfer container][element-type FwupdDevice]

Since: 1.5.0


fwupd_client_verify_async ()

void
fwupd_client_verify_async (FwupdClient *self,
                           const gchar *device_id,
                           GCancellable *cancellable,
                           GAsyncReadyCallback callback,
                           gpointer callback_data);

Verify a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_verify_finish ()

gboolean
fwupd_client_verify_finish (FwupdClient *self,
                            GAsyncResult *res,
                            GError **error);

Gets the result of fwupd_client_verify_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_verify_update_async ()

void
fwupd_client_verify_update_async (FwupdClient *self,
                                  const gchar *device_id,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

Update the verification record for a specific device.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_verify_update_finish ()

gboolean
fwupd_client_verify_update_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_verify_update_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_unlock_async ()

void
fwupd_client_unlock_async (FwupdClient *self,
                           const gchar *device_id,
                           GCancellable *cancellable,
                           GAsyncReadyCallback callback,
                           gpointer callback_data);

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_unlock_finish ()

gboolean
fwupd_client_unlock_finish (FwupdClient *self,
                            GAsyncResult *res,
                            GError **error);

Gets the result of fwupd_client_unlock_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_modify_config_async ()

void
fwupd_client_modify_config_async (FwupdClient *self,
                                  const gchar *key,
                                  const gchar *value,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_modify_config_finish ()

gboolean
fwupd_client_modify_config_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_modify_config_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_activate_async ()

void
fwupd_client_activate_async (FwupdClient *self,
                             const gchar *device_id,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer callback_data);

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

 

device_id

a device

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_activate_finish ()

gboolean
fwupd_client_activate_finish (FwupdClient *self,
                              GAsyncResult *res,
                              GError **error);

Gets the result of fwupd_client_activate_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_clear_results_async ()

void
fwupd_client_clear_results_async (FwupdClient *self,
                                  const gchar *device_id,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

Clears the results for a specific device.

Parameters

self

A FwupdClient

 

device_id

a device

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_clear_results_finish ()

gboolean
fwupd_client_clear_results_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_clear_results_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_get_results_async ()

void
fwupd_client_get_results_async (FwupdClient *self,
                                const gchar *device_id,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

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

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_results_finish ()

FwupdDevice *
fwupd_client_get_results_finish (FwupdClient *self,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result of fwupd_client_get_results_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

a FwupdDevice, or NULL for failure.

[transfer full]

Since: 1.5.0


fwupd_client_get_host_security_attrs_async ()

void
fwupd_client_get_host_security_attrs_async
                               (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets all the host security attributes from the daemon.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_host_security_attrs_finish ()

GPtrArray *
fwupd_client_get_host_security_attrs_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_get_host_security_attrs_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

attributes.

[element-type FwupdSecurityAttr][transfer container]

Since: 1.5.0


fwupd_client_get_device_by_id_async ()

void
fwupd_client_get_device_by_id_async (FwupdClient *self,
                                     const gchar *device_id,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer callback_data);

Gets a device by it's device ID.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_device_by_id_finish ()

FwupdDevice *
fwupd_client_get_device_by_id_finish (FwupdClient *self,
                                      GAsyncResult *res,
                                      GError **error);

Gets the result of fwupd_client_get_device_by_id_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

a FwupdDevice, or NULL for failure.

[transfer full]

Since: 1.5.0


fwupd_client_get_devices_by_guid_async ()

void
fwupd_client_get_devices_by_guid_async
                               (FwupdClient *self,
                                const gchar *guid,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets any devices that provide a specific GUID. An error is returned if no devices contains this GUID.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

guid

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

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_devices_by_guid_finish ()

GPtrArray *
fwupd_client_get_devices_by_guid_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_get_devices_by_guid_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRelease][transfer container]

Since: 1.5.0


fwupd_client_install_async ()

void
fwupd_client_install_async (FwupdClient *self,
                            const gchar *device_id,
                            const gchar *filename,
                            FwupdInstallFlags install_flags,
                            GCancellable *cancellable,
                            GAsyncReadyCallback callback,
                            gpointer callback_data);

Install firmware onto a specific device.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_install_finish ()

gboolean
fwupd_client_install_finish (FwupdClient *self,
                             GAsyncResult *res,
                             GError **error);

Gets the result of fwupd_client_install_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_install_bytes_async ()

void
fwupd_client_install_bytes_async (FwupdClient *self,
                                  const gchar *device_id,
                                  GBytes *bytes,
                                  FwupdInstallFlags install_flags,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

Install firmware onto a specific device.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_install_bytes_finish ()

gboolean
fwupd_client_install_bytes_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_install_bytes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_install_release_async ()

void
fwupd_client_install_release_async (FwupdClient *self,
                                    FwupdDevice *device,
                                    FwupdRelease *release,
                                    FwupdInstallFlags install_flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer callback_data);

fwupd_client_install_release_async 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.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_install_release2_async ()

void
fwupd_client_install_release2_async (FwupdClient *self,
                                     FwupdDevice *device,
                                     FwupdRelease *release,
                                     FwupdInstallFlags install_flags,
                                     FwupdClientDownloadFlags download_flags,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer callback_data);

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

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

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_DISABLE_IPFS

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.6


fwupd_client_install_release_finish ()

gboolean
fwupd_client_install_release_finish (FwupdClient *self,
                                     GAsyncResult *res,
                                     GError **error);

Gets the result of fwupd_client_install_release_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_update_metadata_bytes_async ()

void
fwupd_client_update_metadata_bytes_async
                               (FwupdClient *self,
                                const gchar *remote_id,
                                GBytes *metadata,
                                GBytes *signature,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

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.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

Parameters

self

A FwupdClient

 

remote_id

remote ID, e.g. lvfs-testing

 

metadata

XML metadata data

 

signature

signature data

 

cancellable

GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_update_metadata_bytes_finish ()

gboolean
fwupd_client_update_metadata_bytes_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_update_metadata_bytes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_refresh_remote_async ()

void
fwupd_client_refresh_remote_async (FwupdClient *self,
                                   FwupdRemote *remote,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer callback_data);

Refreshes a remote by downloading new metadata.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

Parameters

self

A FwupdClient

 

remote

A FwupdRemote

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_refresh_remote_finish ()

gboolean
fwupd_client_refresh_remote_finish (FwupdClient *self,
                                    GAsyncResult *res,
                                    GError **error);

Gets the result of fwupd_client_refresh_remote_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_modify_remote_async ()

void
fwupd_client_modify_remote_async (FwupdClient *self,
                                  const gchar *remote_id,
                                  const gchar *key,
                                  const gchar *value,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

Modifies a system remote in a specific way.

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_modify_remote_finish ()

gboolean
fwupd_client_modify_remote_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_modify_remote_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_modify_device_async ()

void
fwupd_client_modify_device_async (FwupdClient *self,
                                  const gchar *device_id,
                                  const gchar *key,
                                  const gchar *value,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer callback_data);

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 .

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_modify_device_finish ()

gboolean
fwupd_client_modify_device_finish (FwupdClient *self,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result of fwupd_client_modify_device_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_get_report_metadata_async ()

void
fwupd_client_get_report_metadata_async
                               (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets all the report metadata from the daemon.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_report_metadata_finish ()

GHashTable *
fwupd_client_get_report_metadata_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_get_report_metadata_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

attributes.

[transfer container]

Since: 1.5.0


fwupd_client_get_status ()

FwupdStatus
fwupd_client_get_status (FwupdClient *self);

Gets the last returned status value.

Parameters

self

A FwupdClient

 

Returns

a FwupdStatus, or FWUPD_STATUS_UNKNOWN for unknown.

Since: 0.7.3


fwupd_client_get_tainted ()

gboolean
fwupd_client_get_tainted (FwupdClient *self);

Gets if the daemon has been tainted by 3rd party code.

Parameters

self

A FwupdClient

 

Returns

TRUE if the daemon is unsupported

Since: 1.2.4


fwupd_client_get_daemon_interactive ()

gboolean
fwupd_client_get_daemon_interactive (FwupdClient *self);

Gets if the daemon is running in an interactive terminal.

Parameters

self

A FwupdClient

 

Returns

TRUE if the daemon is running in an interactive terminal

Since: 1.3.4


fwupd_client_get_percentage ()

guint
fwupd_client_get_percentage (FwupdClient *self);

Gets the last returned percentage value.

Parameters

self

A FwupdClient

 

Returns

a percentage, or 0 for unknown.

Since: 0.7.3


fwupd_client_get_daemon_version ()

const gchar *
fwupd_client_get_daemon_version (FwupdClient *self);

Gets the daemon version number.

Parameters

self

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 0.9.6


fwupd_client_get_host_product ()

const gchar *
fwupd_client_get_host_product (FwupdClient *self);

Gets the string that represents the host running fwupd

Parameters

self

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 1.3.1


fwupd_client_get_host_machine_id ()

const gchar *
fwupd_client_get_host_machine_id (FwupdClient *self);

Gets the string that represents the host machine ID

Parameters

self

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 1.3.2


fwupd_client_get_host_security_id ()

const gchar *
fwupd_client_get_host_security_id (FwupdClient *self);

Gets the string that represents the host machine ID

Parameters

self

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 1.5.0


fwupd_client_get_remotes_async ()

void
fwupd_client_get_remotes_async (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

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

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_remotes_finish ()

GPtrArray *
fwupd_client_get_remotes_finish (FwupdClient *self,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result of fwupd_client_get_remotes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdRemote][transfer container]

Since: 1.5.0


fwupd_client_get_remote_by_id_async ()

void
fwupd_client_get_remote_by_id_async (FwupdClient *self,
                                     const gchar *remote_id,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer callback_data);

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_remote_by_id_finish ()

FwupdRemote *
fwupd_client_get_remote_by_id_finish (FwupdClient *self,
                                      GAsyncResult *res,
                                      GError **error);

Gets the result of fwupd_client_get_remote_by_id_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

a FwupdRemote, or NULL if not found.

[transfer full]

Since: 1.5.0


fwupd_client_get_approved_firmware_async ()

void
fwupd_client_get_approved_firmware_async
                               (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets the list of approved firmware.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_approved_firmware_finish ()

GPtrArray *
fwupd_client_get_approved_firmware_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_get_approved_firmware_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

checksums, or NULL for error.

[element-type utf8][transfer container]

Since: 1.5.0


fwupd_client_set_approved_firmware_async ()

void
fwupd_client_set_approved_firmware_async
                               (FwupdClient *self,
                                GPtrArray *checksums,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Sets the list of approved firmware.

Parameters

self

A FwupdClient

 

checksums

firmware checksums.

[element-type utf8]

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_set_approved_firmware_finish ()

gboolean
fwupd_client_set_approved_firmware_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_set_approved_firmware_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_get_blocked_firmware_async ()

void
fwupd_client_get_blocked_firmware_async
                               (FwupdClient *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Gets the list of blocked firmware.

You must have called fwupd_client_connect_async() on self before using this method.

Parameters

self

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_get_blocked_firmware_finish ()

GPtrArray *
fwupd_client_get_blocked_firmware_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_get_blocked_firmware_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

checksums, or NULL for error.

[element-type utf8][transfer container]

Since: 1.5.0


fwupd_client_set_blocked_firmware_async ()

void
fwupd_client_set_blocked_firmware_async
                               (FwupdClient *self,
                                GPtrArray *checksums,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer callback_data);

Sets the list of blocked firmware.

Parameters

self

A FwupdClient

 

checksums

firmware checksums.

[element-type utf8]

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_set_blocked_firmware_finish ()

gboolean
fwupd_client_set_blocked_firmware_finish
                               (FwupdClient *self,
                                GAsyncResult *res,
                                GError **error);

Gets the result of fwupd_client_set_blocked_firmware_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_self_sign_async ()

void
fwupd_client_self_sign_async (FwupdClient *self,
                              const gchar *value,
                              FwupdSelfSignFlags flags,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer callback_data);

Signs the data using the client self-signed certificate.

You must have called fwupd_client_connect_async() on self before using this method.

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_self_sign_finish ()

gchar *
fwupd_client_self_sign_finish (FwupdClient *self,
                               GAsyncResult *res,
                               GError **error);

Gets the result of fwupd_client_self_sign_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

a signature, or NULL for failure

Since: 1.5.0


fwupd_client_set_feature_flags_async ()

void
fwupd_client_set_feature_flags_async (FwupdClient *self,
                                      FwupdFeatureFlags feature_flags,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer callback_data);

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.

Parameters

self

A FwupdClient

 

feature_flags

FwupdFeatureFlags, e.g. FWUPD_FEATURE_FLAG_UPDATE_TEXT

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_set_feature_flags_finish ()

gboolean
fwupd_client_set_feature_flags_finish (FwupdClient *self,
                                       GAsyncResult *res,
                                       GError **error);

Gets the result of fwupd_client_set_feature_flags_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.5.0


fwupd_client_get_user_agent ()

const gchar *
fwupd_client_get_user_agent (FwupdClient *self);

Gets the string that represents the user agent that is used for uploading and downloading. The user agent will contain the runtime version of fwupd somewhere in the provided string.

Parameters

self

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 1.5.2


fwupd_client_set_user_agent ()

void
fwupd_client_set_user_agent (FwupdClient *self,
                             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.

Parameters

self

A FwupdClient

 

user_agent

the user agent ID, e.g. gnome-software/3.34.1

 

Since: 1.4.5


fwupd_client_set_user_agent_for_package ()

void
fwupd_client_set_user_agent_for_package
                               (FwupdClient *self,
                                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.

Parameters

self

A FwupdClient

 

package_name

client program name, e.g. "gnome-software"

 

package_version

client program version, e.g. "3.28.1"

 

Since: 1.4.5


fwupd_client_download_bytes_async ()

void
fwupd_client_download_bytes_async (FwupdClient *self,
                                   const gchar *url,
                                   FwupdClientDownloadFlags flags,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer callback_data);

Downloads data from a remote server. The fwupd_client_set_user_agent() function should be called before this method is used.

You must have called fwupd_client_connect_async() on self before using this method.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

Parameters

self

A FwupdClient

 

url

the remote URL

 

flags

FwupdClientDownloadFlags, e.g. FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

 

cancellable

the GCancellable, or NULL

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_download_bytes_finish ()

GBytes *
fwupd_client_download_bytes_finish (FwupdClient *self,
                                    GAsyncResult *res,
                                    GError **error);

Gets the result of fwupd_client_download_bytes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

downloaded data, or NULL for error.

[transfer full]

Since: 1.5.0


fwupd_client_upload_bytes_async ()

void
fwupd_client_upload_bytes_async (FwupdClient *self,
                                 const gchar *url,
                                 const gchar *payload,
                                 const gchar *signature,
                                 FwupdClientUploadFlags flags,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer callback_data);

Uploads data to a remote server. The fwupd_client_set_user_agent() function should be called before this method is used.

You must have called fwupd_client_connect_async() on self before using this method.

NOTE: This method is thread-safe, but progress signals will be emitted in the global default main context, if not explicitly set with fwupd_client_set_main_context().

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

 

callback

the function to run on completion

 

callback_data

the data to pass to callback

 

Since: 1.5.0


fwupd_client_upload_bytes_finish ()

GBytes *
fwupd_client_upload_bytes_finish (FwupdClient *self,
                                  GAsyncResult *res,
                                  GError **error);

Gets the result of fwupd_client_upload_bytes_async().

Parameters

self

A FwupdClient

 

res

the GAsyncResult

 

error

the GError, or NULL

 

Returns

response data, or NULL for error.

[transfer full]

Since: 1.5.0


fwupd_client_ensure_networking ()

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

Parameters

self

A FwupdClient

 

error

the GError, or NULL

 

Returns

TRUE for success

Since: 1.4.5

Types and Values

FWUPD_TYPE_CLIENT

#define FWUPD_TYPE_CLIENT (fwupd_client_get_type ())

struct FwupdClientClass

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);
};

enum FwupdClientDownloadFlags

The options to use for downloading.

Members

FWUPD_CLIENT_DOWNLOAD_FLAG_NONE

No flags set

 

FWUPD_CLIENT_DOWNLOAD_FLAG_ONLY_IPFS

Only use IPFS when downloading URIs

 

enum FwupdClientUploadFlags

The options to use for uploading.

Members

FWUPD_CLIENT_UPLOAD_FLAG_NONE

No flags set

 

FWUPD_CLIENT_UPLOAD_FLAG_ALWAYS_MULTIPART

Always use multipart/form-data

 

FwupdClient

typedef struct _FwupdClient FwupdClient;