[Nut-upsdev] Developing the UPS side of the UPS-NUT equation (via usbhid)
Rob Groner
rgroner at RTD.com
Tue Mar 18 14:37:55 UTC 2014
Things are going along well, but there is one remaining area of confusion...."units". I understand exponents now...it's basically how you pass decimal values. That's easy enough.
But "units"....in other words, I have a voltage I want to put in a report. If I include in the report descriptor the fact that it is actually a voltage, with units of "volts", then I'm suddenly also inheriting an exponent of 7? So to represent 120 volts, I'd actually have to send the value 1200000000, so that on the NUT side it would apply a -7 exponent to get it to come out as 120?
I know I could add a -7 exponent to "counteract" the units exponent, but I'm trying to understand WHY it's like this, based on the table in 3.2.3 of the PDC HID doc. Why did they think that volts needs an exponent of 7 in them?
I also noticed that current (amps) is listed as centiAmp, with a -2 unit exponent in the HID doc....however, the table in libhid.c which contains HIDUnits does not include anything for amps, just voltage and power.
I'm wondering if there is even any real value in specifying units, because it seems like more of an obstacle to easy value understanding than anything else. Any why does the NUT library use the 7 exponent for voltages, but not the -2 for amps?
Thanks as always.
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20140318/19da8818/attachment.html>
More information about the Nut-upsdev
mailing list