From fef0295a8d87754e491dcf133ea927b5c4d56303 Mon Sep 17 00:00:00 2001 From: Brandon Wyman Date: Fri, 31 Mar 2017 18:13:21 -0500 Subject: Fill in shell functions/files for cooling type. Change-Id: I8d18d3141e955adeffdd8122ebb17549c88edd77 Signed-off-by: Brandon Wyman --- cooling-type/cooling_type.hpp | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 cooling-type/cooling_type.hpp (limited to 'cooling-type/cooling_type.hpp') 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 -- cgit v1.2.1