Control.Mode: use PDI constants
Use PDI constants instead of local definitions.
Tested: Unit Tests Pass.
Change-Id: I556e87b2e4784a2653708adc919bdb5c10e9081a
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/ipmi/dbus_mode.cpp b/ipmi/dbus_mode.cpp
index 4155658..52666c0 100644
--- a/ipmi/dbus_mode.cpp
+++ b/ipmi/dbus_mode.cpp
@@ -7,18 +7,20 @@
#include <sdbusplus/bus.hpp>
#include <sdbusplus/exception.hpp>
#include <sdbusplus/message.hpp>
+#include <xyz/openbmc_project/Control/Mode/client.hpp>
#include <cstdint>
#include <map>
#include <string>
#include <variant>
+using ControlMode = sdbusplus::common::xyz::openbmc_project::control::Mode;
+
namespace pid_control::ipmi
{
static constexpr auto objectPath = "/xyz/openbmc_project/settings/fanctrl/zone";
static constexpr auto busName = "xyz.openbmc_project.State.FanCtrl";
-static constexpr auto intf = "xyz.openbmc_project.Control.Mode";
static constexpr auto propertiesintf = "org.freedesktop.DBus.Properties";
using Property = std::string;
@@ -39,7 +41,7 @@
auto propertyReadBus = sdbusplus::bus::new_system();
auto pimMsg = propertyReadBus.new_method_call(busName, path.c_str(),
propertiesintf, "GetAll");
- pimMsg.append(intf);
+ pimMsg.append(ControlMode::interface);
try
{
@@ -71,7 +73,7 @@
auto PropertyWriteBus = sdbusplus::bus::new_system();
auto pimMsg = PropertyWriteBus.new_method_call(busName, path.c_str(),
propertiesintf, "Set");
- pimMsg.append(intf);
+ pimMsg.append(ControlMode::interface);
pimMsg.append(property);
pimMsg.append(v);