## FwupdDevice FwupdDevice |

## Functions

FwupdDevice * | fwupd_device_new ()
gchar * | fwupd_device_to_string ()
const gchar * | fwupd_device_get_id ()
void | fwupd_device_set_id ()
const gchar * | fwupd_device_get_name ()
void | fwupd_device_set_name ()
const gchar * | fwupd_device_get_summary ()
void | fwupd_device_set_summary ()
const gchar * | fwupd_device_get_description ()
void | fwupd_device_set_description ()
const gchar * | fwupd_device_get_version ()
void | fwupd_device_set_version ()
const gchar * | fwupd_device_get_version_lowest ()
void | fwupd_device_set_version_lowest ()
const gchar * | fwupd_device_get_version_bootloader ()
void | fwupd_device_set_version_bootloader ()
guint32 | fwupd_device_get_flashes_left ()
void | fwupd_device_set_flashes_left ()
guint64 | fwupd_device_get_flags ()
void | fwupd_device_set_flags ()
void | fwupd_device_add_flag ()
void | fwupd_device_remove_flag ()
gboolean | fwupd_device_has_flag ()
guint64 | fwupd_device_get_created ()
void | fwupd_device_set_created ()
guint64 | fwupd_device_get_modified ()
void | fwupd_device_set_modified ()
GPtrArray * | fwupd_device_get_checksums ()
void | fwupd_device_add_checksum ()
const gchar * | fwupd_device_get_provider ()
void | fwupd_device_set_provider ()
const gchar * | fwupd_device_get_vendor ()
void | fwupd_device_set_vendor ()
const gchar * | fwupd_device_get_vendor_id ()
void | fwupd_device_set_vendor_id ()
void | fwupd_device_add_guid ()
gboolean | fwupd_device_has_guid ()
GPtrArray * | fwupd_device_get_guids ()
const gchar * | fwupd_device_get_guid_default ()

## Types and Values

#define | FWUPD_TYPE_DEVICE
struct | FwupdDeviceClass
| FwupdDevice

## Description

## Functions

### fwupd_device_new ()

    FwupdDevice *
    fwupd_device_new (void);

Creates a new device.

#### Returns

a new FwupdDevice

Since: 0.9.3

### fwupd_device_to_string ()

    gchar *
    fwupd_device_to_string (FwupdDevice *device);

Builds a text representation of the object.

#### Parameters

device | A FwupdDevice |

#### Returns

text, or `NULL` for invalid

Since: 0.9.3

### fwupd_device_get_id ()

    const gchar *
    fwupd_device_get_id (FwupdDevice *device);

Gets the ID.

#### Parameters

device | A FwupdDevice |

#### Returns

the ID, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_id ()

    void
    fwupd_device_set_id (FwupdDevice *device,
                         const gchar *id);

Sets the ID.

#### Parameters

device | A FwupdDevice |
id | the device ID, e.g. "USB:foo" |

Since: 0.9.3

### fwupd_device_get_name ()

    const gchar *
    fwupd_device_get_name (FwupdDevice *device);

Gets the device name.

#### Parameters

device | A FwupdDevice |

#### Returns

the device name, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_name ()

    void
    fwupd_device_set_name (FwupdDevice *device,
                           const gchar *name);

Sets the device name.

#### Parameters

device | A FwupdDevice |
name | the device name, e.g. "ColorHug2" |

Since: 0.9.3

### fwupd_device_get_summary ()

    const gchar *
    fwupd_device_get_summary (FwupdDevice *device);

Gets the device summary.

#### Parameters

device | A FwupdDevice |

#### Returns

the device summary, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_summary ()

    void
    fwupd_device_set_summary (FwupdDevice *device,
                              const gchar *summary);

Sets the device summary.

#### Parameters

device | A FwupdDevice |
summary | the device one line summary |

Since: 0.9.3

### fwupd_device_get_description ()

    const gchar *
    fwupd_device_get_description (FwupdDevice *device);

Gets the device description in AppStream markup format.

#### Parameters

device | A FwupdDevice |

#### Returns

the device description, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_description ()

    void
    fwupd_device_set_description (FwupdDevice *device,
                                  const gchar *description);

Sets the device description.

#### Parameters

