use PDI constants for State.BMC
Tested: Inspection only.
Change-Id: I7ba48d7f5f856d5f284b68f8344b982da08c58df
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/oem/example/apphandler.cpp b/oem/example/apphandler.cpp
index 678f71a..7ded160 100644
--- a/oem/example/apphandler.cpp
+++ b/oem/example/apphandler.cpp
@@ -26,9 +26,6 @@
#include <tuple>
#include <vector>
-constexpr auto bmcStateInterface = "xyz.openbmc_project.State.BMC";
-constexpr auto bmcStateProperty = "CurrentBMCState";
-
static constexpr auto redundancyIntf =
"xyz.openbmc_project.Software.RedundancyPriority";
static constexpr auto versionIntf = "xyz.openbmc_project.Software.Version";
@@ -43,7 +40,7 @@
using Version = sdbusplus::server::xyz::openbmc_project::software::Version;
using Activation =
sdbusplus::server::xyz::openbmc_project::software::Activation;
-using BMC = sdbusplus::server::xyz::openbmc_project::state::BMC;
+using BMCState = sdbusplus::server::xyz::openbmc_project::state::BMC;
namespace fs = std::filesystem;
/**
@@ -134,19 +131,21 @@
// Get the Inventory object implementing the BMC interface
ipmi::DbusObjectInfo bmcObject{};
boost::system::error_code ec =
- ipmi::getDbusObject(ctx, bmcStateInterface, bmcObject);
+ ipmi::getDbusObject(ctx, BMCState::interface, bmcObject);
std::string bmcState{};
if (ec.value())
{
return fallbackAvailability;
}
- ec = ipmi::getDbusProperty(ctx, bmcObject.second, bmcObject.first,
- bmcStateInterface, bmcStateProperty, bmcState);
+ ec = ipmi::getDbusProperty(
+ ctx, bmcObject.second, bmcObject.first, BMCState::interface,
+ BMCState::property_names::current_bmc_state, bmcState);
if (!ec.value())
{
return fallbackAvailability;
}
- return BMC::convertBMCStateFromString(bmcState) == BMC::BMCState::Ready;
+ return BMCState::convertBMCStateFromString(bmcState) ==
+ BMCState::BMCState::Ready;
}
typedef struct