pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/hal hald-netbsd: clear charge rate when charg...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ba44b1a5e68a
branches:  trunk
changeset: 550987:ba44b1a5e68a
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Thu Dec 04 03:35:59 2008 +0000

description:
hald-netbsd: clear charge rate when charge state is normal, report
measurement type when envstat provides Ah readings. Bump PKGREVISION.

diffstat:

 sysutils/hal/Makefile                   |   4 ++--
 sysutils/hal/files/hald-netbsd/envsys.c |  10 +++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r adeaa4a6bddf -r ba44b1a5e68a sysutils/hal/Makefile
--- a/sysutils/hal/Makefile     Thu Dec 04 00:27:08 2008 +0000
+++ b/sysutils/hal/Makefile     Thu Dec 04 03:35:59 2008 +0000
@@ -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 -r adeaa4a6bddf -r ba44b1a5e68a sysutils/hal/files/hald-netbsd/envsys.c
--- a/sysutils/hal/files/hald-netbsd/envsys.c   Thu Dec 04 00:27:08 2008 +0000
+++ b/sysutils/hal/files/hald-netbsd/envsys.c   Thu Dec 04 03:35:59 2008 +0000
@@ -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@localhost>
@@ -202,6 +202,13 @@
                        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 @@
        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);



Home | Main Index | Thread Index | Old Index