BIOSConfig.Manager: use PDI constants

Pull property names, interface name, ... from PDI and drop a bunch of
local definitions.

The instance path is still remaining as a local definition, patch [1]
has been raised.

Tested: Inspection only.

References:
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/85118

Change-Id: Ia6601f1fcbe84802820f610ffc717715b85ca7ba
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/utils.cpp b/common/utils.cpp
index 1e41100..374037e 100644
--- a/common/utils.cpp
+++ b/common/utils.cpp
@@ -4,6 +4,7 @@
 #include <libpldm/pldm_types.h>
 #include <linux/mctp.h>
 
+#include <xyz/openbmc_project/BIOSConfig/Manager/client.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 #include <xyz/openbmc_project/Logging/Create/client.hpp>
 #include <xyz/openbmc_project/ObjectMapper/client.hpp>
@@ -27,6 +28,8 @@
 {
 
 using ObjectMapper = sdbusplus::client::xyz::openbmc_project::ObjectMapper<>;
+using BIOSConfigManager =
+    sdbusplus::client::xyz::openbmc_project::bios_config::Manager<>;
 
 constexpr const char* MCTP_INTERFACE_CC = "au.com.codeconstruct.MCTP.Endpoint1";
 constexpr const char* MCTP_ENDPOINT_RECOVER_METHOD = "Recover";
@@ -915,8 +918,6 @@
 {
     static constexpr auto SYSTEMD_PROPERTY_INTERFACE =
         "org.freedesktop.DBus.Properties";
-    constexpr auto biosConfigPath = "/xyz/openbmc_project/bios_config/manager";
-    constexpr auto biosConfigIntf = "xyz.openbmc_project.BIOSConfig.Manager";
 
     for (const auto& [attrName, biosAttrDetails] : biosAttrList)
     {
@@ -924,11 +925,12 @@
         try
         {
             auto service = pldm::utils::DBusHandler().getService(
-                biosConfigPath, biosConfigIntf);
+                biosConfigPath, BIOSConfigManager::interface);
             auto method =
                 bus.new_method_call(service.c_str(), biosConfigPath,
                                     SYSTEMD_PROPERTY_INTERFACE, "Set");
-            method.append(biosConfigIntf, "PendingAttributes",
+            method.append(BIOSConfigManager::interface,
+                          BIOSConfigManager::property_names::pending_attributes,
                           std::variant<PendingAttributesList>(biosAttrList));
             bus.call_noreply(method, dbusTimeout);
         }
diff --git a/common/utils.hpp b/common/utils.hpp
index 867e064..7bd57b2 100644
--- a/common/utils.hpp
+++ b/common/utils.hpp
@@ -705,6 +705,8 @@
  */
 long int generateSwId();
 
+constexpr auto biosConfigPath = "/xyz/openbmc_project/bios_config/manager";
+
 /** @brief Method to get the value from a bios attribute
  *
  *  @param[in] dbusAttrName - the bios attribute name from
@@ -715,19 +717,19 @@
 template <typename T>
 std::optional<T> getBiosAttrValue(const std::string& dbusAttrName)
 {
-    constexpr auto biosConfigPath = "/xyz/openbmc_project/bios_config/manager";
-    constexpr auto biosConfigIntf = sdbusplus::common::xyz::openbmc_project::
-        bios_config::Manager::interface;
+    using BIOSConfigManager =
+        sdbusplus::common::xyz::openbmc_project::bios_config::Manager;
 
     std::string var1;
     std::variant<std::string, int64_t> var2, var3;
     auto& bus = DBusHandler::getBus();
     try
     {
-        auto service = pldm::utils::DBusHandler().getService(biosConfigPath,
-                                                             biosConfigIntf);
-        auto method = bus.new_method_call(service.c_str(), biosConfigPath,
-                                          biosConfigIntf, "GetAttribute");
+        auto service = pldm::utils::DBusHandler().getService(
+            biosConfigPath, BIOSConfigManager::interface);
+        auto method = bus.new_method_call(
+            service.c_str(), biosConfigPath, BIOSConfigManager::interface,
+            BIOSConfigManager::method_names::get_attribute);
         method.append(dbusAttrName);
         auto reply = bus.call(method, dbusTimeout);
         reply.read(var1, var2, var3);