summaryrefslogtreecommitdiffstats
path: root/cooling-type/cooling_type.hpp
diff options
context:
space:
mode:
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