fu-hwids: fwupd Reference Manual

## fu-hwids fu-hwids |

## Functions

FuHwids * | fu_hwids_new ()
GPtrArray * | fu_hwids_get_keys ()
const gchar * | fu_hwids_get_value ()
void | fu_hwids_add_smbios_override ()
const gchar * | fu_hwids_get_replace_keys ()
gchar * | fu_hwids_get_replace_values ()
gchar * | fu_hwids_get_guid ()
GPtrArray * | fu_hwids_get_guids ()
gboolean | fu_hwids_has_guid ()
gboolean | fu_hwids_setup ()

## Types and Values

#define | FU_TYPE_HWIDS
#define | FU_HWIDS_KEY_BASEBOARD_MANUFACTURER
#define | FU_HWIDS_KEY_BASEBOARD_PRODUCT
#define | FU_HWIDS_KEY_BIOS_MAJOR_RELEASE
#define | FU_HWIDS_KEY_BIOS_MINOR_RELEASE
#define | FU_HWIDS_KEY_BIOS_VENDOR
#define | FU_HWIDS_KEY_BIOS_VERSION
#define | FU_HWIDS_KEY_FIRMWARE_MAJOR_RELEASE
#define | FU_HWIDS_KEY_FIRMWARE_MINOR_RELEASE
#define | FU_HWIDS_KEY_ENCLOSURE_KIND
#define | FU_HWIDS_KEY_FAMILY
#define | FU_HWIDS_KEY_MANUFACTURER
#define | FU_HWIDS_KEY_PRODUCT_NAME
#define | FU_HWIDS_KEY_PRODUCT_SKU
| FuHwids

## Description

## Functions

### fu_hwids_new ()

    FuHwids *
    fu_hwids_new (void);

Creates a new FuHwids

Since: 0.9.3

### fu_hwids_get_keys ()

    GPtrArray *
    fu_hwids_get_keys (FuHwids *self);

Returns all the defined HWID keys.

#### Parameters

self | a FuHwids |

#### Returns

All the known keys, e.g. `FU_HWIDS_KEY_FAMILY`.

[transfer container][element-type utf8]

Since: 1.5.6

### fu_hwids_get_value ()

    const gchar *
    fu_hwids_get_value (FuHwids *self,
                        const gchar *key);

Gets the cached value for one specific key that is valid ASCII and suitable for display.

#### Parameters

self | a FuHwids |
key | a DMI ID, e.g. `BiosVersion` |

#### Returns

the string, e.g. `1.2.3`, or `NULL` if not found

Since: 0.9.3

### fu_hwids_add_smbios_override ()

    void
    fu_hwids_add_smbios_override (FuHwids *self,
                                  const gchar *key,
                                  const gchar *value);

Sets SMBIOS override values so you can emulate another system.

This function has no effect if called after `fu_hwids_setup()`

#### Parameters

self | a FuHwids |
key | a key, e.g. `FU_HWIDS_KEY_PRODUCT_SKU` |
value | a new value, e.g. `ExampleModel`. | [nullable]

Since: 1.5.6

### fu_hwids_get_replace_keys ()

    const gchar *
    fu_hwids_get_replace_keys (FuHwids *self,
                               const gchar *key);

Gets the replacement key for a well known value.

#### Parameters

self | a FuHwids |
key | a HardwareID key, e.g. `HardwareID-3` |

#### Returns

the replacement value, e.g. `Manufacturer&amp;ProductName`, or `NULL` for error.

Since: 0.9.3

### fu_hwids_get_replace_values ()

    gchar *
    fu_hwids_get_replace_values (FuHwids *self,
                                 const gchar *keys,
                                 GError **error);

Gets the replacement values for a HardwareID key or plain key.

#### Parameters

self | a FuHwids |
keys | a key, e.g. `HardwareID-3` or `FU_HWIDS_KEY_PRODUCT_SKU` |
error | optional return location for an error. | [nullable]

#### Returns

a string, e.g. `LENOVO&amp;ThinkPad T440s`, or `NULL` for error.

Since: 0.9.3

### fu_hwids_get_guid ()

    gchar *
    fu_hwids_get_guid (FuHwids *self,
                       const gchar *keys,
                       GError **error);

Gets the GUID for a specific key.

#### Parameters

self | a FuHwids |
keys | a key, e.g. `HardwareID-3` or `FU_HWIDS_KEY_PRODUCT_SKU` |
error | optional return location for an error. | [nullable]

#### Returns

a string, or `NULL` for error.

