monitor: Enhance tracing of fan & tach sensor states
Moved the determination of the allowed range of speeds of a tach sensor
from the fan to the tach sensor. Also changed the check for too many
nonfunctional tach sensors to return the count of nonfunctional tach
sensors of a fan so that this could be added to the tracing for when a
fan's functional state is updated.
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Change-Id: Id65b8064d203bcc63a70f33d4783706e5cc07d2f
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 88c8547..4a09f17 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -7,6 +7,7 @@
#include <sdeventplus/utility/timer.hpp>
#include <chrono>
+#include <utility>
namespace phosphor
{
@@ -278,6 +279,15 @@
return false;
}
+ /**
+ * @brief Get the current allowed range of speeds
+ *
+ * @param[in] deviation - The configured deviation(in percent) allowed
+ *
+ * @return pair - Min/Max range of speeds allowed
+ */
+ std::pair<uint64_t, uint64_t> getRange(const size_t deviation) const;
+
private:
/**
* @brief Returns the match string to use for matching