diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-24 13:25:49 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-03-24 13:25:49 +0100 |
commit | 0f78eb6ce67962a4147dce37cc4f8538d44b36d7 (patch) | |
tree | db7b627eaa37e767e2a08aad19683fc79a6477e8 /hw/usb/hid-logitech-dj.h | |
parent | 4215730f0ac21c625effe50ba14fbf050dc991a8 (diff) | |
download | qemu-0f78eb6ce67962a4147dce37cc4f8538d44b36d7.tar.gz |
unifying: implement BatteryStatus
Battery percentage is fuzzy... ok.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb/hid-logitech-dj.h')
-rw-r--r-- | hw/usb/hid-logitech-dj.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index 6a29b6639e..785f0d5b56 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -220,11 +220,23 @@ typedef struct { /* TODO: status (device seen or not, encrypted link) */ struct { - uint8_t level; - enum { - BAT_STS_CHARGING, - /* TODO: charging, discharging, etc. */ - } status; + uint8_t nlevels; + uint8_t level; /* in range (1, nlevels) */ +#define BAT_FLAG_DISABLE_OSD (1 << 0) +#define BAT_FLAG_ENABLE_MILEAGE (1 << 1) +#define BAT_FLAG_RECHARGEABLE (1 << 2) + uint8_t flags; + uint8_t critical_perc; + +#define BAT_STS_DISCHARGING 0 +#define BAT_STS_RECHARGING 1 +#define BAT_STS_CHARGE_FINAL 2 +#define BAT_STS_CHARGE_COMPLETE 3 +#define BAT_STS_RECHARGING_SLOW 4 +#define BAT_STS_INVALID_BATTERY 5 +#define BAT_STS_THERMAL_ERROR 6 +#define BAT_STS_CHARGING_ERROR 7 + uint8_t status; } battery; uint8_t activity_counter; } LHidDevice; |