Refactor D-Bus object
- The intent behind this commit is to refactor D-Bus, and abstract
the bus, getService, getProperty and other methods into the utils
file, and other file operations D-Bus only need to include
uitls.hpp.
- We can also continue to add other general methods such as
setPropery, getSubTree in the utils file in the future.
- Also, removed redundant files(occ_finder.hpp and occ_finder.cpp).
Tested: built openpower-occ-control successfully and worked.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I53e61e30a76173c154a9f47fc122936468abbc4b
diff --git a/occ_status.cpp b/occ_status.cpp
index 1bf9330..f4bf8a9 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -116,8 +116,9 @@
constexpr auto CONTROL_HOST_INTF = "org.open_power.Control.Host";
// This will throw exception on failure
- auto service = getService(bus, CONTROL_HOST_PATH, CONTROL_HOST_INTF);
+ auto service = utils::getService(CONTROL_HOST_PATH, CONTROL_HOST_INTF);
+ auto& bus = utils::getBus();
auto method = bus.new_method_call(service.c_str(), CONTROL_HOST_PATH,
CONTROL_HOST_INTF, "Execute");
// OCC Reset control command