FwupdClient

FwupdClient

Functions

Properties

guint status Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── FwupdClient

Description

Functions

fwupd_client_new ()

FwupdClient *
fwupd_client_new (void);

Creates a new client.

Returns

a new FwupdClient

Since: 0.7.0


fwupd_client_get_devices ()

GPtrArray *
fwupd_client_get_devices (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 FwupdResult][transfer container]

Since: 0.7.0


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

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

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

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

FwupdClient

typedef struct _FwupdClient FwupdClient;

Property Details

The “status” property

  “status”                   guint

The last-reported status of the daemon.

Flags: Read / Write

Allowed values: <= 8

Default value: 0

Since: 0.7.0

Signal Details

The “changed” signal

void
user_function (FwupdClient *client,
               gpointer     user_data)

The ::changed signal is emitted when the daemon internal has changed, for instance when a device has been added or removed.

Parameters

client

the FwupdClient instance that emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.7.0


The “status-changed” signal

void
user_function (FwupdClient *fwupdclient,
               guint        arg1,
               gpointer     user_data)

Flags: Run Last