diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-03-01 11:17:00 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-03-15 16:06:47 -0500 |
commit | 5c15b797ffafd36eceecfbf250bd0eead39103dd (patch) | |
tree | 487a9bcf2b79a7193965c046b591cb489821688b /fan_enclosure.hpp | |
parent | 8db0f6f96401b9e0598836f761b808b590ce3f38 (diff) | |
download | phosphor-fan-presence-5c15b797ffafd36eceecfbf250bd0eead39103dd.tar.gz phosphor-fan-presence-5c15b797ffafd36eceecfbf250bd0eead39103dd.zip |
Documentation only, no functional change
Added copyrights and comments within headers
Resolves openbmc/openbmc#959
Change-Id: If58d78a39fb08251a34a88c2b6340c9fa33d2569
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'fan_enclosure.hpp')
-rw-r--r-- | fan_enclosure.hpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/fan_enclosure.hpp b/fan_enclosure.hpp index da6f7e5..1c8d241 100644 --- a/fan_enclosure.hpp +++ b/fan_enclosure.hpp @@ -12,6 +12,9 @@ namespace fan namespace presence { +/** + * @brief Specifies the defined presence states of a fan enclosure + */ typedef enum presenceState { NOT_PRESENT, @@ -19,6 +22,13 @@ typedef enum presenceState UNKNOWN } presenceState; +/** + * @class FanEnclosure + * @brief OpenBMC fan enclosure inventory presence implementation + * @details Inventory is based on the fan enclosure being present or not. This + * class represents that fan enclosure and updates its presences status within + * its inventory object based on the status of all its sensors. + */ class FanEnclosure { using Property = std::string; @@ -40,6 +50,12 @@ class FanEnclosure FanEnclosure& operator=(FanEnclosure&&) = delete; ~FanEnclosure() = default; + /** + * @brief Constructs Fan Enclosure Object + * + * @param[in] bus - Dbus bus object + * @param[in] fanProp - Fan enclosure properties + */ FanEnclosure(sdbusplus::bus::bus& bus, const phosphor::fan::Properties& fanProp) : bus(bus), @@ -50,20 +66,51 @@ class FanEnclosure updInventory(); } + /** + * @brief Update inventory when the determined presence of this fan + * enclosure has changed + */ void updInventory(); + /** + * @brief Add a sensor association to this fan enclosure + * + * @param[in] sensor - Sensor associated to this fan enclosure + */ void addSensor( std::unique_ptr<Sensor>&& sensor); private: + /** @brief Connection for sdbusplus bus */ sdbusplus::bus::bus& bus; + /** @brief Inventory path for this fan enclosure */ const std::string invPath; + /** @brief Description used as 'PrettyName' on inventory object */ const std::string fanDesc; + /** @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; + /** + * @brief Get the current presence state based on all sensors + * + * @return Current presence state determined from all sensors + */ presenceState getCurPresState(); //TODO openbmc/openbmc#1299 - Move getInvService() to a utility file + /** + * @brief Get the inventory service name from the mapper object + * + * @return The inventory manager service name + */ std::string getInvService(); + /** + * @brief Construct the inventory object map + * + * @param[in] Current presence state + * + * @return The inventory object map to update inventory + */ ObjectMap getObjectMap(bool curPresState); }; |