[patch] addon-hid-ups.c : battery.present is mandatory for HAL spec

Richard Hughes hughsient at gmail.com
Sun May 8 23:39:05 PDT 2005


On Mon, 2005-05-09 at 00:01 -0400, David Zeuthen wrote:
> On Sun, 2005-05-08 at 21:53 +0100, Richard Hughes wrote:

<snip>

> If the property battery.remaining_time is available (it's optional) it
> always mean number of seconds. I don't believe we set any other
> battery.* properties related to this - can you clarify please?

>From HAL spec:

battery.remaining_time (int) No Remaining time, in seconds, that the
battery can provide power if it's discharging. This is an estimate and
may be imprecise.

I assumed this was in minutes, *my* error, sorry for the noise.

On an unrelated note, how keen are you to put the battery.remaining_time
calculations inside addon-acpi.c? At the moment it does not calculate
this value and leaves it to the application (which is okay, since it's
non-compulsory...).

I've looked about on the Internet and there appears to be one standard
formula for charge/rate/last-full type calculations - I believe our
original argument for not including the formula was that an application
may have a "better" way of doing it. Maybe we should provide the
"standard" answer?

It's not that much hassle to work it out in an application, but takes
away some of the nice abstraction (if battery = ACPI/ if battery = PMU
is needed...) and would IMO be better put in the addon itself. 

Comments please :-)

Richard.

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



More information about the Hal mailing list