vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, while having much fun with programming my 9238743th mini-test-app with reading sensors, I came upon a few ambiguities. Since there are no examples to be found for a handful of sensor types, declaring their value to carry a certain unit is probably mostly an academic (though important-to-me) issue at this point. I propose the following patch, just in case I made the right assumptions: ---- snip ---- Index: sensors.h ================================================== ================= RCS file: /cvs/src/sys/sys/sensors.h,v retrieving revision 1.18 diff -u -p -r1.18 sensors.h --- sensors.h 3 Jul 2006 21:17:37 -0000 1.18 +++ sensors.h 6 Jul 2006 17:44:52 -0000 @@ -34,17 +34,17 @@ enum sensor_type { SENSOR_FANRPM, /* fan revolution speed */ SENSOR_VOLTS_DC, /* voltage (muV DC) */ SENSOR_VOLTS_AC, /* voltage (muV AC) */ - SENSOR_OHMS, /* resistance */ - SENSOR_WATTS, /* power */ + SENSOR_OHMS, /* resistance (muOhm) */ + SENSOR_WATTS, /* power (muW) */ SENSOR_AMPS, /* current (muA) */ - SENSOR_WATTHOUR, /* power capacity */ - SENSOR_AMPHOUR, /* power capacity */ + SENSOR_WATTHOUR, /* power capacity (muWh) */ + SENSOR_AMPHOUR, /* power capacity (muAh) */ SENSOR_INDICATOR, /* boolean indicator */ SENSOR_INTEGER, /* generic integer value */ SENSOR_PERCENT, /* percent */ SENSOR_LUX, /* illuminance (mulx) */ SENSOR_DRIVE, /* disk */ - SENSOR_TIMEDELTA /* system time error (mSec) */ + SENSOR_TIMEDELTA /* system time error (nSec) */ }; #define SENSOR_DRIVE_EMPTY 1 ---- snap ---- A few comments: * SENSOR_OHMS: muOhms ... I suppose that's not far off of superconductivity. For consistency reasons, muOhms still make sense. 9223 gigaohm fit in there, I think that's enough...? * _WATTS and _*HOUR: mu/micro stuff simply makes sense here. * SENSOR_TIMEDELTA: I think this comment is plain wrong -- I highly doubt it returns values in milliseconds. If sysctl(8) is doing it right, then it's nanoseconds. (No timedelta devices in my vicinity to try it.) Moritz |