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>
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 @@
}
/**
- * 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 @@
{
//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();
}