Re: Battery charging state: unknown

Duncan Gibb
2002-11-09T17:02:37Z

On Fri, 2002-11-08 at 12:16, joerg.beyer-htSm2yLGOjU@public.gmane.org wrote:
> Daniel Hoffend <mail-nf-Mmb7MZpHnFY@public.gmane.org> schrieb am 07.11.02 23:09:43:

DH> /proc/acpi/battery/BAT1/state shows that there is an
DH> unknown charging stage

JB> I get this, when the Laptop is connected to power supply _and_
JB> is fully charged.

I thought this was odd too. There are two relevant bits in the battery
status reply, bit 0 for discharging, bit 1 for charging. The code does
this:

if ((bst->state & 0x01) && (bst->state & 0x02))
p += sprintf(p, "charging state: charging/discharging\n");
else if (bst->state & 0x01)
p += sprintf(p, "charging state: discharging\n");
else if (bst->state & 0x02)
p += sprintf(p, "charging state: charging\n");
else
p += sprintf(p, "charging state: unknown\n");

IMHO "unknown" is likely to worry people, when "not charging" can happen
for a number of reasons - eg: the battery is full, or there is another
battery in the system which is being used/charged in preference to this
one.

Dunno whether there are userland progs which rely on the existing code,
though.

Duncan

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.