DBus: use PDI constants for ObjectMapper

Use the PDI-defined constants for ObjectMapper calls instead of
duplicating them here.

Tested: Inspection only.

Change-Id: I74cb19ff7c23131bb9d69256ae85e1cf98785c99
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 8dcd69b..546dff0 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -32,6 +32,7 @@
 #include <sdbusplus/exception.hpp>
 #include <sdbusplus/message.hpp>
 #include <sdbusplus/message/native_types.hpp>
+#include <xyz/openbmc_project/ObjectMapper/common.hpp>
 
 #include <algorithm>
 #include <array>
@@ -50,6 +51,8 @@
 #include <variant>
 #include <vector>
 
+using ObjectMapper = sdbusplus::common::xyz::openbmc_project::ObjectMapper;
+
 namespace pid_control
 {
 
@@ -100,10 +103,9 @@
 std::vector<std::string> getSelectedProfiles(sdbusplus::bus_t& bus)
 {
     std::vector<std::string> ret;
-    auto mapper =
-        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                            "/xyz/openbmc_project/object_mapper",
-                            "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+    auto mapper = bus.new_method_call(
+        ObjectMapper::default_service, ObjectMapper::instance_path,
+        ObjectMapper::interface, ObjectMapper::method_names::get_sub_tree);
     mapper.append("/", 0, std::array<const char*, 1>{thermalControlIface});
     std::unordered_map<
         std::string, std::unordered_map<std::string, std::vector<std::string>>>
@@ -448,10 +450,9 @@
 
     createMatches(bus, timer);
 
-    auto mapper =
-        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                            "/xyz/openbmc_project/object_mapper",
-                            "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+    auto mapper = bus.new_method_call(
+        ObjectMapper::default_service, ObjectMapper::instance_path,
+        ObjectMapper::interface, ObjectMapper::method_names::get_sub_tree);
     mapper.append(
         "/", 0,
         std::array<const char*, 6>{
diff --git a/dbus/dbushelper.cpp b/dbus/dbushelper.cpp
index 014b8cb..7e604b8 100644
--- a/dbus/dbushelper.cpp
+++ b/dbus/dbushelper.cpp
@@ -11,6 +11,7 @@
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/exception.hpp>
+#include <xyz/openbmc_project/ObjectMapper/common.hpp>
 
 #include <cstdint>
 #include <map>
@@ -19,6 +20,8 @@
 #include <variant>
 #include <vector>
 
+using ObjectMapper = sdbusplus::common::xyz::openbmc_project::ObjectMapper;
+
 namespace pid_control
 {
 
@@ -34,10 +37,9 @@
 std::string DbusHelper::getService(const std::string& intf,
                                    const std::string& path)
 {
-    auto mapper =
-        _bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                             "/xyz/openbmc_project/object_mapper",
-                             "xyz.openbmc_project.ObjectMapper", "GetObject");
+    auto mapper = _bus.new_method_call(
+        ObjectMapper::default_service, ObjectMapper::instance_path,
+        ObjectMapper::interface, ObjectMapper::method_names::get_object);
 
     mapper.append(path);
     mapper.append(std::vector<std::string>({intf}));
diff --git a/dbus/dbuspassiveredundancy.cpp b/dbus/dbuspassiveredundancy.cpp
index 2ccd490..76dded9 100644
--- a/dbus/dbuspassiveredundancy.cpp
+++ b/dbus/dbuspassiveredundancy.cpp
@@ -20,6 +20,7 @@
 #include <sdbusplus/bus/match.hpp>
 #include <sdbusplus/exception.hpp>
 #include <sdbusplus/message.hpp>
+#include <xyz/openbmc_project/ObjectMapper/common.hpp>
 
 #include <array>
 #include <iostream>
@@ -29,6 +30,8 @@
 #include <variant>
 #include <vector>
 
+using ObjectMapper = sdbusplus::common::xyz::openbmc_project::ObjectMapper;
+
 namespace pid_control
 {
 
@@ -115,9 +118,8 @@
 void DbusPassiveRedundancy::populateFailures(void)
 {
     auto mapper = passiveBus.new_method_call(
-        "xyz.openbmc_project.ObjectMapper",
-        "/xyz/openbmc_project/object_mapper",
-        "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+        ObjectMapper::default_service, ObjectMapper::instance_path,
+        ObjectMapper::interface, ObjectMapper::method_names::get_sub_tree);
     mapper.append("/", 0, std::array<const char*, 1>{redundancy::interface});
     std::unordered_map<
         std::string, std::unordered_map<std::string, std::vector<std::string>>>