diff options
Diffstat (limited to 'cooling-type/cooling_type.hpp')
-rw-r--r-- | cooling-type/cooling_type.hpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/cooling-type/cooling_type.hpp b/cooling-type/cooling_type.hpp index 8775a42..aa02bfa 100644 --- a/cooling-type/cooling_type.hpp +++ b/cooling-type/cooling_type.hpp @@ -1,5 +1,6 @@ #pragma once #include "utility.hpp" +#include <libevdev/libevdev.h> namespace phosphor { @@ -11,6 +12,14 @@ namespace type constexpr auto INVENTORY_PATH = "/xyz/openbmc_project/inventory"; constexpr auto INVENTORY_INTF = "xyz.openbmc_project.Inventory.Manager"; +struct FreeEvDev +{ + void operator()(struct libevdev* device) const + { + libevdev_free(device); + } +}; + class CoolingType { using Property = std::string; @@ -39,6 +48,7 @@ class CoolingType */ CoolingType(sdbusplus::bus::bus& bus) : bus(bus) { + //TODO: Issue openbmc/openbmc#1531 - means to default properties. } /** @@ -52,15 +62,16 @@ class CoolingType /** * @brief Updates the inventory properties for CoolingType. * - * @param[in] path - D-Bus path + * @param[in] path - Path to object to update */ - void updateInventory(const std::string&); + void updateInventory(const std::string& path); /** - * @brief Setup the GPIO device for reading cooling type. + * @brief Setup and read the GPIO device for reading cooling type. * - * @param[in] - Path to object to update + * @param[in] path - Path to the GPIO device file to read + * @param[in] pin - Event/key code to read (pin) */ - void setupGpio(const std::string&); + void readGpio(const std::string& path, unsigned int pin); private: /** @brief Connection for sdbusplus bus */ @@ -73,11 +84,11 @@ class CoolingType /** * @brief Construct the inventory object map for CoolingType. * - * @param[in] - Path to object to update + * @param[in] objpath - Path to object to update * * @return The inventory object map to update inventory - */ - ObjectMap getObjectMap(const std::string&); + */ + ObjectMap getObjectMap(const std::string& objpath); }; |