fwupd-enums: fwupd Reference Manual

## fwupd-enums fwupd-enums — enumerated values shared by the daemon and library |

## Functions

const gchar * | fwupd_status_to_string ()
FwupdStatus | fwupd_status_from_string ()
const gchar * | fwupd_device_flag_to_string ()
FwupdDeviceFlags | fwupd_device_flag_from_string ()
const gchar * | fwupd_update_state_to_string ()
FwupdUpdateState | fwupd_update_state_from_string ()
const gchar * | fwupd_trust_flag_to_string ()
FwupdTrustFlags | fwupd_trust_flag_from_string ()
FwupdKeyringKind | fwupd_keyring_kind_from_string ()
const gchar * | fwupd_keyring_kind_to_string ()

## Types and Values

enum | FwupdStatus
enum | FwupdTrustFlags
#define | FWUPD_DEVICE_FLAG_NONE
#define | FWUPD_DEVICE_FLAG_INTERNAL
#define | FWUPD_DEVICE_FLAG_UPDATABLE
#define | FWUPD_DEVICE_FLAG_ONLY_OFFLINE
#define | FWUPD_DEVICE_FLAG_REQUIRE_AC
#define | FWUPD_DEVICE_FLAG_LOCKED
#define | FWUPD_DEVICE_FLAG_SUPPORTED
#define | FWUPD_DEVICE_FLAG_REGISTERED
#define | FWUPD_DEVICE_FLAG_NEEDS_REBOOT
#define | FWUPD_DEVICE_FLAG_REPORTED
#define | FWUPD_DEVICE_FLAG_NOTIFIED
#define | FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION
#define | FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST
#define | FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG
#define | FWUPD_DEVICE_FLAG_IGNORE_VALIDATION
#define | FWUPD_DEVICE_FLAG_TRUSTED
#define | FWUPD_DEVICE_FLAG_UNKNOWN
typedef | FwupdDeviceFlags
enum | FwupdInstallFlags
enum | FwupdUpdateState
enum | FwupdKeyringKind

## Description

This file also provides helper functions to map enums to strings and back again.

See also: fwupd-error

## Functions

### fwupd_status_to_string ()

    const gchar *
    fwupd_status_to_string (FwupdStatus status);

Converts a FwupdStatus to a string.

#### Parameters

status | A FwupdStatus, e.g. `FWUPD_STATUS_DECOMPRESSING` |

#### Returns

identifier string

Since: 0.1.1

### fwupd_status_from_string ()

    FwupdStatus
    fwupd_status_from_string (const gchar *status);

Converts a string to a FwupdStatus.

#### Parameters

status | A string, e.g. `decompressing` |

#### Returns

enumerated value

Since: 0.1.1

### fwupd_device_flag_to_string ()

    const gchar *
    fwupd_device_flag_to_string (FwupdDeviceFlags device_flag);

Converts a FwupdDeviceFlags to a string.

#### Parameters

device_flag | A FwupdDeviceFlags, e.g. `FWUPD_DEVICE_FLAG_REQUIRE_AC` |

#### Returns

identifier string

Since: 0.7.0

### fwupd_device_flag_from_string ()

    FwupdDeviceFlags
    fwupd_device_flag_from_string (const gchar *device_flag);

Converts a string to a FwupdDeviceFlags.

#### Parameters

device_flag | A string, e.g. `require-ac` |

#### Returns

enumerated value

Since: 0.7.0

### fwupd_update_state_to_string ()

    const gchar *
    fwupd_update_state_to_string (FwupdUpdateState update_state);

Converts a FwupdUpdateState to a string.

#### Parameters

update_state | A FwupdUpdateState, e.g. `FWUPD_UPDATE_STATE_PENDING` |

#### Returns

identifier string

Since: 0.7.0

### fwupd_update_state_from_string ()

    FwupdUpdateState
    fwupd_update_state_from_string (const gchar *update_state);

Converts a string to a FwupdUpdateState.

#### Parameters

update_state | A string, e.g. `pending` |

#### Returns

enumerated value

Since: 0.7.0

### fwupd_trust_flag_to_string ()

    const gchar *
    fwupd_trust_flag_to_string (FwupdTrustFlags trust_flag);

Converts a FwupdTrustFlags to a string.

#### Parameters

trust_flag | A FwupdTrustFlags, e.g. `FWUPD_TRUST_FLAG_PAYLOAD` |

#### Returns

identifier string

Since: 0.7.0

### fwupd_trust_flag_from_string ()

    FwupdTrustFlags
    fwupd_trust_flag_from_string (const gchar *trust_flag);

Converts a string to a FwupdTrustFlags.

#### Parameters

trust_flag | A string, e.g. `payload` |

#### Returns

enumerated value

Since: 0.7.0

### fwupd_keyring_kind_from_string ()

    FwupdKeyringKind
    fwupd_keyring_kind_from_string (const gchar *keyring_kind);

Converts an printable string to an enumerated type.

#### Parameters

keyring_kind | a string, e.g. `gpg` |

#### Returns

a FwupdKeyringKind, e.g. `FWUPD_KEYRING_KIND_GPG`

Since: 0.9.7

### fwupd_keyring_kind_to_string ()

    const gchar *
    fwupd_keyring_kind_to_string (FwupdKeyringKind keyring_kind);

Converts an enumerated type to a printable string.

#### Parameters

keyring_kind | a FwupdKeyringKind, e.g. `FWUPD_KEYRING_KIND_GPG` |

#### Returns

a string, e.g. `gpg`

Since: 0.9.7

## Types and Values

### enum FwupdStatus

The flags to show daemon status.

#### Members

