summaryrefslogtreecommitdiff
path: root/callback-manager
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2019-04-13 18:41:23 +0300
committerRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2019-04-13 18:41:23 +0300
commit91ca641534f4cd9057d10be1b106ff17adf40b6c (patch)
treecb7f31654f6526d86444f7b9a3c7dc93e8d7e213 /callback-manager
parent785f19b128794611574ea6c18805740fb851ecff (diff)
downloadprovingground-91ca641534f4cd9057d10be1b106ff17adf40b6c.tar.xz
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>
Diffstat (limited to 'callback-manager')
-rw-r--r--callback-manager/src/callback_manager.cpp7
1 files changed, 5 insertions, 2 deletions
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 @@ std::vector<std::string> assertedInMap(
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 @@ void updateLedStatus(std::shared_ptr<sdbusplus::asio::connection>& conn)
std::vector<std::pair<std::string, std::variant<bool>>> ledsToSet;
- if (last != currentPriority)
+ if (last != currentPriority || forceRefresh)
{
switch (currentPriority)
{
@@ -242,6 +243,8 @@ int main(int argc, char** argv)
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);