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);
 
diff --git a/setsensor.cpp b/setsensor.cpp
index 3933e5d..884e52b 100644
--- a/setsensor.cpp
+++ b/setsensor.cpp
@@ -1,6 +1,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/exception.hpp>
 #include <sdbusplus/message.hpp>
+#include <xyz/openbmc_project/Control/Mode/client.hpp>
 #include <xyz/openbmc_project/Sensor/Value/client.hpp>
 
 #include <cstdint>
@@ -11,11 +12,10 @@
 /* Fan Control */
 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 property = "Manual";
 using Value = std::variant<bool>;
 
 using SensorValue = sdbusplus::common::xyz::openbmc_project::sensor::Value;
+using ControlMode = sdbusplus::common::xyz::openbmc_project::control::Mode;
 
 /* Host Sensor. */
 static constexpr auto sobjectPath =
@@ -70,8 +70,8 @@
     auto pimMsg = PropertyWriteBus.new_method_call(
         busname.c_str(), path.c_str(), propertiesintf, "Set");
 
-    pimMsg.append(intf);
-    pimMsg.append(property);
+    pimMsg.append(ControlMode::interface);
+    pimMsg.append(ControlMode::property_names::manual);
     pimMsg.append(v);
 
     try