host check: use PDI constants
Use PDI constants where applicable.
Tested: Inspection only.
Change-Id: I5f910bcb62b32fc5d65f9da536d38a2b7278fef3
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/host_check.cpp b/host_check.cpp
index c4b3e7b..bc1ade1 100644
--- a/host_check.cpp
+++ b/host_check.cpp
@@ -37,20 +37,18 @@
sdbusplus::client::xyz::openbmc_project::condition::HostFirmware<>;
// Required strings for sending the msg to check on host
-constexpr auto CONDITION_HOST_PROPERTY = "CurrentFirmwareCondition";
constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
constexpr auto CHASSIS_STATE_SVC = "xyz.openbmc_project.State.Chassis";
-constexpr auto CHASSIS_STATE_POWER_PROP = "CurrentPowerState";
// Find all implementations of Condition interface and check if host is
// running over it
bool checkFirmwareConditionRunning(sdbusplus::bus_t& bus)
{
// Find all implementations of host firmware condition interface
- auto mapper = bus.new_method_call(ObjectMapper::default_service,
- ObjectMapper::instance_path,
- ObjectMapper::interface, "GetSubTree");
+ auto mapper = bus.new_method_call(
+ ObjectMapper::default_service, ObjectMapper::instance_path,
+ ObjectMapper::interface, ObjectMapper::method_names::get_sub_tree);
mapper.append("/", 0, std::vector<std::string>({HostFirmware::interface}));
@@ -95,7 +93,9 @@
{
auto method = bus.new_method_call(service.c_str(), path.c_str(),
PROPERTY_INTERFACE, "Get");
- method.append(HostFirmware::interface, CONDITION_HOST_PROPERTY);
+ method.append(
+ HostFirmware::interface,
+ HostFirmware::property_names::current_firmware_condition);
auto response = bus.call(method);
std::variant<HostFirmware::FirmwareCondition> currentFwCondV;
@@ -137,7 +137,8 @@
{
auto method = bus.new_method_call(svcname.c_str(), objpath.c_str(),
PROPERTY_INTERFACE, "Get");
- method.append(Chassis::interface, CHASSIS_STATE_POWER_PROP);
+ method.append(Chassis::interface,
+ Chassis::property_names::current_power_state);
auto response = bus.call(method);
std::variant<Chassis::PowerState> currentPowerStateV;