From 59ae877171ef9a7df66c465c45fa89f2d1d89d38 Mon Sep 17 00:00:00 2001 From: Brandon Wyman Date: Thu, 6 Apr 2017 15:05:18 -0500 Subject: Implement updating the inventory properties Implement code needed to update the chassis AirCooled and WaterCooled properties. Change-Id: I9a67d1129e99f841200241e2daae08fb6119d9d3 Signed-off-by: Brandon Wyman --- cooling-type/cooling_type.hpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'cooling-type/cooling_type.hpp') diff --git a/cooling-type/cooling_type.hpp b/cooling-type/cooling_type.hpp index e0240bd..8775a42 100644 --- a/cooling-type/cooling_type.hpp +++ b/cooling-type/cooling_type.hpp @@ -13,6 +13,17 @@ constexpr auto INVENTORY_INTF = "xyz.openbmc_project.Inventory.Manager"; class CoolingType { + using Property = std::string; + using Value = sdbusplus::message::variant; + // Association between property and its value + using PropertyMap = std::map; + using Interface = std::string; + // Association between interface and the dbus property + using InterfaceMap = std::map; + using Object = sdbusplus::message::object_path; + // Association between object and the interface + using ObjectMap = std::map; + public: CoolingType() = delete; ~CoolingType() = default; @@ -26,7 +37,7 @@ class CoolingType * * @param[in] bus - Dbus bus object */ - CoolingType(sdbusplus::bus::bus& bus) + CoolingType(sdbusplus::bus::bus& bus) : bus(bus) { } @@ -47,15 +58,27 @@ class CoolingType /** * @brief Setup the GPIO device for reading cooling type. * - * @param[in] std::string - Path to the GPIO device file to read + * @param[in] - Path to object to update */ void setupGpio(const std::string&); private: + /** @brief Connection for sdbusplus bus */ + sdbusplus::bus::bus& bus; // File descriptor for the GPIO file we are going to read. phosphor::fan::util::FileDescriptor gpioFd = -1; bool airCooled = false; bool waterCooled = false; + + /** + * @brief Construct the inventory object map for CoolingType. + * + * @param[in] - Path to object to update + * + * @return The inventory object map to update inventory + */ + ObjectMap getObjectMap(const std::string&); + }; } -- cgit v1.2.1