Update physical LEDs as part of Lamp test
- Add the getSubTreePaths method for utils and update all physical
LEDs.
- Uses GetSubTreePath on Physical LED paths and interfaces and
updates all the LEDs to ON as part of start or restart of the test.
- When the lamp test is stopped or the timer expires, all the LEDs
are turned OFF.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I27727db62fe963a1a7c8b391d73801bcaf9efeec
diff --git a/manager.hpp b/manager.hpp
index 91f8b53..f75a81b 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -13,6 +13,9 @@
{
using namespace phosphor::led::utils;
+static constexpr auto PHY_LED_PATH = "/xyz/openbmc_project/led/physical/";
+static constexpr auto PHY_LED_IFACE = "xyz.openbmc_project.Led.Physical";
+
/** @class Manager
* @brief Manages group of LEDs and applies action on the elements of group
*/
@@ -115,6 +118,17 @@
*/
void setOperationalStatus(const std::string& path, bool value) const;
+ /** @brief Chooses appropriate action to be triggered on physical LED
+ * and calls into function that applies the actual action.
+ *
+ * @param[in] objPath - D-Bus 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, const uint16_t period);
+
private:
/** @brief sdbusplus handler */
sdbusplus::bus::bus& bus;
@@ -143,17 +157,6 @@
* @return string equivalent of the passed in enumeration
*/
static std::string getPhysicalAction(Layout::Action action);
-
- /** @brief Chooses appropriate action to be triggered on physical LED
- * and calls into function that applies the actual action.
- *
- * @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, const uint16_t period);
};
} // namespace led