Carol Wang | dc05939 | 2020-03-13 17:39:17 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | |
| 5 | namespace phosphor |
| 6 | { |
| 7 | namespace state |
| 8 | { |
| 9 | namespace manager |
| 10 | { |
| 11 | namespace utils |
| 12 | { |
| 13 | |
| 14 | /** @brief Get service name from object path and interface |
| 15 | * |
| 16 | * @param[in] bus - The Dbus bus object |
| 17 | * @param[in] path - The Dbus object path |
| 18 | * @param[in] interface - The Dbus interface |
| 19 | * |
| 20 | * @return The name of the service |
| 21 | */ |
| 22 | std::string getService(sdbusplus::bus::bus& bus, std::string path, |
| 23 | std::string interface); |
| 24 | |
| 25 | /** @brief Set the value of property |
| 26 | * |
| 27 | * @param[in] bus - The Dbus bus object |
| 28 | * @param[in] path - The Dbus object path |
| 29 | * @param[in] interface - The Dbus interface |
| 30 | * @param[in] property - The property name to set |
| 31 | * @param[in] value - The value of property |
| 32 | */ |
| 33 | void setProperty(sdbusplus::bus::bus& bus, const std::string& path, |
| 34 | const std::string& interface, const std::string& property, |
| 35 | const std::string& value); |
| 36 | |
Andrew Geissler | f8ae6a0 | 2022-01-21 17:00:20 -0600 | [diff] [blame] | 37 | /** @brief Return the value of the input GPIO |
| 38 | * |
| 39 | * @param[in] gpioName - The name of the GPIO to read |
| 40 | * |
| 41 | * * @return The value of the gpio (0 or 1) or -1 on error |
| 42 | */ |
| 43 | int getGpioValue(const std::string& gpioName); |
| 44 | |
Carol Wang | dc05939 | 2020-03-13 17:39:17 +0800 | [diff] [blame] | 45 | } // namespace utils |
| 46 | } // namespace manager |
| 47 | } // namespace state |
Andrew Geissler | f8ae6a0 | 2022-01-21 17:00:20 -0600 | [diff] [blame] | 48 | } // namespace phosphor |