On Wed, Jun 10, 2015 at 5:23 AM, Martin Pieuchot <m...@openbsd.org> wrote:
> On 02/06/15(Tue) 22:36, David Higgs wrote: > > Here are some new sensors for upd(4) devices. All exist on my device > except AtRateTimeToEmpty, which still seemed a logical addition given that > AtRateTimeToFull is already present. > > - AtRateTimeToEmpty > > - RunTimeToEmpty > > - NeedReplacement > > - Overload > > Nice. > > > If anyone had an AtRate sensor, it was probably producing meaningless > output. The relevant spec [0] indicates that these are in minutes, and my > device appears to be using seconds; the (previously unscaled) sensor value > expects nanoseconds! > > [0] http://www.usb.org/developers/hidpage/pdcv10.pdf > > > > And lastly, the NeedReplacement report has nothing to do with the System > Management Bus (SMB), so rename the constant. Nothing else in the tree > appears to use it, so hopefully this is safe. > > > > Feedback and lsusb -v output is welcome, as usual. > > Have you got any feedback from upd(4) users? > > Update, someone was nice enough to test my diff, output below. Looks nearly identical to my own APC device, which isn't too surprising. --david #### snip #### Sensors before $ sysctl hw.sensors.upd0 hw.sensors.upd0.indicator0=On (BatteryPresent), OK hw.sensors.upd0.indicator1=On (Charging), OK hw.sensors.upd0.indicator2=Off (Discharging), OK hw.sensors.upd0.indicator3=Off (ShutdownImminent), OK hw.sensors.upd0.indicator4=On (ACPresent), OK hw.sensors.upd0.percent0=95.00% (RemainingCapacity), OK hw.sensors.upd0.percent1=100.00% (FullChargeCapacity), OK and after $ sysctl hw.sensors.upd0 hw.sensors.upd0.indicator0=On (BatteryPresent), OK hw.sensors.upd0.indicator1=On (Charging), OK hw.sensors.upd0.indicator2=Off (Discharging), OK hw.sensors.upd0.indicator3=Off (NeedReplacement), OK hw.sensors.upd0.indicator4=Off (ShutdownImminent), OK hw.sensors.upd0.indicator5=On (ACPresent), OK hw.sensors.upd0.indicator6=Off (Overload), OK hw.sensors.upd0.percent0=93.00% (RemainingCapacity), OK hw.sensors.upd0.percent1=100.00% (FullChargeCapacity), OK hw.sensors.upd0.timedelta0=1275.000000 secs (RunTimeToEmpty), OK $ dmesg | tail -n 3 uhidev2 at uhub2 port 4 configuration 1 interface 0 "American Power Conversion Back-UPS CS 500 FW:808.q8.I USB FW:q8" rev 1.10/0.06 addr 2 uhidev2: iclass 3/0, 98 report ids upd0 at uhidev2