FWUPD_STATUS_UNKNOWN | Unknown state |
FWUPD_STATUS_IDLE | Idle |
FWUPD_STATUS_LOADING | Loading a resource |
FWUPD_STATUS_DECOMPRESSING | Decompressing firmware |
FWUPD_STATUS_DEVICE_RESTART | Restarting the device |
FWUPD_STATUS_DEVICE_WRITE | Writing to a device |
FWUPD_STATUS_DEVICE_VERIFY | Verifying (reading) a device |
FWUPD_STATUS_SCHEDULING | Scheduling an offline update |
FWUPD_STATUS_DOWNLOADING | A file is downloading |
FWUPD_STATUS_DEVICE_READ | Reading from a device |
FWUPD_STATUS_DEVICE_ERASE | Erasing a device |
FWUPD_STATUS_WAITING_FOR_AUTH | Waiting for authentication |
FWUPD_STATUS_DEVICE_BUSY | The device is busy |

### enum FwupdTrustFlags

The flags to show the level of trust.

#### Members

FWUPD_TRUST_FLAG_NONE | No trust |
FWUPD_TRUST_FLAG_PAYLOAD | The firmware is trusted |
FWUPD_TRUST_FLAG_METADATA | The metadata is trusted |

### FWUPD_DEVICE_FLAG_NONE

    #define FWUPD_DEVICE_FLAG_NONE			(0u)		/* Since: 0.1.3 */

### FWUPD_DEVICE_FLAG_INTERNAL

    #define FWUPD_DEVICE_FLAG_INTERNAL		(1u << 0) /* Since: 0.1.3 */

### FWUPD_DEVICE_FLAG_UPDATABLE

    #define FWUPD_DEVICE_FLAG_UPDATABLE		(1u << 1) /* Since: 0.9.7 */

### FWUPD_DEVICE_FLAG_ONLY_OFFLINE

    #define FWUPD_DEVICE_FLAG_ONLY_OFFLINE		(1u << 2) /* Since: 0.9.7 */

### FWUPD_DEVICE_FLAG_REQUIRE_AC

    #define FWUPD_DEVICE_FLAG_REQUIRE_AC		(1u << 3) /* Since: 0.6.3 */

### FWUPD_DEVICE_FLAG_LOCKED

    #define FWUPD_DEVICE_FLAG_LOCKED		(1u << 4) /* Since: 0.6.3 */

### FWUPD_DEVICE_FLAG_SUPPORTED

    #define FWUPD_DEVICE_FLAG_SUPPORTED		(1u << 5) /* Since: 0.7.1 */

### FWUPD_DEVICE_FLAG_REGISTERED

    #define FWUPD_DEVICE_FLAG_REGISTERED		(1u << 7) /* Since: 0.9.7 */

### FWUPD_DEVICE_FLAG_NEEDS_REBOOT

    #define FWUPD_DEVICE_FLAG_NEEDS_REBOOT		(1u << 8) /* Since: 0.9.7 */

### FWUPD_DEVICE_FLAG_REPORTED

    #define FWUPD_DEVICE_FLAG_REPORTED		(1u << 9) /* Since: 1.0.4 */

### FWUPD_DEVICE_FLAG_NOTIFIED

    #define FWUPD_DEVICE_FLAG_NOTIFIED		(1u << 10) /* Since: 1.0.5 */

### FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION

    #define FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION (1u << 11) /* Since: 1.0.6 */

### FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST

    #define FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST (1u << 12) /* Since: 1.0.8 */

### FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG

    #define FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG (1u << 14) /* Since: 1.1.2 */

### FWUPD_DEVICE_FLAG_IGNORE_VALIDATION

    #define FWUPD_DEVICE_FLAG_IGNORE_VALIDATION (1u << 15) /* Since: 1.1.2 */

### FWUPD_DEVICE_FLAG_TRUSTED

    #define FWUPD_DEVICE_FLAG_TRUSTED		(1u << 16) /* Since: 1.1.2 */

### FWUPD_DEVICE_FLAG_UNKNOWN

    #define FWUPD_DEVICE_FLAG_UNKNOWN		G_MAXUINT64 /* Since: 0.7.3 */

### FwupdDeviceFlags

    typedef guint64 FwupdDeviceFlags;

The device flags.

### enum FwupdInstallFlags

Flags to set when performing the firwmare update or install.

#### Members

FWUPD_INSTALL_FLAG_NONE | No flags set |
FWUPD_INSTALL_FLAG_OFFLINE | Schedule this for next boot |
FWUPD_INSTALL_FLAG_ALLOW_REINSTALL | Allow reinstalling the same version |
FWUPD_INSTALL_FLAG_ALLOW_OLDER | Allow downgrading firmware |
FWUPD_INSTALL_FLAG_FORCE | Force the update even if not a good idea |
FWUPD_INSTALL_FLAG_NO_HISTORY | Do not write to the history database |

### enum FwupdUpdateState

The update state.

#### Members

FWUPD_UPDATE_STATE_UNKNOWN | Unknown |
FWUPD_UPDATE_STATE_PENDING | Update is pending |
FWUPD_UPDATE_STATE_SUCCESS | Update was successfull |
FWUPD_UPDATE_STATE_FAILED | Update failed |
FWUPD_UPDATE_STATE_NEEDS_REBOOT | Waiting for a reboot to apply |

### enum FwupdKeyringKind

The update state.

#### Members

FWUPD_KEYRING_KIND_UNKNOWN | Unknown |
FWUPD_KEYRING_KIND_NONE | No verification |
FWUPD_KEYRING_KIND_GPG | Verification using GPG |
FWUPD_KEYRING_KIND_PKCS7 | Verification using PKCS7 |