device | A FwupdDevice |
description | the description in AppStream markup format |

Since: 0.9.3

### fwupd_device_get_version ()

    const gchar *
    fwupd_device_get_version (FwupdDevice *device);

Gets the device version.

#### Parameters

device | A FwupdDevice |

#### Returns

the device version, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_version ()

    void
    fwupd_device_set_version (FwupdDevice *device,
                              const gchar *version);

Sets the device version.

#### Parameters

device | A FwupdDevice |
version | the device version, e.g. "1.2.3" |

Since: 0.9.3

### fwupd_device_get_version_lowest ()

    const gchar *
    fwupd_device_get_version_lowest (FwupdDevice *device);

Gets the lowest version of firmware the device will accept.

#### Parameters

device | A FwupdDevice |

#### Returns

the device version_lowest, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_version_lowest ()

    void
    fwupd_device_set_version_lowest (FwupdDevice *device,
                                     const gchar *version_lowest);

Sets the lowest version of firmware the device will accept.

#### Parameters

device | A FwupdDevice |
version_lowest | the description |

Since: 0.9.3

### fwupd_device_get_version_bootloader ()

    const gchar *
    fwupd_device_get_version_bootloader (FwupdDevice *device);

Gets the version of the bootloader.

#### Parameters

device | A FwupdDevice |

#### Returns

the device version_bootloader, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_version_bootloader ()

    void
    fwupd_device_set_version_bootloader (FwupdDevice *device,
                                         const gchar *version_bootloader);

Sets the bootloader version.

#### Parameters

device | A FwupdDevice |
version_bootloader | the description |

Since: 0.9.3

### fwupd_device_get_flashes_left ()

    guint32
    fwupd_device_get_flashes_left (FwupdDevice *device);

### fwupd_device_set_flashes_left ()

    void
    fwupd_device_set_flashes_left (FwupdDevice *device,
                                   guint32 flashes_left);

### fwupd_device_get_flags ()

    guint64
    fwupd_device_get_flags (FwupdDevice *device);

Gets the device flags.

#### Parameters

device | A FwupdDevice |

#### Returns

the device flags, or 0 if unset

Since: 0.9.3

### fwupd_device_set_flags ()

    void
    fwupd_device_set_flags (FwupdDevice *device,
                            guint64 flags);

Sets the device flags.

#### Parameters

device | A FwupdDevice |
flags | the device flags, e.g. `FWUPD_DEVICE_FLAG_REQUIRE_AC` |

Since: 0.9.3

### fwupd_device_add_flag ()

    void
    fwupd_device_add_flag (FwupdDevice *device,
                           FwupdDeviceFlags flag);

Adds a specific device flag to the device.

#### Parameters

device | A FwupdDevice |
flag | the FwupdDeviceFlags |

Since: 0.9.3

### fwupd_device_remove_flag ()

    void
    fwupd_device_remove_flag (FwupdDevice *device,
                              FwupdDeviceFlags flag);

Removes a specific device flag from the device.

#### Parameters

device | A FwupdDevice |
flag | the FwupdDeviceFlags |

Since: 0.9.3

### fwupd_device_has_flag ()

    gboolean
    fwupd_device_has_flag (FwupdDevice *device,
                           FwupdDeviceFlags flag);

Finds if the device has a specific device flag.

#### Parameters

device | A FwupdDevice |
flag | the FwupdDeviceFlags |

#### Returns

`TRUE` if the flag is set

Since: 0.9.3

### fwupd_device_get_created ()

    guint64
    fwupd_device_get_created (FwupdDevice *device);

Gets when the device was created.

#### Parameters

device | A FwupdDevice |

#### Returns

the UNIX time, or 0 if unset

Since: 0.9.3

### fwupd_device_set_created ()

    void
    fwupd_device_set_created (FwupdDevice *device,
                              guint64 created);

Sets when the device was created.

#### Parameters

device | A FwupdDevice |
created | the UNIX time |

Since: 0.9.3

### fwupd_device_get_modified ()

    guint64
    fwupd_device_get_modified (FwupdDevice *device);

Gets when the device was modified.

#### Parameters

device | A FwupdDevice |

#### Returns

the UNIX time, or 0 if unset

