Add support to retrigger LED Update
RetriggerLEDUpdate method added in callback-manager serivce. Used
to re-init the LED state in xyz.openbmc_project.LED.GroupManager.
This can be used by manufacturing revert function to re-init the
LED to the correct state, after any testing.
Tested:
1. Manually updated the LED state and called RetriggerLEDUpdate
method, which re-init the LED status, and set's to the correct one.
Change-Id: I4272ae0e02c81bea36db587f83e0a7ef2b91059e
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/callback-manager/src/callback_manager.cpp b/callback-manager/src/callback_manager.cpp
index 58d7e2d..34506d9 100644
--- a/callback-manager/src/callback_manager.cpp
+++ b/callback-manager/src/callback_manager.cpp
@@ -79,7 +79,8 @@
return ret;
}
-void updateLedStatus(std::shared_ptr<sdbusplus::asio::connection>& conn)
+void updateLedStatus(std::shared_ptr<sdbusplus::asio::connection>& conn,
+ bool forceRefresh = false)
{
std::vector<std::string> assertedVector = assertedInMap(fatalAssertMap);
assertedIface->set_property("Fatal", assertedVector);
@@ -115,7 +116,7 @@
std::vector<std::pair<std::string, std::variant<bool>>> ledsToSet;
- if (last != currentPriority)
+ if (last != currentPriority || forceRefresh)
{
switch (currentPriority)
{
@@ -242,6 +243,8 @@
assertedIface->register_property("Warning", std::vector<std::string>());
assertedIface->register_property("Critical", std::vector<std::string>());
assertedIface->register_property("Fatal", std::vector<std::string>());
+ assertedIface->register_method("RetriggerLEDUpdate",
+ [&conn]() { updateLedStatus(conn, true); });
assertedIface->initialize();
createThresholdMatch(conn);