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/manager.hpp b/manager.hpp
index f75a81b..6e6ef48 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -129,6 +129,13 @@
void drivePhysicalLED(const std::string& objPath, Layout::Action action,
uint8_t dutyOn, const uint16_t period);
+ /** @brief Set lamp test callback when enabled lamp test.
+ *
+ * @param[in] callBack - Custom callback when enabled lamp test
+ */
+ void setLampTestCallBack(
+ std::function<bool(group& ledsAssert, group& ledsDeAssert)> callBack);
+
private:
/** @brief sdbusplus handler */
sdbusplus::bus::bus& bus;
@@ -150,6 +157,10 @@
/** @brief Contains the set of all actions for asserted LEDs */
group combinedState;
+ /** @brief Custom callback when enabled lamp test */
+ std::function<bool(group& ledsAssert, group& ledsDeAssert)>
+ lampTestCallBack;
+
/** @brief Returns action string based on enum
*
* @param[in] action - Action enum