Since: 0.9.3

### fu_hwids_get_guids ()

    GPtrArray *
    fu_hwids_get_guids (FuHwids *self);

Returns all the defined HWIDs

#### Parameters

self | a FuHwids |

#### Returns

an array of GUIDs.

[transfer none][element-type utf8]

Since: 0.9.3

### fu_hwids_has_guid ()

    gboolean
    fu_hwids_has_guid (FuHwids *self,
                       const gchar *guid);

Finds out if a hardware GUID exists.

#### Parameters

self | a FuHwids |
guid | a GUID, e.g. `059eb22d-6dc7-59af-abd3-94bbe017f67c` |

#### Returns

`TRUE` if the GUID exists

Since: 0.9.3

### fu_hwids_setup ()

    gboolean
    fu_hwids_setup (FuHwids *self,
                    FuSmbios *smbios,
                    GError **error);

Reads all the SMBIOS values from the hardware.

#### Parameters

self | a FuHwids |
smbios | a FuSmbios. | [nullable]
error | optional return location for an error. | [nullable]

#### Returns

`TRUE` for success

Since: 0.9.3

## Types and Values

### FU_TYPE_HWIDS

    #define FU_TYPE_HWIDS (fu_hwids_get_type())

### FU_HWIDS_KEY_BASEBOARD_MANUFACTURER

    #define FU_HWIDS_KEY_BASEBOARD_MANUFACTURER "BaseboardManufacturer"

The HwID key for the baseboard (motherboard) vendor.

Since: 1.3.7

### FU_HWIDS_KEY_BASEBOARD_PRODUCT

    #define FU_HWIDS_KEY_BASEBOARD_PRODUCT "BaseboardProduct"

The HwID key for baseboard (motherboard) product.

Since: 1.3.7

### FU_HWIDS_KEY_BIOS_MAJOR_RELEASE

    #define FU_HWIDS_KEY_BIOS_MAJOR_RELEASE "BiosMajorRelease"

The HwID key for the BIOS major version.

Since: 1.3.7

### FU_HWIDS_KEY_BIOS_MINOR_RELEASE

    #define FU_HWIDS_KEY_BIOS_MINOR_RELEASE "BiosMinorRelease"

The HwID key for the BIOS minor version.

Since: 1.3.7

### FU_HWIDS_KEY_BIOS_VENDOR

    #define FU_HWIDS_KEY_BIOS_VENDOR "BiosVendor"

The HwID key for the BIOS vendor.

Since: 1.3.7

### FU_HWIDS_KEY_BIOS_VERSION

    #define FU_HWIDS_KEY_BIOS_VERSION "BiosVersion"

The HwID key for the BIOS version.

Since: 1.3.7

### FU_HWIDS_KEY_FIRMWARE_MAJOR_RELEASE

    #define FU_HWIDS_KEY_FIRMWARE_MAJOR_RELEASE "FirmwareMajorRelease"

The HwID key for the firmware major version.

Since: 1.6.1

### FU_HWIDS_KEY_FIRMWARE_MINOR_RELEASE

    #define FU_HWIDS_KEY_FIRMWARE_MINOR_RELEASE "FirmwareMinorRelease"

The HwID key for the firmware minor version.

Since: 1.6.1

### FU_HWIDS_KEY_ENCLOSURE_KIND

    #define FU_HWIDS_KEY_ENCLOSURE_KIND "EnclosureKind"

The HwID key for the enclosure kind.

Since: 1.3.7

### FU_HWIDS_KEY_FAMILY

    #define FU_HWIDS_KEY_FAMILY "Family"

The HwID key for the deice family.

Since: 1.3.7

### FU_HWIDS_KEY_MANUFACTURER

    #define FU_HWIDS_KEY_MANUFACTURER "Manufacturer"

The HwID key for the top-level product vendor.

Since: 1.3.7

### FU_HWIDS_KEY_PRODUCT_NAME

    #define FU_HWIDS_KEY_PRODUCT_NAME "ProductName"

The HwID key for the top-level product product name.

Since: 1.3.7

### FU_HWIDS_KEY_PRODUCT_SKU

    #define FU_HWIDS_KEY_PRODUCT_SKU "ProductSku"

The HwID key for the top-level product SKU.

Since: 1.3.7

### FuHwids

    typedef struct _FuHwids FuHwids;

A the hardware IDs on the system.

Note, these are called "CHIDs" in Microsoft Windows and the results here will match that of `ComputerHardwareIds.exe`.

See also: [class`FuSmbios` ]