diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-08 11:52:34 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-07-08 16:52:38 -0400 |
commit | 1fd8f74126c14b72493e4e7bec2262999b85fdbe (patch) | |
tree | b6db8faf5209ca1e091cd6cfe47e7fdaa84232d1 /presence/fan_enclosure.hpp | |
parent | 0dea38e52ba8c6e7ebda591d10ca910a8b65a0dc (diff) | |
download | phosphor-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.hpp | 9 |
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 |