acpi battery rework patch

Nate Lawson nate at root.org
Tue Jul 26 19:11:38 GMT 2005


Jeremie Le Hen wrote:
> Hi Nate,
> 
> 
>>>- Battery:
>>>hw.acpi.battery.life: 87
>>>hw.acpi.battery.time: 103
>>>hw.acpi.battery.state: 1
>>
>>Completely fine.  Time should be -1 (unknown) while on AC power.  And 
>>state is "discharging" when on battery.
>>
>>
>>>- AC:
>>>hw.acpi.battery.life: 70
>>>hw.acpi.battery.time: -1
>>>hw.acpi.battery.state: 2
>>
>>This is fine.  On AC power and state is charging.
>>
>>
>>>- Battery:
>>>hw.acpi.battery.life: 70
>>>hw.acpi.battery.time: 125
>>>hw.acpi.battery.state: 1
>>
>>Time is valid and state is "discharging".
> 
> 
> Where are these states documented ?  What do you think of the idea of
> using the following as a description for the hw.acpi.battery.state
> sysctl ?
>     "0: battery full, 1: discharging, 2: charging"

Currently in the acpiio.h header.  Changing it to a string is a problem 
since multiple flags can be active at once, i.e. "discharging" + 
"critical".  The apm(8) utility does a good job of parsing these so 
perhaps the same code could be used in the sysctl.

-- 
Nate


More information about the freebsd-current mailing list