button_handler: fix invalid power event error
Current power button handler handles longPowerReleased event, which
should be longPowerPressed.
revert back to longPowerPressed to avoid error of invalid power event.
Tested on Bletchley:
- Before
```
root@bletchley:~# journalctl -u phosphor-button-handler
Dec 19 21:52:53 bletchley button-handler[521]: Multi-host system detected : 6
Dec 19 21:52:53 bletchley button-handler[521]: 1 is invalid power event. skipping...
```
- After
```
root@bletchley:~# journalctl -u phosphor-button-handler
Dec 19 21:34:58 bletchley button-handler[418]: Multi-host system detected : 6
Dec 19 21:34:58 bletchley button-handler[418]: handlePowerEvent : handle long power button press
```
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I77977f23f9e669cd4a8785608f1cb3ca4d148bed
diff --git a/src/button_handler.cpp b/src/button_handler.cpp
index 29ae1bc..38649f0 100644
--- a/src/button_handler.cpp
+++ b/src/button_handler.cpp
@@ -207,7 +207,7 @@
// ignore power and reset button events if BMC is selected.
if (isMultiHostSystem && (hostNumber == BMC_POSITION) &&
- (powerEventType != PowerEvent::longPowerReleased))
+ (powerEventType != PowerEvent::longPowerPressed))
{
lg2::info(
"handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events...");
@@ -232,7 +232,7 @@
break;
}
- case PowerEvent::longPowerReleased:
+ case PowerEvent::longPowerPressed:
{
dbusIfaceName = chassisIface;
transitionName = "RequestedPowerTransition";