sysctl hw.acpi.acline

CeDeROM cederom at tlen.pl
Mon Jun 16 15:39:57 UTC 2014


On Mon, Jun 16, 2014 at 5:32 PM, David Wolfskill <david at catwhisker.org> wrote:
> On Mon, Jun 16, 2014 at 04:36:42PM +0200, CeDeROM wrote:
>> ...
>> How can I tell the power source on my FreeBSD (i.e. AC, Battery, UPS)?
>>
>> man acpi:
>> ...
>>      hw.acpi.acline
>>              AC line state (1 means online, 0 means on battery power).
>> ....
>
> From the perspective of the running system, you should not be able to
> tell (merely from the state of the power supply, at least) whether power
> is being supplied by UPS or "house wiring".
>
> You can make that distinction by querying the state of a UPS, if one is
> connected (and set up to provide power to the system in question).

I am porting from Linux code that use "/sys/class/power_supply/type"
and can tell "Mains", "UPS", or "Battery". It would be nice if FreeBSD
had something similar :-)

>From ACPI manual it seems that "hw.acpi.acline" shoud do the job, but
this OID is not available on desktops.. and this is not noted anywhere
that "hw.acpi.acline" is only available on a laptops.. so I am not
sure if my code should depend on this OID and if this is a bug?

Thanks! :-)
Tomek

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


More information about the freebsd-acpi mailing list