## FuDevice FuDevice — a physical or logical device |

## Functions

FuDevice * | fu_device_new ()
#define | fu_device_add_flag()
#define | fu_device_remove_flag()
#define | fu_device_has_flag()
#define | fu_device_add_checksum()
#define | fu_device_add_icon()
#define | fu_device_set_created()
#define | fu_device_set_description()
#define | fu_device_set_flags()
#define | fu_device_has_guid()
#define | fu_device_set_id()
#define | fu_device_set_modified()
#define | fu_device_set_plugin()
#define | fu_device_set_summary()
#define | fu_device_set_update_error()
#define | fu_device_set_update_state()
#define | fu_device_set_vendor()
#define | fu_device_set_vendor_id()
#define | fu_device_set_version()
#define | fu_device_set_version_lowest()
#define | fu_device_set_version_bootloader()
#define | fu_device_set_flashes_left()
#define | fu_device_get_checksums()
#define | fu_device_get_flags()
#define | fu_device_get_guids()
#define | fu_device_get_guid_default()
#define | fu_device_get_icons()
#define | fu_device_get_name()
#define | fu_device_get_id()
#define | fu_device_get_plugin()
#define | fu_device_get_update_error()
#define | fu_device_get_update_state()
#define | fu_device_get_version()
#define | fu_device_get_version_lowest()
#define | fu_device_get_version_bootloader()
#define | fu_device_get_vendor_id()
#define | fu_device_get_flashes_left()
const gchar * | fu_device_get_equivalent_id ()
void | fu_device_set_equivalent_id ()
void | fu_device_add_guid ()
FuDevice * | fu_device_get_alternate ()
void | fu_device_set_alternate ()
const gchar * | fu_device_get_metadata ()
gboolean | fu_device_get_metadata_boolean ()
guint | fu_device_get_metadata_integer ()
void | fu_device_set_metadata ()
void | fu_device_set_metadata_boolean ()
void | fu_device_set_metadata_integer ()
void | fu_device_set_name ()

## Types and Values

#define | FU_TYPE_DEVICE
struct | FuDeviceClass
| FuDevice

## Description

An object that represents a physical or logical device.

See also: FuDeviceLocker

## Functions

### fu_device_new ()

    FuDevice *
    fu_device_new (void);

### fu_device_add_flag()

    #define fu_device_add_flag(d,v)			fwupd_device_add_flag(FWUPD_DEVICE(d),v)

### fu_device_remove_flag()

    #define fu_device_remove_flag(d,v)		fwupd_device_remove_flag(FWUPD_DEVICE(d),v)

### fu_device_has_flag()

    #define fu_device_has_flag(d,v)			fwupd_device_has_flag(FWUPD_DEVICE(d),v)

### fu_device_add_checksum()

    #define fu_device_add_checksum(d,v)		fwupd_device_add_checksum(FWUPD_DEVICE(d),v)

### fu_device_add_icon()

    #define fu_device_add_icon(d,v)			fwupd_device_add_icon(FWUPD_DEVICE(d),v)

### fu_device_set_created()

    #define fu_device_set_created(d,v)		fwupd_device_set_created(FWUPD_DEVICE(d),v)

### fu_device_set_description()

    #define fu_device_set_description(d,v)		fwupd_device_set_description(FWUPD_DEVICE(d),v)

### fu_device_set_flags()

    #define fu_device_set_flags(d,v)		fwupd_device_set_flags(FWUPD_DEVICE(d),v)

### fu_device_has_guid()

    #define fu_device_has_guid(d,v)			fwupd_device_has_guid(FWUPD_DEVICE(d),v)

### fu_device_set_id()

    #define fu_device_set_id(d,v)			fwupd_device_set_id(FWUPD_DEVICE(d),v)

### fu_device_set_modified()

    #define fu_device_set_modified(d,v)		fwupd_device_set_modified(FWUPD_DEVICE(d),v)

### fu_device_set_plugin()

    #define fu_device_set_plugin(d,v)		fwupd_device_set_plugin(FWUPD_DEVICE(d),v)

### fu_device_set_summary()

    #define fu_device_set_summary(d,v)		fwupd_device_set_summary(FWUPD_DEVICE(d),v)

### fu_device_set_update_error()

    #define fu_device_set_update_error(d,v)		fwupd_device_set_update_error(FWUPD_DEVICE(d),v)

### fu_device_set_update_state()

    #define fu_device_set_update_state(d,v)		fwupd_device_set_update_state(FWUPD_DEVICE(d),v)

### fu_device_set_vendor()

    #define fu_device_set_vendor(d,v)		fwupd_device_set_vendor(FWUPD_DEVICE(d),v)

### fu_device_set_vendor_id()

    #define fu_device_set_vendor_id(d,v)		fwupd_device_set_vendor_id(FWUPD_DEVICE(d),v)

### fu_device_set_version()

    #define fu_device_set_version(d,v)		fwupd_device_set_version(FWUPD_DEVICE(d),v)

### fu_device_set_version_lowest()

    #define fu_device_set_version_lowest(d,v) fwupd_device_set_version_lowest(FWUPD_DEVICE(d),v)

### fu_device_set_version_bootloader()

    #define fu_device_set_version_bootloader(d,v) fwupd_device_set_version_bootloader(FWUPD_DEVICE(d),v)

### fu_device_set_flashes_left()

    #define fu_device_set_flashes_left(d,v)		fwupd_device_set_flashes_left(FWUPD_DEVICE(d),v)

### fu_device_get_checksums()

    #define fu_device_get_checksums(d)		fwupd_device_get_checksums(FWUPD_DEVICE(d))

### fu_device_get_flags()

    #define fu_device_get_flags(d)			fwupd_device_get_flags(FWUPD_DEVICE(d))

