Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2014 17:39:56 +0200
From:      CeDeROM <cederom@tlen.pl>
To:        David Wolfskill <david@catwhisker.org>, freebsd-hackers@freebsd.org,  freebsd-acpi@freebsd.org
Subject:   Re: sysctl hw.acpi.acline
Message-ID:  <CAFYkXjnciV1zUr4Us9U_=m7q9EjWhjLEjye-ttQaSo2Mt__q3w@mail.gmail.com>
In-Reply-To: <20140616153254.GE1187@albert.catwhisker.org>
References:  <CAFYkXj=cN=A7ZRs-N5xoER51=daMaaS4uBCQLpfnOC0=Mg0WuA@mail.gmail.com> <20140616153254.GE1187@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 16, 2014 at 5:32 PM, David Wolfskill <david@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjnciV1zUr4Us9U_=m7q9EjWhjLEjye-ttQaSo2Mt__q3w>