FwupdClient

FwupdClient

Functions

Types and Values

Description

Functions

fwupd_client_new ()

FwupdClient *
fwupd_client_new (void);

Creates a new client.

Returns

a new FwupdClient

Since: 0.7.0


fwupd_client_connect ()

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.

Parameters

client

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 *client,
                          GCancellable *cancellable,
                          GError **error);

fwupd_client_get_devices is deprecated and should not be used in newly-written code.

Gets all the devices registered with the daemon.

Parameters

client

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdResult][transfer container]

Since: 0.7.0


fwupd_client_get_devices_simple ()

GPtrArray *
fwupd_client_get_devices_simple (FwupdClient *client,
                                 GCancellable *cancellable,
                                 GError **error);

Gets all the devices registered with the daemon.

Parameters

client

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_updates ()

GPtrArray *
fwupd_client_get_updates (FwupdClient *client,
                          GCancellable *cancellable,
                          GError **error);

Gets all the devices with known updates.

Parameters

client

A FwupdClient

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

results.

[element-type FwupdResult][transfer container]

Since: 0.7.0


fwupd_client_get_releases ()

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

Gets all the releases for a specific device

Parameters

client

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_details_local ()

GPtrArray *
fwupd_client_get_details_local (FwupdClient *client,
                                const gchar *filename,
                                GCancellable *cancellable,
                                GError **error);

Gets details about a specific firmware file.

Parameters

client

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 FwupdResult]

Since: 0.7.2


fwupd_client_verify ()

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

Verify a specific device.

Parameters

client

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 *client,
                            const gchar *device_id,
                            GCancellable *cancellable,
                            GError **error);

Update the verification record for a specific device.

Parameters

client

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 *client,
                     const gchar *device_id,
                     GCancellable *cancellable,
                     GError **error);

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

Parameters

client

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_clear_results ()

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

Clears the results for a specific device.

Parameters

client

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 ()

FwupdResult *
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.

Parameters

client

A FwupdClient

 

device_id

the device ID

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a FwupdResult, or NULL for failure.

[transfer full]

Since: 0.7.0


fwupd_client_get_details ()

FwupdResult *
fwupd_client_get_details (FwupdClient *client,
                          const gchar *filename,
                          GCancellable *cancellable,
                          GError **error);

fwupd_client_get_details is deprecated and should not be used in newly-written code.

Gets details about a specific firmware file.

Parameters

client

A FwupdClient

 

filename

the firmware filename, e.g. "firmware.cab"

 

cancellable

the GCancellable, or NULL

 

error

the GError, or NULL

 

Returns

a FwupdResult, or NULL for failure.

[transfer full]

Since: 0.7.0


fwupd_client_get_device_by_id ()

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.

Parameters

client

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_install ()

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.

Parameters

client

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_update_metadata ()

gboolean
fwupd_client_update_metadata (FwupdClient *client,
                              const gchar *metadata_fn,
                              const gchar *signature_fn,
                              GCancellable *cancellable,
                              GError **error);

fwupd_client_update_metadata is deprecated and should not be used in newly-written code.

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.

Parameters

client

A FwupdClient

 

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: 0.7.0


fwupd_client_update_metadata_with_id ()

gboolean
fwupd_client_update_metadata_with_id (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.

Parameters

client

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: 0.9.3


fwupd_client_get_status ()

FwupdStatus
fwupd_client_get_status (FwupdClient *client);

Gets the last returned status value.

Parameters

client

A FwupdClient

 

Returns

a FwupdStatus, or FWUPD_STATUS_UNKNOWN for unknown.

Since: 0.7.3


fwupd_client_get_percentage ()

guint
fwupd_client_get_percentage (FwupdClient *client);

Gets the last returned percentage value.

Parameters

client

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 *client);

Gets the daemon version number.

Parameters

client

A FwupdClient

 

Returns

a string, or NULL for unknown.

Since: 0.9.6


fwupd_client_get_remotes ()

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

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

Parameters

client

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 *client,
                               const gchar *remote_id,
                               GCancellable *cancellable,
                               GError **error);

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

Parameters

client

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

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,
							 FwupdResult *result);
	void			(*device_removed) (FwupdClient *client,
							 FwupdResult *result);
	void			(*device_changed) (FwupdClient *client,
							 FwupdResult *result);
};

FwupdClient

typedef struct _FwupdClient FwupdClient;