diff options
Diffstat (limited to 'ext_interface.cpp')
-rw-r--r-- | ext_interface.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/ext_interface.cpp b/ext_interface.cpp index b1902d4..554da80 100644 --- a/ext_interface.cpp +++ b/ext_interface.cpp @@ -1,7 +1,7 @@ -#include <string> -#include <sdbusplus/server.hpp> -#include <phosphor-logging/log.hpp> #include <ext_interface.hpp> +#include <phosphor-logging/log.hpp> +#include <sdbusplus/server.hpp> +#include <string> // Mapper constexpr auto MAPPER_BUSNAME = "xyz.openbmc_project.ObjectMapper"; @@ -10,7 +10,8 @@ constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper"; // Reboot count constexpr auto REBOOTCOUNTER_PATH("/xyz/openbmc_project/state/host0"); -constexpr auto REBOOTCOUNTER_INTERFACE("xyz.openbmc_project.Control.Boot.RebootAttempts"); +constexpr auto + REBOOTCOUNTER_INTERFACE("xyz.openbmc_project.Control.Boot.RebootAttempts"); using namespace phosphor::logging; @@ -26,15 +27,12 @@ using namespace phosphor::logging; * * @return distinct dbus name for input interface/path **/ -std::string getService(sdbusplus::bus::bus& bus, - const std::string& intf, +std::string getService(sdbusplus::bus::bus& bus, const std::string& intf, const std::string& path) { - auto mapper = bus.new_method_call(MAPPER_BUSNAME, - MAPPER_PATH, - MAPPER_INTERFACE, - "GetObject"); + auto mapper = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH, + MAPPER_INTERFACE, "GetObject"); mapper.append(path); mapper.append(std::vector<std::string>({intf})); @@ -59,19 +57,15 @@ std::string getService(sdbusplus::bus::bus& bus, return mapperResponse.begin()->first; } - uint32_t getBootCount() { auto bus = sdbusplus::bus::new_default(); - auto rebootSvc = getService(bus, - REBOOTCOUNTER_INTERFACE, - REBOOTCOUNTER_PATH); + auto rebootSvc = + getService(bus, REBOOTCOUNTER_INTERFACE, REBOOTCOUNTER_PATH); - auto method = bus.new_method_call(rebootSvc.c_str(), - REBOOTCOUNTER_PATH, - "org.freedesktop.DBus.Properties", - "Get"); + auto method = bus.new_method_call(rebootSvc.c_str(), REBOOTCOUNTER_PATH, + "org.freedesktop.DBus.Properties", "Get"); method.append(REBOOTCOUNTER_INTERFACE, "AttemptsLeft"); auto reply = bus.call(method); |