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)
Wed, Dec 4, 11:58 AM
Unknown Object (File)
Oct 18 2024, 7:47 PM
Unknown Object (File)
Sep 18 2024, 9:51 AM
Unknown Object (File)
Sep 16 2024, 4:53 AM
Unknown Object (File)
Sep 4 2024, 7:45 PM
Unknown Object (File)
Sep 3 2024, 1:25 PM
Unknown Object (File)
Aug 19 2024, 1:54 PM
Unknown Object (File)
Aug 19 2024, 1:09 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.