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);
}