ACPI time remaining

David Zeuthen david at fubar.dk
Mon Feb 7 11:07:50 PST 2005


On Mon, 2005-02-07 at 18:57 +0000, Richard Hughes wrote:
> After studying the battstat source, I've found a property that we don't
> currently export, and need to.
> 
> #cat /proc/acpi/battery/BAT1/state
> present rate:            25822 mW
> 
> For this we need a battery.rechargeable.rate (int) key in HAL.
> 

Not sure APM exports this. Better make this optional.

> With this, we can do:
> 
> Time to discharge (m) = remaining (mWh) / rate (mW) * 60
> Time to charge (m) = (max_capacity (mWh) - remaining) / (rate * 60)
> 

Which looks like one approximation, sure let's go for that to begin
with.

> Also on the topic, what about making the key
> *battery.charge_level.percentage* mandatory? It would make the
> applications much easier to code, and we could always rely on this value,
> and not have to have "special cases" for things (the whole idea of an
> abstract interface...)

No, I think it's just current/maximum, something most applications
should be expected to do :-)

> 
> Note: this is quite a simple formula. My ideas are changing about the
> battery.time_to_discharge idea. Maybe it should be in the HAL addon. 

You need to poll for battery status on ACPI anyway, so just put it in
the main hald code for now.

> If
> APCI, PMU and APM have it, then maybe it should be in the spec. Comments?
> 

Sure, got a patch? :-)

Cheers,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list