summaryrefslogtreecommitdiffstats
path: root/presence/fan_enclosure.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-08 11:52:34 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-07-08 16:52:38 -0400
commit1fd8f74126c14b72493e4e7bec2262999b85fdbe (patch)
treeb6db8faf5209ca1e091cd6cfe47e7fdaa84232d1 /presence/fan_enclosure.hpp
parent0dea38e52ba8c6e7ebda591d10ca910a8b65a0dc (diff)
downloadphosphor-fan-presence-1fd8f74126c14b72493e4e7bec2262999b85fdbe.tar.gz
phosphor-fan-presence-1fd8f74126c14b72493e4e7bec2262999b85fdbe.zip
presence: Add initialstate ctor arguments
Allow class users to set the initial state of enclosures and tach sensors. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If5199361ab051ca46096f66ba925aeb1a874801f
Diffstat (limited to 'presence/fan_enclosure.hpp')
-rw-r--r--presence/fan_enclosure.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/presence/fan_enclosure.hpp b/presence/fan_enclosure.hpp
index 071b59c..30bd235 100644
--- a/presence/fan_enclosure.hpp
+++ b/presence/fan_enclosure.hpp
@@ -54,10 +54,13 @@ class FanEnclosure
* @brief Constructs Fan Enclosure Object
*
* @param[in] fanProp - Fan enclosure properties
+ * @param[in] initialState - The initial state of the enclosure.
*/
- explicit FanEnclosure(const phosphor::fan::Properties& fanProp) :
+ explicit FanEnclosure(const phosphor::fan::Properties& fanProp,
+ presenceState initialState = UNKNOWN) :
invPath(std::get<0>(fanProp)),
- fanDesc(std::get<1>(fanProp))
+ fanDesc(std::get<1>(fanProp)),
+ presState(initialState)
{
}
@@ -82,7 +85,7 @@ class FanEnclosure
/** @brief List of sensors associated with this fan enclosure */
std::vector<std::unique_ptr<Sensor>> sensors;
/** @brief Last known presence state of this fan enclosure */
- presenceState presState = UNKNOWN;
+ presenceState presState;
/**
* @brief Get the current presence state based on all sensors
OpenPOWER on IntegriCloud