Page MenuHomeFreeBSD

Make battery emptying rate available as sysctl variable
ClosedPublic

Authored by freebsdnewbie_freenet.de on Sep 8 2018, 9:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 5:17 AM
Unknown Object (File)
Mon, Apr 8, 8:10 AM
Unknown Object (File)
Sun, Mar 31, 9:30 AM
Unknown Object (File)
Feb 5 2024, 12:00 PM
Unknown Object (File)
Dec 18 2023, 8:40 AM
Unknown Object (File)
Dec 13 2023, 11:01 PM
Unknown Object (File)
Dec 10 2023, 7:26 PM
Unknown Object (File)
Dec 2 2023, 3:34 AM

Details

Summary

The emptying rate of a battery is an interesting value for monitoring the laptops current status. This patch makes it available as a sysctl variable.

Test Plan

sysctl hw.acpi.battery.rate
hw.acpi.battery.rate: 5846

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think this diff is probably fine. In general the 'acpiconf -i <x>' interface tends to be more informative, and userland applications wanting to query battery info should be using the ACPIIO_BATT_* ioctls instead of sysctls.

My intention was to simplify the querying of current rate mainly for scripts and userland programs. Using acpiconf -i <x> in a script occured a bit cumbersome to me because for more than one battery, one has to iterate over the result of hw.acpi.battery.units and parse the acpiconf's output to get the actual rate.
Also, the most (hm, i think actually all) FreeBSD compatible monitors which sources i've seen were using the sysctls interface and not the ACPIIO_BATT_* ioctls, so there would be a lower threshold to add the information about current rate.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 30 2018, 12:19 AM
This revision was automatically updated to reflect the committed changes.