Feature requests for hal battery backend.

David Zeuthen david at fubar.dk
Mon Aug 1 11:03:50 PDT 2005


On Mon, 2005-08-01 at 04:15 -0400, Ryan Lortie wrote:
> A patch to implement the second half of the feature requests is
> attached.
> 
> This patch is 100% completely untested so it might segfault hal on
> startup.  I have no way to test it as my laptop isn't ACPI (Powerbook
> here, too).
> 
> All I can say is "it compiles" and "the rough idea is there". :)
> 
> Please test it out and give feedback.

A few comments

 - should probably use something else than battery.remaining_time,
   suggest battery.combined_remaining_time which is exactly the
   combined time of all available batteries. Need small patch for 
   the spec too to spell this out.

 - Suggest to just searching for batteries by capability rather than
   keeping a list around as Richard suggests (there is no IPC involved
   here). Also put this function in the common code so it can be
   reused for other things than ACPI. Need to check that battery.type
   is 'primary' to avoid UPS's and wireless mice.

 -  +	int am_discharging = 0;
    +	int am_charging = 0;
    +	int total_rate = 0;

    should use gboolean here.

Cheers,
David


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



More information about the Hal mailing list