monitor: Support a separate upper deviation
Add an optional 'upper_deviation' field to the fan monitor config and if
supplied it will be used for the allowed deviation when the fan value is
over the target. If not supplied it will work as today and the single
deviation value will be used for both the upper and lower bounds.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I085dc1996832e79b94bd1df3a05681d107f466eb
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 875c578..b4dc5b5 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -344,12 +344,16 @@
/**
* @brief Get the current allowed range of speeds
*
- * @param[in] deviation - The configured deviation(in percent) allowed
+ * @param[in] lowerDeviation - The configured lower deviation(in percent)
+ * allowed
+ * @param[in] upperDeviation - The configured upper deviation(in percent)
+ * allowed
*
* @return pair - Min/Max(optional) range of speeds allowed
*/
std::pair<uint64_t, std::optional<uint64_t>>
- getRange(const size_t deviation) const;
+ getRange(const size_t lowerDeviation,
+ const size_t upperDeviation) const;
/**
* @brief Processes the current state of the sensor