Since: 0.9.3

### fwupd_device_set_modified ()

    void
    fwupd_device_set_modified (FwupdDevice *device,
                               guint64 modified);

Sets when the device was modified.

#### Parameters

device | A FwupdDevice |
modified | the UNIX time |

Since: 0.9.3

### fwupd_device_get_checksums ()

    GPtrArray *
    fwupd_device_get_checksums (FwupdDevice *device);

Gets the device checksums.

#### Parameters

device | A FwupdDevice |

#### Returns

the checksums, which may be empty.

[element-type utf8][transfer none]

Since: 0.9.3

### fwupd_device_add_checksum ()

    void
    fwupd_device_add_checksum (FwupdDevice *device,
                               const gchar *checksum);

Sets the device checksum.

#### Parameters

device | A FwupdDevice |
checksum | the device checksum |

Since: 0.9.3

### fwupd_device_get_provider ()

    const gchar *
    fwupd_device_get_provider (FwupdDevice *device);

Gets the device provider.

#### Parameters

device | A FwupdDevice |

#### Returns

the device provider, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_provider ()

    void
    fwupd_device_set_provider (FwupdDevice *device,
                               const gchar *provider);

Sets the device provider.

#### Parameters

device | A FwupdDevice |
provider | the provider name, e.g. "colorhug" |

Since: 0.9.3

### fwupd_device_get_vendor ()

    const gchar *
    fwupd_device_get_vendor (FwupdDevice *device);

Gets the device vendor.

#### Parameters

device | A FwupdDevice |

#### Returns

the device vendor, or `NULL` if unset

Since: 0.9.3

### fwupd_device_set_vendor ()

    void
    fwupd_device_set_vendor (FwupdDevice *device,
                             const gchar *vendor);

Sets the device vendor.

#### Parameters

device | A FwupdDevice |
vendor | the description |

Since: 0.9.3

### fwupd_device_get_vendor_id ()

    const gchar *
    fwupd_device_get_vendor_id (FwupdDevice *device);

Gets the device vendor ID.

#### Parameters

device | A FwupdDevice |

#### Returns

the device vendor, e.g. 'USB:0x1234', or `NULL` if unset

Since: 0.9.4

### fwupd_device_set_vendor_id ()

    void
    fwupd_device_set_vendor_id (FwupdDevice *device,
                                const gchar *vendor_id);

Sets the device vendor ID.

#### Parameters

device | A FwupdDevice |
vendor_id | the ID, e.g. 'USB:0x1234' |

Since: 0.9.4

### fwupd_device_add_guid ()

    void
    fwupd_device_add_guid (FwupdDevice *device,
                           const gchar *guid);

Adds the GUID if it does not already exist.

#### Parameters

device | A FwupdDevice |
guid | the GUID, e.g. "2082b5e0-7a64-478a-b1b2-e3404fab6dad" |

Since: 0.9.3

### fwupd_device_has_guid ()

    gboolean
    fwupd_device_has_guid (FwupdDevice *device,
                           const gchar *guid);

Finds out if the device has this specific GUID.

#### Parameters

device | A FwupdDevice |
guid | the GUID, e.g. "2082b5e0-7a64-478a-b1b2-e3404fab6dad" |

#### Returns

`TRUE` if the GUID is found

Since: 0.9.3

### fwupd_device_get_guids ()

    GPtrArray *
    fwupd_device_get_guids (FwupdDevice *device);

Gets the GUIDs.

#### Parameters

device | A FwupdDevice |

#### Returns

the GUIDs.

[element-type utf8][transfer none]

Since: 0.9.3

### fwupd_device_get_guid_default ()

    const gchar *
    fwupd_device_get_guid_default (FwupdDevice *device);

Gets the default GUID.

#### Parameters

device | A FwupdDevice |

#### Returns

the GUID, or `NULL` if unset

Since: 0.9.3

## Types and Values

### FWUPD_TYPE_DEVICE

    #define FWUPD_TYPE_DEVICE (fwupd_device_get_type ())

### struct FwupdDeviceClass

    struct FwupdDeviceClass {
    	GObjectClass			 parent_class;
    };

### FwupdDevice

    typedef struct _FwupdDevice FwupdDevice;