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
F110427679: D17077.diff
Tue, Feb 18, 8:03 AM
Unknown Object (File)
Thu, Feb 6, 4:27 PM
Unknown Object (File)
Sat, Jan 25, 7:55 PM
Unknown Object (File)
Sat, Jan 25, 7:19 PM
Unknown Object (File)
Jan 12 2025, 10:58 PM
Unknown Object (File)
Dec 30 2024, 8:07 PM
Unknown Object (File)
Dec 28 2024, 5:07 PM
Unknown Object (File)
Dec 4 2024, 11:58 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 Skipped
Unit
Tests Skipped

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.