[patch] pmu patch

David Zeuthen david at fubar.dk
Thu Feb 3 21:38:07 PST 2005


On Thu, 2005-02-03 at 20:16 +0100, Sjoerd Simons wrote:
> > Within a few milliseconds you expect this to change? It really
> > looks like a non-issue to me.
> 
> Yes, i do.. And it will, not often, but stil..

Oh well. OK, on the topic of batteries, I just added support
for reading values of UPS'es supporting the USB HID protocol,
look here

 http://people.redhat.com/davidz/hal-hid-ups.png

and with my addon, that doesn't poll but use async notification,
through the /dev/hiddev0 device file, the charge_level.current
and charge_level.remaining_time isn't updated at the same time
either - there's like a second in between.

(the support is not completely baked; right now one needs to
start the add-on manually (as root cause it needs access to
the /dev/hiddev0 or whatever file), but I'll fix this tomorrow
and then we can get Sergey's code in for wireless mice
batteries)

> Then you haven't looked good enough to my implementation. The battery only
> needs one file for all the info. Will sent a patch for your code then...

Oh ok. Thanks.
 
> > Anyway, feel free to send a patch against hald/linux2/util.[ch] and that
> > provides the utility needed if you want to improve this. I suppose
> > (because everything is single threaded) that you could make a
> > 
> >  hal_util_grep_file_use_existing_file (gboolean use_existing_file);
> > 
> > to make hal_util_grep_file not reload the file if it's the same. You
> > would then enclose the existing code around those.
> 
> Will do.. I'm a little sick currently, so it will take some time :)

OK, hope you'll get better soon.

> > Also, I don't want to spend time fixing bugs on those (since I
> > maintain that it's something you want in a higher-level app and I
> > expect people to complain about it), so if you want to do this, 
> > you're going to need to commit to maintaining that piece of 
> > code. Is that fair enough?
> 
> Yep fair enough. Will do :) Or at least for the pmu parts 
> 

Uhmm... so will I :-)

So, I just added this for USBHID UPS's since the hardware and
protocol obviously got brains enough to let the device tell
us this. The property is called battery.remaining_time and is
measured in seconds. So for APM we need to convert from minutes
etc. etc.

Cheers,
David


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



More information about the Hal mailing list