diff options
author | Peter Schiffer <pschiffe@redhat.com> | 2013-06-27 16:53:13 +0200 |
---|---|---|
committer | Peter Schiffer <pschiffe@redhat.com> | 2013-06-27 16:53:13 +0200 |
commit | 1b42ade8e003454542da4f885c8aec6180ef2fae (patch) | |
tree | 7ac069a974f001ca105232d8bc8459ee6237e6de /src/hardware/dmidecode.h | |
parent | c5d2e0c4da395fd169f1a1b1b31eafc112426660 (diff) | |
parent | 6fab15ca48be60d128ae68c051bd93b346ff1ab6 (diff) | |
download | openlmi-providers-1b42ade8e003454542da4f885c8aec6180ef2fae.tar.gz openlmi-providers-1b42ade8e003454542da4f885c8aec6180ef2fae.tar.xz openlmi-providers-1b42ade8e003454542da4f885c8aec6180ef2fae.zip |
Merge branch 'master'
Diffstat (limited to 'src/hardware/dmidecode.h')
-rw-r--r-- | src/hardware/dmidecode.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/hardware/dmidecode.h b/src/hardware/dmidecode.h index 34bfd47..a29d90d 100644 --- a/src/hardware/dmidecode.h +++ b/src/hardware/dmidecode.h @@ -141,6 +141,19 @@ typedef struct _DmiPointingDevice { unsigned buttons; /* Number of buttons */ } DmiPointingDevice; +/* Battery from dmidecode. */ +typedef struct _DmiBattery { + char *name; /* Battery name */ + char *chemistry; /* Battery chemistry */ + unsigned design_capacity; /* Design capacity */ + unsigned design_voltage; /* Design voltage */ + char *manufacturer; /* Manufacturer */ + char *serial_number; /* Serial number */ + char *version; /* Version */ + char *manufacture_date; /* Manufacture date */ + char *location; /* Battery location */ +} DmiBattery; + /* * Get array of processors according to the dmidecode program. * @param cpu array of cpus, this function will allocate necessary memory, @@ -263,5 +276,21 @@ short dmi_get_pointing_devices(DmiPointingDevice **devices, unsigned *devices_nb */ void dmi_free_pointing_devices(DmiPointingDevice **devices, unsigned *devices_nb); +/* + * Get array of batteries according to the dmidecode program. + * @param batteries array of batteries, this function will allocate necessary memory, + * but caller is responsible for freeing it + * @param batteries_nb number of batteries + * @return 0 if success, negative value otherwise + */ +short dmi_get_batteries(DmiBattery **batteries, unsigned *batteries_nb); + +/* + * Free array of batteries structures. + * @param batteries array of batteries + * @param batteries_nb number of batteries + */ +void dmi_free_batteries(DmiBattery **batteries, unsigned *batteries_nb); + #endif /* DMIDECODE_H_ */ |