openbmc/phosphor-host-ipmid

[Bug]ipmitool sensor cannot present correct values

justin0309 opened this issue · 0 comments

When I set CRITLO_temp1 to negative numbers in the conf under phosphor-hwmon, the correct values ​​are displayed on dbus, but values ​​less than 0 cannot be displayed through the ipmitool sensor.
The result of my own experiment is that when the value is less than 0, it will be set to 0.

image
image

In addition, I set the values ​​of MINVALUE_temp1 and MAXVALUE_temp1 but non-Recoverable still shows NA.

Because our temperature threshold supports negative numbers, it seems that it is because the type of param lowerCritical is uint8_t. Even if the type set in ipmi sensor.yaml is double, no negative numbers will be generated.
[ * @param lowerCritical - Lower critical threshold](https://github.com/openbmc/phosphor-host-ipmid/blob/68d9d40530351e3f3db2c00a25969b0efc9fbe3f/sensorhandler.cpp#L787)](https://github.com/openbmc/phosphor-host-ipmid/blob/68d9d40530351e3f3db2c00a25969b0efc9fbe3f/sensorhandler.cpp#L787)