Update the value of Period to D-bus obtained from configuration YAML.
Update the value of Period to D-bus obtained from configuration YAML
when the target group was asserted. The logical behavior
of Period is as same as Dutyon.
Change-Id: I4b064f2f7321479cabc7deeaa57779b0a8cc3d21
Signed-off-by: tony lee <tony.lee@quantatw.com>
diff --git a/manager.cpp b/manager.cpp
index 0235b7b..04398e4 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -118,7 +118,8 @@
std::string objPath = std::string(PHY_LED_PATH) + it.name;
log<level::DEBUG>("De-Asserting LED",
entry("NAME=%s", it.name.c_str()));
- drivePhysicalLED(objPath, Layout::Action::Off, it.dutyOn);
+ drivePhysicalLED(objPath, Layout::Action::Off, it.dutyOn,
+ it.period);
}
}
@@ -129,7 +130,7 @@
std::string objPath = std::string(PHY_LED_PATH) + it.name;
log<level::DEBUG>("Asserting LED",
entry("NAME=%s", it.name.c_str()));
- drivePhysicalLED(objPath, it.action, it.dutyOn);
+ drivePhysicalLED(objPath, it.action, it.dutyOn, it.period);
}
}
return;
@@ -137,7 +138,8 @@
// Calls into driving physical LED post choosing the action
void Manager::drivePhysicalLED(const std::string& objPath,
- Layout::Action action, uint8_t dutyOn)
+ Layout::Action action, uint8_t dutyOn,
+ const uint16_t period)
{
using namespace phosphor::logging;
@@ -153,6 +155,7 @@
if (action == Layout::Action::Blink)
{
drivePhysicalLED(service->second, objPath, "DutyOn", dutyOn);
+ drivePhysicalLED(service->second, objPath, "Period", period);
}
drivePhysicalLED(service->second, objPath, "State",
getPhysicalAction(action));
diff --git a/manager.hpp b/manager.hpp
index 65f4c83..34cfa55 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -140,9 +140,10 @@
* @param[in] objPath - dbus object path
* @param[in] action - Intended action to be triggered
* @param[in] dutyOn - Duty Cycle ON percentage
+ * @param[in] period - Time taken for one blink cycle
*/
void drivePhysicalLED(const std::string& objPath, Layout::Action action,
- uint8_t dutyOn);
+ uint8_t dutyOn, const uint16_t period);
/** @brief Makes a dbus call to a passed in service name.
* This is now the physical LED controller