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>{