summaryrefslogtreecommitdiffstats
path: root/utility.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-04-10 14:25:47 -0500
committerMatt Spinler <spinler@us.ibm.com>2017-04-26 12:48:33 -0500
commit5cfdf94fdf0ac1167c9337cec95ba4d932ad40f7 (patch)
tree45cd297a2f3615c1dc0e160391e7ea051bfd815d /utility.hpp
parente10416eccd32893b68e7ec5fcaacc6520c014d4a (diff)
downloadphosphor-fan-presence-5cfdf94fdf0ac1167c9337cec95ba4d932ad40f7.tar.gz
phosphor-fan-presence-5cfdf94fdf0ac1167c9337cec95ba4d932ad40f7.zip
Fan control: Add getService() utility function
This function returns the service name from the mapper based on the dbus path and interface passed in. Eventually, getInvService can be removed and this call can be used instead. Change-Id: Ieb090a9b650803e8cfaf2f24143f25a4bbf1cd23 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'utility.hpp')
-rw-r--r--utility.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/utility.hpp b/utility.hpp
index d45fa02..b37987d 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -6,7 +6,7 @@ namespace phosphor
{
namespace fan
{
-namespace presence
+namespace util
{
/**
@@ -16,6 +16,21 @@ namespace presence
*/
std::string getInvService(sdbusplus::bus::bus& bus);
+
+/**
+ * @brief Get the service name from the mapper for the
+ * interface and path passed in.
+ *
+ * @param[in] path - the dbus path name
+ * @param[in] interface - the dbus interface name
+ * @param[in] bus - the dbus object
+ *
+ * @return The service name
+ */
+std::string getService(const std::string& path,
+ const std::string& interface,
+ sdbusplus::bus::bus& bus);
+
}
}
}
OpenPOWER on IntegriCloud