*** Please type your report below this line ***
The chargeStatus flag was being extracted from the APM batteryStatus field
instead of the batteryFlag field. The two fields have virtually the same
structure and the first 4 bits _should_ report the same information, but
they do not.
My bios reports an APM version of 1.2 whereas the ibam source suggests the
APM version field is "Usually 1.0 or 1.1", so I guess this could be a
change in the APM spec for v1.2... However, since the OP reported that
this problem began recently on his machine I assume that it is a
change/regression in the kernel support (unless he updated his bios).
Unfortunately I haven't run anything but kernel 2.6.18 on this machine so I
can't tell you when/if the kernel behavior changed.
The attached patch changes the test to use the batteryFlag field. This
should be completely backwards compatible, even if the kernel support did
change. (Unless it was broken the other way around before?)
-- Brad
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (1000, 'testing'), (80, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages ibam depends on:
ii debconf [debconf-2.0] 1.5.13 Debian configuration management sy
ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries
ii libgcc1 1:4.1.1-21 GCC support library
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
ibam recommends no packages.
-- no debconf information
--- ibam-0.4/ibam.inl 2005-11-12 05:36:58.000000000 -0500
+++ ibam-0.4-fixed/ibam.inl 2007-03-30 15:33:31.000000000 -0400
@@ -133,7 +133,7 @@
in >> c >> d; // 0x
in >> c >> d;
batteryFlag=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0');
- chargeStatus = (batteryStatus&8)!=0;
+ chargeStatus = (batteryFlag&8)!=0;
in >> remainingBatteryPercent >> c; // %
string minsec;
in >> remainingBatteryLifeSeconds >> minsec;