Support multi power buttons with multi behaviors
For supporting more-than-one power buttons behaviors,
add new matches and instances by following json config.
This change is for multiple slots integrated on one chassis,
and each slot has button to control power status.
For example:
/xyz/openbmc_project/Chassis/Buttons/Power01 for button on slot1
/xyz/openbmc_project/Chassis/Buttons/Power02 for button on slot2
Moreover, support multi-level power control by json config,
chassis now can do action by corresponding pressing duration.
Tested:
Press buttons and check corresponding behaviors.
Change-Id: I7789f0367d5e846dd9e68f966ba0755fc916217a
Signed-off-by: Rush Chen <rush.chen.wiwynn@gmail.com>
diff --git a/inc/serial_uart_mux.hpp b/inc/serial_uart_mux.hpp
index a280cb4..1e954da 100644
--- a/inc/serial_uart_mux.hpp
+++ b/inc/serial_uart_mux.hpp
@@ -14,9 +14,8 @@
#include <phosphor-logging/elog-errors.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/bus/match.hpp>
-static constexpr std::string_view DEBUG_CARD_PRESENT_GPIO =
- "debug_card_present";
-static constexpr std::string_view SERIAL_CONSOLE_SWITCH = "SERIAL_UART_MUX";
+static constexpr auto DEBUG_CARD_PRESENT_GPIO = "debug_card_present";
+static constexpr auto SERIAL_CONSOLE_SWITCH = "SERIAL_UART_MUX";
class SerialUartMux final : public ButtonIface
{
@@ -58,11 +57,11 @@
deInit();
}
void init() override;
- static const std::string_view getFormFactorName()
+ static constexpr std::string getFormFactorName()
{
return SERIAL_CONSOLE_SWITCH;
}
- static const char* getDbusObjectPath()
+ static constexpr std::string getDbusObjectPath()
{
return "NO_DBUS_OBJECT";
}