summaryrefslogtreecommitdiff
path: root/sysutils/hal
diff options
context:
space:
mode:
authorjmcneill <jmcneill@pkgsrc.org>2008-12-04 03:35:59 +0000
committerjmcneill <jmcneill@pkgsrc.org>2008-12-04 03:35:59 +0000
commit7dd9528d3affc88c4b95a31576ac22959ce15369 (patch)
tree87b1ee9bc651a41d8ae141678f8b54c93cfedea1 /sysutils/hal
parent7d5ddced5b7d57792895a5573dbc3f08f893f04e (diff)
downloadpkgsrc-7dd9528d3affc88c4b95a31576ac22959ce15369.tar.gz
hald-netbsd: clear charge rate when charge state is normal, report
measurement type when envstat provides Ah readings. Bump PKGREVISION.
Diffstat (limited to 'sysutils/hal')
-rw-r--r--sysutils/hal/Makefile4
-rw-r--r--sysutils/hal/files/hald-netbsd/envsys.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile
index e405d6f89c6..797125a44a0 100644
--- a/sysutils/hal/Makefile
+++ b/sysutils/hal/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.16 2008/12/03 07:38:10 hasso Exp $
+# $NetBSD: Makefile,v 1.17 2008/12/04 03:35:59 jmcneill Exp $
#
DISTNAME= hal-0.5.11
-PKGREVISION= 11
+PKGREVISION= 12
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/
EXTRACT_SUFX= .tar.bz2
diff --git a/sysutils/hal/files/hald-netbsd/envsys.c b/sysutils/hal/files/hald-netbsd/envsys.c
index 3440bf9b975..169535c8765 100644
--- a/sysutils/hal/files/hald-netbsd/envsys.c
+++ b/sysutils/hal/files/hald-netbsd/envsys.c
@@ -1,4 +1,4 @@
-/* $NetBSD: envsys.c,v 1.3 2008/11/27 14:17:11 jmcneill Exp $ */
+/* $NetBSD: envsys.c,v 1.4 2008/12/04 03:35:59 jmcneill Exp $ */
/*-
* Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca>
@@ -202,6 +202,13 @@ envsys_battery_handler(HalDevice *d, prop_array_t properties)
hal_device_property_set_int (d, "battery.charge_level.last_full", intval);
else if (strcmp (descr, "charge") == 0) {
int64_t maxval;
+ const char *type;
+
+ if (prop_dictionary_get_cstring_nocopy (prop, "type", &type))
+ if (strcmp (type, "Ampere hour") == 0) {
+ /* HAL 0.5.12 spec discourages this, but what can we do about it? */
+ hal_device_property_set_string (d, "battery.charge_level.unit", "mAh");
+ }
hal_device_property_set_int (d, "battery.charge_level.current", intval);
@@ -223,6 +230,7 @@ envsys_battery_handler(HalDevice *d, prop_array_t properties)
case NORMAL:
hal_device_property_set_bool (d, "battery.rechargeable.is_charging", FALSE);
hal_device_property_set_bool (d, "battery.rechargeable.is_discharging", FALSE);
+ hal_device_property_set_int (d, "battery.charge_level.rate", 0);
break;
case CHARGING:
hal_device_property_set_bool (d, "battery.rechargeable.is_charging", TRUE);