diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2018-01-15 16:22:04 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2018-01-18 11:16:23 -0600 |
commit | f552ea5ce23889905ce15c0ffcfc73fa1245a423 (patch) | |
tree | d3621f920bebf9fd9744aeb61d2a5fb54a2f419e /monitor/fan.hpp | |
parent | e4338cdb856db2b71f8adf42c50603d816980f8a (diff) | |
download | phosphor-fan-presence-f552ea5ce23889905ce15c0ffcfc73fa1245a423.tar.gz phosphor-fan-presence-f552ea5ce23889905ce15c0ffcfc73fa1245a423.zip |
All sensors should return a target speed value
All tach sensors associated with a fan should return a target speed
sensor from its getTarget function. In the case where a target speed
sensor does not exist for the tach sensor, it retrieves and returns the
target speed value from the fan where the fan finds the target speed
value from a tach sensor the fan contains that provides it.
Resolves openbmc/openbmc#2784
Change-Id: Iea5561b0aad6942be52af262c7255c60e5e75c7a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'monitor/fan.hpp')
-rw-r--r-- | monitor/fan.hpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/monitor/fan.hpp b/monitor/fan.hpp index f22bd9f..d765650 100644 --- a/monitor/fan.hpp +++ b/monitor/fan.hpp @@ -134,15 +134,28 @@ class Fan return _name; } + /** + * @brief Finds the target speed of this fan + * + * Finds the target speed from the list of sensors that make up this + * fan. At least one sensor should contain a target speed value. + * + * @return - The target speed found from the list of sensors on the fan + */ + uint64_t findTargetSpeed(); + private: /** - * @brief Returns the target speed of the sensor + * @brief Returns the target speed of the fan + * + * Retrieves the target speed using the given sensor which may or may + * not contain a target speed value. The sensor determines what its + * target speed is. * - * If the sensor itself doesn't have a target, it finds - * the target speed from another sensor. + * @param[in] sensor - The sensor to use in getting the target speed * - * @param[in] sensor - the sensor to get the target speed for + * @return - The target speed of the fan */ uint64_t getTargetSpeed(const TachSensor& sensor); |