blob: 0127206e095dd82b0d334e44d800ee1babb1c360 [file] [log] [blame]
Carol Wangdc059392020-03-13 17:39:17 +08001#pragma once
2
3#include <sdbusplus/bus.hpp>
4
5namespace phosphor
6{
7namespace state
8{
9namespace manager
10{
11namespace 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 */
22std::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 */
33void 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 Geisslerf8ae6a02022-01-21 17:00:20 -060037/** @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 */
43int getGpioValue(const std::string& gpioName);
44
Carol Wangdc059392020-03-13 17:39:17 +080045} // namespace utils
46} // namespace manager
47} // namespace state
Andrew Geisslerf8ae6a02022-01-21 17:00:20 -060048} // namespace phosphor