mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Do not use readings for sensors with Sensor Scanning bit cleared
This commit is contained in:
parent
e7f7209c32
commit
e3c97ddd3d
@ -1038,14 +1038,6 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
|
||||
/* Sensor Scanning Disabled */
|
||||
validread = 0;
|
||||
if (rsp->data[0] != 0) {
|
||||
/* we might still get a valid reading */
|
||||
val =
|
||||
sdr_convert_sensor_reading(sensor,
|
||||
rsp->data[0]);
|
||||
if (val != 0.0)
|
||||
validread = 1;
|
||||
}
|
||||
} else if (rsp->data[0] != 0) {
|
||||
/* convert RAW reading into units */
|
||||
val = sdr_convert_sensor_reading(sensor, rsp->data[0]);
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
#define SCANNING_DISABLED 0x40
|
||||
#define READING_UNAVAILABLE 0x20
|
||||
|
||||
static
|
||||
@ -110,6 +111,8 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0 || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = rsp->data[0];
|
||||
@ -190,6 +193,8 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
|
||||
return -1;
|
||||
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = (rsp->data[0] > 0)
|
||||
@ -427,6 +432,8 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
|
||||
return -1;
|
||||
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = rsp->data[0];
|
||||
@ -771,6 +778,8 @@ ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
|
||||
continue;
|
||||
} else if (rsp->data[1] & READING_UNAVAILABLE) {
|
||||
continue;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
continue;
|
||||
} else if (rsp->data[0] > 0) {
|
||||
/* convert RAW reading into units */
|
||||
val = sdr_convert_sensor_reading(sdr->record.full, rsp->data[0]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user