Use mapper to find service name
Use objectMapper to find the service name instead of using
hard-coded service name.
Change-Id: If436c65d9a9a4942eaf30ea20bc7b85e3e7694c1
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/utils.hpp b/utils.hpp
index 54b7d7d..ea2e3e4 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -89,6 +89,18 @@
return value.template get<T>();
}
+/** @brief Get service name from object path and interface
+ *
+ * @param[in] bus - The Dbus bus object
+ * @param[in] path - The Dbus object path
+ * @param[in] interface - The Dbus interface
+ *
+ * @return The name of the service
+ */
+std::string getService(sdbusplus::bus::bus& bus,
+ const char* path,
+ const char* interface);
+
/** @brief Convert a string to enum Mode
*
* Convert the time mode string to enum.