ipmbsensor fix errors / thresholds
Make the sensor set the lowest possible value when
multiple read errors occur. Also fix the sensor threshold
settings based on the spec:
A high-going threshold has its assertion events become set when the
reading is >= the threshold, while for a low-going event the assertion
becomes set when the reading is <= the threshold.
Tested: fans boosted after putting me in recovery
Change-Id: I0fc9edafb57afa61cf68124eec5d124cdbb51983
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index fe5537f..2bd62a0 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -231,7 +231,7 @@
{
if (threshold.direction == thresholds::Direction::HIGH)
{
- if (value > threshold.value)
+ if (value >= threshold.value)
{
thresholdChanges.push_back(std::make_pair(threshold, true));
}
@@ -242,7 +242,7 @@
}
else
{
- if (value < threshold.value)
+ if (value <= threshold.value)
{
thresholdChanges.push_back(std::make_pair(threshold, true));
}