From: Jan S. <jsa...@re...> - 2009-03-31 11:02:00
|
'ipmitool sensor list' shows 'status' of discrete sensors as 16 bit hexadecimal number. The standard says, that the 7 bit of the second byte should be always set to 1 and should not be interpreted, therefore it's meaningless to show it. It only confuses readers. BTW, should be the output of octets data[2] and data[3] switched to show state bits 8-14 first? --- lib/ipmi_sensor.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c index 9d11f5a..d71485f 100644 --- a/lib/ipmi_sensor.c +++ b/lib/ipmi_sensor.c @@ -177,6 +177,9 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf, val = rsp->data[0]; } + /* clear the useless status bit */ + rsp->data[3] &= (0xFF - 0x80); + if (csv_output) { /* NOT IMPLEMENTED */ } else { @@ -515,6 +518,9 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf, val = rsp->data[0]; } + /* clear the useless status bit */ + rsp->data[3] &= (0xFF - 0x80); + if (csv_output) { /* NOT IMPLEMENTED */ } else { |