[Pkg-utopia-maintainers] Bug#463740: reports battery is discharhing when there's no ac power
Joey Hess
joeyh at debian.org
Sat Feb 2 21:36:57 UTC 2008
Package: hal
Version: 0.5.10-5
Severity: normal
This is what lshal shows for my laptop (fujitsu p7120) when power is
plugged in:
battery.rechargeable.is_charging = true (bool)
battery.rechargeable.is_discharging = false (bool)
ac_adapter.present = true (bool)
This is what it shows when power is not plugged in:
battery.rechargeable.is_charging = true (bool)
battery.rechargeable.is_discharging = false (bool)
ac_adapter.present = false (bool)
Yep, it's magically charging with no AC power or other power source.
Nice trick. ;-)
Interestingly in both cases, I see this:
joey at kodama:/sys/class/power_supply/CMB1>cat status
Discharging
That seems to be because the battery is currently 100% charged:
root at kodama:/sys/class/power_supply/CMB1>cat charge_now
7800000
root at kodama:/sys/class/power_supply/CMB1>cat charge_full
7800000
root at kodama:/sys/class/power_supply/CMB1>cat charge_full_design
7800000
So I have no idea why hal thinks it's charging..
The relevant code looks ok:
/* STATUS: Convert to charging/discharging state */
status = hal_util_get_string_from_file (path, "status");
if (status != NULL) {
if (strcasecmp (status, "charging") == 0) {
is_charging = TRUE;
} else if (strcasecmp (status, "discharging") == 0) {
is_discharging = TRUE;
}
hal_device_property_set_bool (d, "battery.rechargeable.is_charging", is_charging);
hal_device_property_set_bool (d, "battery.rechargeable.is_discharging", is_discharging);
}
If I kill and restart hald, it gets the right values:
battery.rechargeable.is_charging = false (bool)
battery.rechargeable.is_discharging = true (bool)
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages hal depends on:
ii adduser 3.105 add and remove users and groups
ii dbus 1.1.2-1 simple interprocess messaging syst
ii hal-info 20071212-2 Hardware Abstraction Layer - fdi f
ii libc6 2.7-6 GNU C Library: Shared libraries
ii libdbus-1-3 1.1.2-1 simple interprocess messaging syst
ii libdbus-glib-1-2 0.74-1 simple interprocess messaging syst
ii libexpat1 1.95.8-4 XML parsing C library - runtime li
ii libgcc1 1:4.3-20080127-1 GCC support library
ii libglib2.0-0 2.14.5-2 The GLib library of C routines
ii libhal-storage1 0.5.10-5 Hardware Abstraction Layer - share
ii libhal1 0.5.10-5 Hardware Abstraction Layer - share
ii libsmbios1 0.13.10-1 Provide access to (SM)BIOS informa
ii libstdc++6 4.3-20080127-1 The GNU Standard C++ Library v3
ii libusb-0.1-4 2:0.1.12-9 userspace USB programming library
ii libvolume-id0 0.114-2 libvolume_id shared library
ii lsb-base 3.1-24 Linux Standard Base 3.1 init scrip
ii mount 2.13.1-1 Tools for mounting and manipulatin
ii pciutils 1:2.2.9-2 Linux PCI Utilities
ii pm-utils 0.99.2-3 utilities and scripts for power ma
ii udev 0.114-2 /dev/ and hotplug management daemo
ii usbutils 0.73-5 Linux USB utilities
Versions of packages hal recommends:
ii eject 2.1.5-6 ejects CDs and operates CD-Changer
ii libsmbios-bin 0.13.10-1 Provide access to (SM)BIOS informa
-- no debconf information
--
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20080202/a259008e/attachment.pgp
More information about the Pkg-utopia-maintainers
mailing list