Rate guessing code

Søren Hansen sh at linux2go.dk
Wed Nov 2 11:33:17 PST 2005


ons, 02 11 2005 kl. 19:25 +0000, skrev Richard Hughes: 
> > I've discussed this a bit with DannyK on IRC today. Please take a peek
> > at it and comment.
> What does it do, and how does it work? Thanks.

Oh, right. :-)

Some laptops don't provide the rate information, but that's not reason
for HAL not to provide it. That's what this change does. The first time
around it stores the chargeLevel. On each subsequent run it uses the
chargeLevel from the previous run to determine the rate at which it
drops (during discharge) or rises (during charge).. That info is passed
on to the time calculation code and voila!

It stores the info about each battery in a hashmap with the udi as key,
so it also supports multiple batteries.

-- 
| Søren Hansen    | Linux2Go                  | http://Linux2Go.dk/ |
| Seniorkonsulent | Lindholmsvej 42, 2. TH    | +45 46 90 26 42     |
| sh at linux2go.dk  | 9400 Nørresundby, Denmark | GPG key: E8BDA4E3   |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dette er en digitalt underskrevet brevdel
Url : http://lists.freedesktop.org/archives/hal/attachments/20051102/c6c0e697/attachment.pgp


More information about the hal mailing list