summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-11-22 14:52:12 -0600
committerMatthew Barth <msbarth@us.ibm.com>2017-11-27 14:45:36 -0600
commit5856023d05c6b26020675cce5ce6eca85460bec2 (patch)
treec63b72098ad74c004e4692f7c66f954dfa1e5d09
parent0081fdb82a487cbe48a467bc87484f79085a00b5 (diff)
downloadphosphor-fan-presence-5856023d05c6b26020675cce5ce6eca85460bec2.tar.gz
phosphor-fan-presence-5856023d05c6b26020675cce5ce6eca85460bec2.zip
Update trust group sensor timer start
Trust group sensors' timers should only start when the sensor is currently functional and its target and input do not match. This handles the case where a sensor within a trust group does not get a target set resulting in both the target and input to be zero. At anytime a sensor's target and input are equal, the timer to mark them as nonfunctional should not start. Change-Id: I8e4fd33a5bcbd25854e5954b41646127982eedd3 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
-rw-r--r--monitor/trust_group.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/monitor/trust_group.hpp b/monitor/trust_group.hpp
index af7b372..e0db5c9 100644
--- a/monitor/trust_group.hpp
+++ b/monitor/trust_group.hpp
@@ -112,7 +112,8 @@ class Group
}
/**
- * Starts the timers on all functional sensors in the group.
+ * Starts the timers on all functional sensors in the group if
+ * their target and input values do not match.
*
* Called when the group just changed to trusted.
*/
@@ -125,7 +126,9 @@ class Group
{
//If a sensor isn't functional, then its timer
//already expired so don't bother starting it again
- if (s.get()->functional())
+ if (s.get()->functional() &&
+ static_cast<uint64_t>(s.get()->getInput()) !=
+ s.get()->getTarget())
{
s.get()->startTimer();
}
OpenPOWER on IntegriCloud