### fu_device_get_guids()

    #define fu_device_get_guids(d)			fwupd_device_get_guids(FWUPD_DEVICE(d))

### fu_device_get_guid_default()

    #define fu_device_get_guid_default(d)		fwupd_device_get_guid_default(FWUPD_DEVICE(d))

### fu_device_get_icons()

    #define fu_device_get_icons(d)			fwupd_device_get_icons(FWUPD_DEVICE(d))

### fu_device_get_name()

    #define fu_device_get_name(d)			fwupd_device_get_name(FWUPD_DEVICE(d))

### fu_device_get_id()

    #define fu_device_get_id(d)			fwupd_device_get_id(FWUPD_DEVICE(d))

### fu_device_get_plugin()

    #define fu_device_get_plugin(d)			fwupd_device_get_plugin(FWUPD_DEVICE(d))

### fu_device_get_update_error()

    #define fu_device_get_update_error(d)		fwupd_device_get_update_error(FWUPD_DEVICE(d))

### fu_device_get_update_state()

    #define fu_device_get_update_state(d)		fwupd_device_get_update_state(FWUPD_DEVICE(d))

### fu_device_get_version()

    #define fu_device_get_version(d)		fwupd_device_get_version(FWUPD_DEVICE(d))

### fu_device_get_version_lowest()

    #define fu_device_get_version_lowest(d)		fwupd_device_get_version_lowest(FWUPD_DEVICE(d))

### fu_device_get_version_bootloader()

    #define fu_device_get_version_bootloader(d) fwupd_device_get_version_bootloader(FWUPD_DEVICE(d))

### fu_device_get_vendor_id()

    #define fu_device_get_vendor_id(d)		fwupd_device_get_vendor_id(FWUPD_DEVICE(d))

### fu_device_get_flashes_left()

    #define fu_device_get_flashes_left(d)		fwupd_device_get_flashes_left(FWUPD_DEVICE(d))

### fu_device_get_equivalent_id ()

    const gchar *
    fu_device_get_equivalent_id (FuDevice *device);

### fu_device_set_equivalent_id ()

    void
    fu_device_set_equivalent_id (FuDevice *device,
                                 const gchar *equivalent_id);

### fu_device_add_guid ()

    void
    fu_device_add_guid (FuDevice *device,
                        const gchar *guid);

Adds a GUID to the device. If the `guid` argument is not a valid GUID then it is converted to a GUID using `as_utils_guid_from_string()`.

#### Parameters

device | A FuDevice |
guid | A GUID, e.g. `2082b5e0-7a64-478a-b1b2-e3404fab6dad` |

Since: 0.7.2

### fu_device_get_alternate ()

    FuDevice *
    fu_device_get_alternate (FuDevice *device);

Gets any alternate device. An alternate device may be linked to the primary device in some way.

#### Parameters

device | A FuDevice |

#### Returns

a FuDevice or `NULL`.

[transfer none]

Since: 0.7.2

### fu_device_set_alternate ()

    void
    fu_device_set_alternate (FuDevice *device,
                             FuDevice *alternate);

Sets any alternate device. An alternate device may be linked to the primary device in some way.

#### Parameters

device | A FuDevice |
alternate | Another FuDevice |

Since: 0.7.2

### fu_device_get_metadata ()

    const gchar *
    fu_device_get_metadata (FuDevice *device,
                            const gchar *key);

Gets an item of metadata from the device.

#### Parameters

device | A FuDevice |
key | the key |

#### Returns

a string value, or `NULL` for unfound.

Since: 0.1.0

### fu_device_get_metadata_boolean ()

    gboolean
    fu_device_get_metadata_boolean (FuDevice *device,
                                    const gchar *key);

Gets an item of metadata from the device.

#### Parameters

device | A FuDevice |
key | the key |

#### Returns

a boolean value, or `FALSE` for unfound or failure to parse.

Since: 0.9.7

### fu_device_get_metadata_integer ()

    guint
    fu_device_get_metadata_integer (FuDevice *device,
                                    const gchar *key);

Gets an item of metadata from the device.

#### Parameters

device | A FuDevice |
key | the key |

#### Returns

a string value, or `G_MAXUINT` for unfound or failure to parse.

Since: 0.9.7

### fu_device_set_metadata ()

    void
    fu_device_set_metadata (FuDevice *device,
                            const gchar *key,
                            const gchar *value);

Sets an item of metadata on the device.

#### Parameters

device | A FuDevice |
key | the key |
value | the string value |

Since: 0.1.0

### fu_device_set_metadata_boolean ()

    void
    fu_device_set_metadata_boolean (FuDevice *device,
                                    const gchar *key,
                                    gboolean value);

Sets an item of metadata on the device. When `value` is set to `TRUE` the actual stored value is "true".

#### Parameters

device | A FuDevice |
key | the key |
value | the boolean value |

Since: 0.9.7

### fu_device_set_metadata_integer ()

    void
    fu_device_set_metadata_integer (FuDevice *device,
                                    const gchar *key,
                                    guint value);

Sets an item of metadata on the device. The integer is stored as a base-10 string internally.

#### Parameters

device | A FuDevice |
key | the key |
value | the unsigned integer value |

Since: 0.9.7

### fu_device_set_name ()

    void
    fu_device_set_name (FuDevice *device,
                        const gchar *value);

Sets the name on the device. Any invalid parts will be converted or removed.

#### Parameters

device | A FuDevice |
value | a device name |

Since: 0.7.1

## Types and Values

### FU_TYPE_DEVICE

    #define FU_TYPE_DEVICE (fu_device_get_type ())

### struct FuDeviceClass

    struct FuDeviceClass {
    	FwupdDeviceClass	 parent_class;
    };

### FuDevice

    typedef struct _FuDevice FuDevice;