State.Host: use PDI constants
Pull string literals from PDI for xyz.openbmc_project.State.Host
interface.
Tested: Inspection only.
Change-Id: Ia5ea6e67fc6c6925c3febcc28503408d5c028075
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 380a256..6c175aa 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -16,9 +16,12 @@
#include <sdbusplus/bus/match.hpp>
#include <sdeventplus/event.hpp>
#include <sdeventplus/utility/timer.hpp>
+#include <xyz/openbmc_project/State/Host/client.hpp>
typedef ibm_oem_pldm_state_set_firmware_update_state_values CodeUpdateState;
+using HostState = sdbusplus::common::xyz::openbmc_project::state::Host;
+
namespace pldm
{
namespace responder
@@ -71,12 +74,13 @@
hostOffMatch = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged("/xyz/openbmc_project/state/host0",
- "xyz.openbmc_project.State.Host"),
+ HostState::interface),
[this](sdbusplus::message_t& msg) {
pldm::utils::DbusChangedProps props{};
std::string intf;
msg.read(intf, props);
- const auto itr = props.find("CurrentHostState");
+ const auto itr =
+ props.find(HostState::property_names::current_host_state);
if (itr != props.end())
{
pldm::utils::PropertyValue value = itr->second;