ACPI/PMU procfs HAL test program. Version 002.

Danny Kukawka danny.kukawka at web.de
Mon Jan 24 02:05:03 PST 2005


Hello!
On Monday 24 January 2005 08:26, Richard Hughes wrote:
> Brilliant, thanks. If you have a few minutes, and you are feeling
> athletic, could you add properties for your machine that I have not
> covered like:
>
> system.processor.maximum_speed
> battery.type
> battery.charge_level.maximum.real
> battery.charge_level.current
> battery.charge_level.unit
>
> Thanks, Richard.

I think this isn't a really good idea to poll /proc/acpi/battery/BAT0/state. 
Polling  /proc/acpi/battery/BAT0/state produce significantly systemload, 
because the kernel must poll the battery and this can need much time. Above 
all, if it happens regularly (every second or more frequently) or if the 
laptop is on battery.

I think it's maybe better to use a deamon to send the informations about the 
battery states to HAL. I planed to do this for the powersave daemon [1] and 
kpowersave [2] in the next time. (powersave poll the battery only each 
minute,  the values do not change also faster.) It's better to send the 
needed values from powersave to HAL (So we need only send messages if 
something changed.) or to poll the info from powersave.

Powersave could send this battery related informations to HAL:

 	acadapter.online
        acadapter.offline

        battery.normal
        battery.warning
        battery.low
        battery.critical

	battery.charge_level.unit
	battery.charge_level.current
	battery.charge_level.maximum.real 

(estimated values if 'present rate' unknown: )

	battery.charge.remainig.time 			
	battery.charge.remainig.percent
	battery.discharge.remainig.time
	battery.discharge.remainig.percent

What do you think? Comments please.

Danny


[1] http://sourceforge.net/projects/powersave/
[2] http://freshmeat.net/projects/kpowersave
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list