use PDI constants for ObjectMapper
PDI already defines the constants we need here, use those instead of
duplicating.
Tested: Inspection only.
Change-Id: I86ad46a4aac757aa7b377b1e1709088a1e457102
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/dbus-sdr/sdrutils.cpp b/dbus-sdr/sdrutils.cpp
index 0fd14c9..a544dc1 100644
--- a/dbus-sdr/sdrutils.cpp
+++ b/dbus-sdr/sdrutils.cpp
@@ -19,11 +19,14 @@
#include <ipmid/utils.hpp>
#include <nlohmann/json.hpp>
#include <phosphor-logging/lg2.hpp>
+#include <xyz/openbmc_project/ObjectMapper/common.hpp>
#include <fstream>
#include <optional>
#include <unordered_set>
+using ObjectMapper = sdbusplus::common::xyz::openbmc_project::ObjectMapper;
+
#ifdef FEATURE_HYBRID_SENSORS
#include <ipmid/utils.hpp>
@@ -139,9 +142,8 @@
auto lbdUpdateSensorTree = [&dbus](const char* path,
const auto& interfaces) {
auto mapperCall = dbus->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);
SensorSubTree sensorTreePartial;
mapperCall.append(path, depth, interfaces);
@@ -392,10 +394,9 @@
std::vector<std::string> interfaces;
std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
- sdbusplus::message_t getObjectMessage =
- dbus->new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetObject");
+ sdbusplus::message_t getObjectMessage = dbus->new_method_call(
+ ObjectMapper::default_service, ObjectMapper::instance_path,
+ ObjectMapper::interface, ObjectMapper::method_names::get_object);
getObjectMessage.append(path, interfaces);
try
@@ -452,9 +453,9 @@
using Paths = std::vector<std::string>;
boost::system::error_code ec;
Paths paths = ipmi::callDbusMethod<Paths>(
- *ctx, ec, "xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", "/", int32_t(0),
+ *ctx, ec, ObjectMapper::default_service, ObjectMapper::instance_path,
+ ObjectMapper::interface, ObjectMapper::method_names::get_sub_tree_paths,
+ "/", int32_t(0),
std::array<const char*, 1>{
"xyz.openbmc_project.Inventory.Decorator.Ipmi"});