summaryrefslogtreecommitdiffstats
path: root/monitor/fan.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-04-27 14:42:33 -0500
committerMatt Spinler <spinler@us.ibm.com>2017-05-11 13:52:50 -0500
commitb1e185141bdd6b25cea10627045d80e457105baf (patch)
tree67117d0117f402ff1fd2873ce68a02fa11669639 /monitor/fan.hpp
parenta4c8f1f5143573c267dd9b0391daa47345276632 (diff)
downloadphosphor-fan-presence-b1e185141bdd6b25cea10627045d80e457105baf.tar.gz
phosphor-fan-presence-b1e185141bdd6b25cea10627045d80e457105baf.zip
Add inventory update support
Set a fan's Functional property to false when it has been out of spec for too long. When it is back in spec, set it back to functional. Change-Id: I264129479c58fd296df7c3a1d3d42f5d7aa7b60b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'monitor/fan.hpp')
-rw-r--r--monitor/fan.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/monitor/fan.hpp b/monitor/fan.hpp
index 9aeccd2..910b4eb 100644
--- a/monitor/fan.hpp
+++ b/monitor/fan.hpp
@@ -45,6 +45,15 @@ namespace monitor
*/
class Fan
{
+ using Property = std::string;
+ using Value = sdbusplus::message::variant<bool>;
+ using PropertyMap = std::map<Property, Value>;
+
+ using Interface = std::string;
+ using InterfaceMap = std::map<Interface, PropertyMap>;
+
+ using Object = sdbusplus::message::object_path;
+ using ObjectMap = std::map<Object, InterfaceMap>;
public:
@@ -117,6 +126,22 @@ class Fan
*/
bool tooManySensorsNonfunctional();
+ /**
+ * @brief Updates the Functional property in the inventory
+ * for the fan based on the value passed in.
+ *
+ * @param[in] functional - If the Functional property should
+ * be set to true or false.
+ */
+ void updateInventory(bool functional);
+
+ /**
+ * @brief Returns the object map to use when updating the inventory
+ *
+ * @param[in] functional - If the Functional property should
+ * be set to true or false.
+ */
+ ObjectMap getObjectMap(bool functional);
/**
* @brief the dbus object
OpenPOWER on IntegriCloud