reduce dbus string constants
There are a large number of dbus constants scattered throughout the
code that could/should be obtained from phosphor-dbus-interface values.
Perform minor refactoring to greatly reduce the number of string
constants.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie8700bc90611d21eee7160f4686bc978fe0a0eb4
diff --git a/settings.hpp b/settings.hpp
index 8f2dcda..a4ec5cc 100644
--- a/settings.hpp
+++ b/settings.hpp
@@ -1,6 +1,8 @@
#pragma once
#include <sdbusplus/bus.hpp>
+#include <xyz/openbmc_project/Control/Boot/RebootPolicy/client.hpp>
+#include <xyz/openbmc_project/Control/Power/RestorePolicy/client.hpp>
#include <string>
@@ -12,9 +14,10 @@
using Interface = std::string;
constexpr auto defaultRoot = "/";
-constexpr auto autoRebootIntf = "xyz.openbmc_project.Control.Boot.RebootPolicy";
-constexpr auto powerRestoreIntf =
- "xyz.openbmc_project.Control.Power.RestorePolicy";
+constexpr auto autoRebootIntf = sdbusplus::client::xyz::openbmc_project::
+ control::boot::RebootPolicy<>::interface;
+constexpr auto powerRestoreIntf = sdbusplus::client::xyz::openbmc_project::
+ control::power::RestorePolicy<>::interface;
/** @class Objects
* @brief Fetch paths of settings d-bus objects of interest, upon construction