summaryrefslogtreecommitdiffstats
path: root/cooling-type/cooling_type.hpp
diff options
context:
space:
mode:
authorBrandon Wyman <bjwyman@gmail.com>2017-03-31 18:13:21 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-05-19 16:19:06 +0000
commitfef0295a8d87754e491dcf133ea927b5c4d56303 (patch)
tree625df8225e8d9681ff1b5f9afb77104c9e899946 /cooling-type/cooling_type.hpp
parentaf5d4c5ec0e07ba7a87ddff3f2066d9b3cbb52f8 (diff)
downloadphosphor-fan-presence-fef0295a8d87754e491dcf133ea927b5c4d56303.tar.gz
phosphor-fan-presence-fef0295a8d87754e491dcf133ea927b5c4d56303.zip
Fill in shell functions/files for cooling type.
Change-Id: I8d18d3141e955adeffdd8122ebb17549c88edd77 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Diffstat (limited to 'cooling-type/cooling_type.hpp')
-rw-r--r--cooling-type/cooling_type.hpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/cooling-type/cooling_type.hpp b/cooling-type/cooling_type.hpp
new file mode 100644
index 0000000..e0240bd
--- /dev/null
+++ b/cooling-type/cooling_type.hpp
@@ -0,0 +1,65 @@
+#pragma once
+#include "utility.hpp"
+
+namespace phosphor
+{
+namespace cooling
+{
+namespace type
+{
+
+constexpr auto INVENTORY_PATH = "/xyz/openbmc_project/inventory";
+constexpr auto INVENTORY_INTF = "xyz.openbmc_project.Inventory.Manager";
+
+class CoolingType
+{
+ public:
+ CoolingType() = delete;
+ ~CoolingType() = default;
+ CoolingType(const CoolingType&) = delete;
+ CoolingType(CoolingType&&) = default;
+ CoolingType& operator=(const CoolingType&) = delete;
+ CoolingType& operator=(CoolingType&&) = default;
+
+ /**
+ * @brief Constructs Cooling Type Object
+ *
+ * @param[in] bus - Dbus bus object
+ */
+ CoolingType(sdbusplus::bus::bus& bus)
+ {
+ }
+
+ /**
+ * @brief Sets airCooled to true.
+ */
+ void setAirCooled();
+ /**
+ * @brief Sets waterCooled to true.
+ */
+ void setWaterCooled();
+ /**
+ * @brief Updates the inventory properties for CoolingType.
+ *
+ * @param[in] path - D-Bus path
+ */
+ void updateInventory(const std::string&);
+ /**
+ * @brief Setup the GPIO device for reading cooling type.
+ *
+ * @param[in] std::string - Path to the GPIO device file to read
+ */
+ void setupGpio(const std::string&);
+
+ private:
+ // File descriptor for the GPIO file we are going to read.
+ phosphor::fan::util::FileDescriptor gpioFd = -1;
+ bool airCooled = false;
+ bool waterCooled = false;
+};
+
+}
+}
+}
+
+// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
OpenPOWER on IntegriCloud