Add the restoreLedsAssert method for LED manager
- Logically, Since the physical LEDs states should not be operated
during the lamp test, all the physical LEDs states before and
during the lamp test should be saved and restored after the lamp
test.
Tested:
- Store the state of all the physical LEDs before the lamp test,
and keep the state of all the physical LEDs consistent after
the lamp test.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I8b321bae2e38001ea33a80bda8badcf4c8a55040
diff --git a/utils.cpp b/utils.cpp
index 116f0c3..41b78b9 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -47,6 +47,30 @@
return mapperResponse.cbegin()->first;
}
+// Get all properties
+const PropertyMap
+ DBusHandler::getAllProperties(const std::string& objectPath,
+ const std::string& interface) const
+{
+ PropertyMap properties;
+
+ auto& bus = DBusHandler::getBus();
+ auto service = getService(objectPath, interface);
+ if (service.empty())
+ {
+ return properties;
+ }
+
+ auto method = bus.new_method_call(service.c_str(), objectPath.c_str(),
+ DBUS_PROPERTY_IFACE, "GetAll");
+ method.append(interface);
+
+ auto reply = bus.call(method);
+ reply.read(properties);
+
+ return properties;
+}
+
// Get the property name
const PropertyValue
DBusHandler::getProperty(const std::string& objectPath,