HAL battery backend, new thread!
Richard Hughes
hughsient at gmail.com
Mon Aug 1 08:33:22 PDT 2005
David,
I've attached the latest patch with the C99 fixes you asked for.
Danny, I've also made the changes you suggested (the
battery.charge_level.granularity_1 and others)
I hope you don't mind Ryan if we get this little part in before the
bigger changes. I'll test your patch out on my machine later, but you'll
appreciate I only have the one battery!
I've only included the functional part of the patch, (so we can apply it
now) and I'll follow this up with a separate patch to the
hal-spec.xml.in after we have bickered about the wording. :-)
Possible text for the ChangeLog:
hald/linux2/acpi.c (battery_refresh_poll, battery_refresh): convert the
current values from mAh to mWh (some laptops report in other than mWh)
by multiplying by the current voltage. This gives us "energy" units that
are not dependent on the current voltage of the battery.
This fixes the bug (http://bugzilla.gnome.org/show_bug.cgi?id=309944)
where the remaining time was being worked out with incorrect logic.
The util_compute_time_remaining and util_compute_percentage_charge
functions now take the sanitised values too.
This patch introduces the new keys battery.reporting.* representing the
raw values from ACPI. This will not change API for existing programs (as
the old charge_level keys are just re-used for the sanitised values).
A battery.charge_level.design key of "Unknown ACPI Unit" represents an
unknown unit that may have to be calculated like mAh.
Thanks (to all of you),
Richard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-mwh-04.diff
Type: text/x-patch
Size: 12577 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20050801/60367970/hal-mwh-04.bin
-------------- next part --------------
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list