From 1fd8f74126c14b72493e4e7bec2262999b85fdbe Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Thu, 8 Jun 2017 11:52:34 -0400 Subject: presence: Add initialstate ctor arguments Allow class users to set the initial state of enclosures and tach sensors. Signed-off-by: Brad Bishop Change-Id: If5199361ab051ca46096f66ba925aeb1a874801f --- presence/fan_enclosure.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'presence/fan_enclosure.hpp') 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> 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 -- cgit v1.2.1