Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2019 23:15:13 -0700
From:      Kevin Oberman <rkoberman@gmail.com>
To:        Takanori Watanabe <takawata@init-main.com>
Cc:        Namkhai Bourquin <namkhai.n3@protonmail.com>,  "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org>
Subject:   Re: ACPI battery states
Message-ID:  <CAN6yY1ubYwAJh_y_kZaq7PmmzSC7y6XmWhEqsoC5Cu72C6Luww@mail.gmail.com>
In-Reply-To: <CAN6yY1txwuLyftO7yxfC4hQfN_ES9UwHjXKoS=p4L1CsGAav6A@mail.gmail.com>
References:  <8Hee8PdEep7hhBhELnaZ4c6FiJWkyOu4FGkuuGZ78BNs0r3SNb7IUrnBsHnc02VaiZNvQpWTkpVzu3QVo9faex3JljL2qP4fpcjxTrjYZRY=@protonmail.com> <20191024021908.GA54003@sana.init-main.com> <CAN6yY1txwuLyftO7yxfC4hQfN_ES9UwHjXKoS=p4L1CsGAav6A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Also, "acpiconf -i battnum" will tell you most eeverything you wanted to
know about the batteries. If you have only a single battery, battnum is '0'.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683


On Wed, Oct 23, 2019 at 10:50 PM Kevin Oberman <rkoberman@gmail.com> wrote:

> "apm -b" reports state. See "man 8 apm".
> --
> Kevin Oberman, Part time kid herder and retired Network Engineer
> E-mail: rkoberman@gmail.com
> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
>
>
> On Wed, Oct 23, 2019 at 9:11 PM Takanori Watanabe <takawata@init-main.com>
> wrote:
>
>> On Thu, Oct 24, 2019 at 01:31:01AM +0000, Namkhai Bourquin via
>> freebsd-acpi wrote:
>> > Hi all! I'm writing a script to get battery status and capacity, and
>> I'm using hw.acpi.battery for that. But I can't find a reference as to
>> which states hw.acpi.battery.state supports. Not in DuckDuckGo, nor google,
>> nor the mailing lists archive, nothing. I only managed to discover this by
>> discharging the battery and monitoring:
>> > state: 0 = unknow?
>> > state: 1 = discharging
>> > state: 2 = charging
>> > state: 5 = discharging critical (life < 6)
>> > state: 4 = same as 0, but with critical charge?
>> > state: 6 = charging critical
>>
>> This is originally raw value of _BST which is specific ACPI method for
>> control method battery, but smart battery device also simulate it.
>>
>> The bit macro is in /usr/include/dev/acpica/acpiio.h .
>>
>> #define ACPI_BATT_STAT_DISCHARG         0x0001
>> #define ACPI_BATT_STAT_CHARGING         0x0002
>> #define ACPI_BATT_STAT_CRITICAL         0x0004
>>
>>
>> > I can't find anything on the man pages either.
>> > Should this be documented, either on a man page or the sysctl's tunable
>> description?
>>
>> It will be good.
>>
>>
>>
>> _______________________________________________
>> freebsd-acpi@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-acpi
>> To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org"
>>
>



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