summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/com32/gplinclude/dmi/dmi_battery.h
blob: fae7acb5b668afcec0f71207558436af46a4940f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2009 Erwan Velu - All Rights Reserved
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
 *   Boston MA 02111-1307, USA; either version 2 of the License, or
 *   (at your option) any later version; incorporated herein by reference.
 *
 * ----------------------------------------------------------------------- */

#ifndef DMI_BATTERY_H
#define DMI_BATTERY_H

#include <stdbool.h>
#include <inttypes.h>

#define BATTERY_LOCATION_SIZE		255
#define BATTERY_MANUFACTURER_SIZE	255
#define BATTERY_MANUFACTURE_DATE_SIZE	255
#define BATTERY_SERIAL_SIZE		255
#define BATTERY_DEVICE_NAME_SIZE	255
#define BATTERY_CHEMISTRY_SIZE		32
#define BATTERY_CAPACITY_SIZE		16
#define BATTERY_DESIGN_VOLTAGE_SIZE	16
#define BATTERY_SBDS_SIZE		255
#define BATTERY_MAXIMUM_ERROR_SIZE	32
#define BATTERY_SBDS_SERIAL_SIZE	32
#define BATTERY_SBDS_MANUFACTURE_DATE_SIZE	255
#define BATTERY_SBDS_CHEMISTRY_SIZE	16
#define BATTERY_OEM_INFO_SIZE		255

typedef struct {
    char location[BATTERY_LOCATION_SIZE];
    char manufacturer[BATTERY_MANUFACTURER_SIZE];
    char manufacture_date[BATTERY_MANUFACTURE_DATE_SIZE];
    char serial[BATTERY_SERIAL_SIZE];
    char name[BATTERY_DEVICE_NAME_SIZE];
    char chemistry[BATTERY_CHEMISTRY_SIZE];
    char design_capacity[BATTERY_CAPACITY_SIZE];
    char design_voltage[BATTERY_DESIGN_VOLTAGE_SIZE];
    char sbds[BATTERY_SBDS_SIZE];
    char sbds_serial[BATTERY_SBDS_SERIAL_SIZE];
    char maximum_error[BATTERY_MAXIMUM_ERROR_SIZE];
    char sbds_manufacture_date[BATTERY_SBDS_MANUFACTURE_DATE_SIZE];
    char sbds_chemistry[BATTERY_SBDS_CHEMISTRY_SIZE];
    char oem_info[BATTERY_OEM_INFO_SIZE];
/* The filled field have to be set to true when the dmitable implement that item */
    bool filled;
} s_battery;

const char *dmi_battery_chemistry(uint8_t code);
void dmi_battery_capacity(uint16_t code, uint8_t multiplier, char *capacity);
void dmi_battery_voltage(uint16_t code, char *voltage);
void dmi_battery_maximum_error(uint8_t code, char *error);
#endif