monitor: Use the number of failed tach sensors at startup
When marking a fan nonfunctional due to its tach sensors failing
to be read from dbus, a check against the configured number of
sensors that should result in the fan being marked as nonfunctional
should be checked.
Tested:
Run phosphor-fan-monitor --monitor in witherspoon qemu,
when the number of failed tach sensor is larger than the
configured _numSensorFailsForNonFunc then mark the
associated fan as nonfunctional.
Change-Id: I6ff97b9aae4279d6ce402d3aecda087d45dfa318
Signed-off-by: Jolie Ku <jolie_ku@wistron.com>
diff --git a/monitor/fan.hpp b/monitor/fan.hpp
index 5136cee..603be10 100644
--- a/monitor/fan.hpp
+++ b/monitor/fan.hpp
@@ -181,6 +181,11 @@
const size_t _numSensorFailsForNonFunc;
/**
+ * The number of failed sensors
+ */
+ size_t _numFailedSensor = 0;
+
+ /**
* @brief The current functional state of the fan
*/
bool _functional = true;