From 5856023d05c6b26020675cce5ce6eca85460bec2 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 22 Nov 2017 14:52:12 -0600 Subject: 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 --- monitor/trust_group.hpp | 7 +++++-- 1 file 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(s.get()->getInput()) != + s.get()->getTarget()) { s.get()->startTimer(); } -- cgit v1.2.1