sysctl hw.acpi.acline
CeDeROM
cederom at tlen.pl
Tue Jun 17 06:18:48 UTC 2014
On Tue, Jun 17, 2014 at 2:29 AM, John-Mark Gurney <jmg at funkthat.com> wrote:
> CeDeROM wrote this message on Tue, Jun 17, 2014 at 00:25 +0200:
>> On Tue, Jun 17, 2014 at 12:10 AM, Anthony Jenkins
>> <Anthony.B.Jenkins at att.net> wrote:
>> > The absence of hw.acpi.battery and child oids probably implies there is no battery and the system may be assumed to be on line (A/C) power.
>>
>> Hello Anthony! I would prefer to have that information clearly defined
>> in the manual :-) I guessed that this is a quick fix to first check
>
> Which manual?
man acpi
> ACPI have tons of optional stuff that isn't required to be present,
> and apparently acline is one of them. Also, acline is only useful
> if there are multiple power sources, what if you have a desktop
> machine always running off a battery, if we defaulted acline=1, then
> you'd complain that the status is wrong... :)
There is no information in the ACPI Manual that the OID's are optional
and may not exist in some cases. This is exactly the problem, an
undefined and undocumented situation. Maybe its just worth putting a
note :-)
"
hw.acpi.acline
AC line state (1 means online, 0 means on battery power).
"
I expect code based on this oid to work on both desktop and laptop
with no additional guessing. For me this manual information means that
acline oid is always available, and will show 1 in case of desktop
where no battery (maybe no UPS as well) is available. There is no
information that this oid is optional. For desktop/server a battery
power would mean UPS, right, so then I would also expect to see the
battery charge status information.. but I understand this would be
more complicated than in a laptop thus may not be implemented. Still,
I would always expect power source type OID to tell me what is the
power source, even if there can be only one.
Best regards :-)
Tomek
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
More information about the freebsd-acpi
mailing list