dmi_battery_chemistry

Synopsis

#include <opendmi/entity/battery.h>

typedef enum dmi_battery_chemistry {
    DMI_BATTERY_CHEMISTRY_UNSPEC    = 0x00,
    DMI_BATTERY_CHEMISTRY_OTHER     = 0x01,
    DMI_BATTERY_CHEMISTRY_UNKNOWN   = 0x02,
    DMI_BATTERY_CHEMISTRY_LEAD_ACID = 0x03,
    DMI_BATTERY_CHEMISTRY_NI_CD     = 0x04,
    DMI_BATTERY_CHEMISTRY_NI_MH     = 0x05,
    DMI_BATTERY_CHEMISTRY_LI_ION    = 0x06,
    DMI_BATTERY_CHEMISTRY_ZN_AIR    = 0x07,
    DMI_BATTERY_CHEMISTRY_LI_PO     = 0x08,
} dmi_battery_chemistry_t;

const char *dmi_battery_chemistry_name(dmi_battery_chemistry_t value);

Description

The dmi_battery_chemistry_t enumeration tells the chemistry of a battery, and is the type of the chemistry field of dmi_battery_t. Smart batteries report DMI_BATTERY_CHEMISTRY_UNKNOWN, and give their chemistry as a string in the sbds_chemistry field instead.

The dmi_battery_chemistry_name function returns the printable name of a value, as the command line tool shows it. The name is translated to the locale set with dmi_set_locale, when the library is built with ICU4C support and has a translation of it.

Values

DMI_BATTERY_CHEMISTRY_UNSPEC

Unspecified.

DMI_BATTERY_CHEMISTRY_OTHER

Other chemistry.

DMI_BATTERY_CHEMISTRY_UNKNOWN

Unknown chemistry, or chemistry given by the sbds_chemistry field.

DMI_BATTERY_CHEMISTRY_LEAD_ACID

Lead acid.

DMI_BATTERY_CHEMISTRY_NI_CD

Nickel cadmium.

DMI_BATTERY_CHEMISTRY_NI_MH

Nickel metal hydride.

DMI_BATTERY_CHEMISTRY_LI_ION

Lithium-ion.

DMI_BATTERY_CHEMISTRY_ZN_AIR

Zinc air.

DMI_BATTERY_CHEMISTRY_LI_PO

Lithium polymer.

Return value

dmi_battery_chemistry_name returns the name of the value, or nullptr if the value has no name. The name is a static string, which must not be modified or freed.

Errors

None.

See also

Standards

DMTF SMBIOS Specification (DSP0134), version 2.1 or newer.