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>
diff --git a/utility.hpp b/utility.hpp
index d45fa02..b37987d 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -6,7 +6,7 @@
{
namespace fan
{
-namespace presence
+namespace util
{
/**
@@ -16,6 +16,21 @@
*/
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);
+
}
}
}