summaryrefslogtreecommitdiff
path: root/util/isensor.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-08-13 17:26:48 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-08-13 17:26:48 +0200
commit64529036a8d742cc45f4b35085205c86ab46b5e0 (patch)
tree564ce1d693ed2c23a626262ac59d8a8d383856e8 /util/isensor.c
parent401b3073c7af7fe89dd70955ef4431da91cc3f29 (diff)
parentb95848947f99031ad56ed6220665bdb3658d8113 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'util/isensor.c')
-rw-r--r--util/isensor.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/util/isensor.c b/util/isensor.c
index 1f772bd..a204990 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -255,7 +255,7 @@ char *decode_entity_id(int id) {
* Global Data
************************/
static char *progname = "isensor";
-static char *progver = "3.05";
+static char *progver = "3.06";
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -655,17 +655,17 @@ char *get_unit_type(int iunits, int ibase, int imod, int fshort)
break;
}
if ((umod == 0) && (iunits > 0)) {
- /* special cases for other SensorUnits1 bits */
- if ((iunits & 0x01) != 0) { /*percentage*/
- if (fshort) pstr = "%";
- else pstr = "percent";
- } else if (iunits == 0xC0) { /*no analog reading*/
- pstr = "na";
- } else if (iunits == 0x18) {
- /* For Tyan fans: base=42, units=24.(0x18) -> cycles/hour */
- snprintf(unitstr,sizeof(unitstr),"%s/hour",punittypes[jbase]);
- pstr = unitstr;
- }
+ /* special cases for other SensorUnits1 bits */
+ if ((iunits & 0x01) != 0) { /*percentage*/
+ if (fshort) pstr = "%";
+ else pstr = "percent";
+ } else if (iunits == 0xC0) { /*no analog reading*/
+ pstr = "na";
+ } else if (iunits == 0x18) {
+ /* For Tyan fans: base=42, units=24.(0x18) -> cycles/hour */
+ snprintf(unitstr,sizeof(unitstr),"%s/hour",punittypes[jbase]);
+ pstr = unitstr;
+ }
}
return(pstr);
}
@@ -2650,6 +2650,7 @@ ShowSDR(char *tag, uchar *sdr)
sens[2],i,sens[0],sens[1],sdr01->sens_base,
sdr01->sens_units);
if ((sens[1] & 0x20) != 0) { i = 7; val = 0; } /* Init state */
+ else if (sdr01->sens_units == 0xC0) i = 42; /*reading NotAvailable*/
else if (sens[2] == 0xc7) { i = 10; val = 0; /* Absent (Intel) */
if (fdebug) printf("sensor[%x] is absent (c7), no reading\n",
sdr01->sens_num);