Update threshold checking comparison operators
Change sensors threshold value checking to less/greater than or equal
Resolves openbmc/openbmc#2531
Change-Id: I4f177f583c95ffd278d696d053644c453d03ab7b
Signed-off-by: Chiabing Lee <chiabinglee@gmail.com>
diff --git a/thresholds.hpp b/thresholds.hpp
index 3bb3f7a..96d4b75 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -61,8 +61,8 @@
(iface);
auto lo = (*realIface.*Thresholds<T>::getLo)();
auto hi = (*realIface.*Thresholds<T>::getHi)();
- (*realIface.*Thresholds<T>::alarmLo)(value < lo);
- (*realIface.*Thresholds<T>::alarmHi)(value > hi);
+ (*realIface.*Thresholds<T>::alarmLo)(value <= lo);
+ (*realIface.*Thresholds<T>::alarmHi)(value >= hi);
}
/** @brief addThreshold
@@ -99,8 +99,8 @@
auto hi = stoll(tHi);
(*iface.*Thresholds<T>::setLo)(lo);
(*iface.*Thresholds<T>::setHi)(hi);
- (*iface.*Thresholds<T>::alarmLo)(value < lo);
- (*iface.*Thresholds<T>::alarmHi)(value > hi);
+ (*iface.*Thresholds<T>::alarmLo)(value <= lo);
+ (*iface.*Thresholds<T>::alarmHi)(value >= hi);
auto type = Thresholds<T>::type;
obj[type] = iface;
}