Show chassis identify status in chassis status response
This saves the chassis identify status and returns it as part
of the chassis status command.
Tested:
Chassis identify status is bits 5:4 of the third byte:
Chassis identify off:
ipmitool raw 0 1
01 10 40 70
Set chassis identify to indefinite:
ipmitool raw 0 4 0 1
ipmitool raw 0 1
01 10 60 70
Press the physical ID button to disable identify:
ipmitool raw 0 1
01 10 40 70
Set chassis identify to temporary:
ipmitool raw 0 4
ipmitool raw 0 1
01 10 50 70
Wait for timeout:
ipmitool raw 0 1
01 10 40 70
Change-Id: I4bdd2052d26c665b9d9ce3e01f4b5399336d0e6e
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/src/chassiscommands.cpp b/src/chassiscommands.cpp
index 04035f0..1af5b28 100644
--- a/src/chassiscommands.cpp
+++ b/src/chassiscommands.cpp
@@ -53,6 +53,13 @@
"/xyz/openbmc_project/led/groups/enclosure_identify_blink";
const static constexpr char* ledInterface = "xyz.openbmc_project.Led.Group";
const static constexpr char* ledProp = "Asserted";
+enum class ChassisIDState
+{
+ off = 0,
+ temporary = 1,
+ indefinite = 2,
+};
+static ChassisIDState chassisIDState = ChassisIDState::off;
constexpr size_t defaultIdentifyTimeOut = 15;
@@ -104,6 +111,7 @@
void enclosureIdentifyLedBlinkOff()
{
+ chassisIDState = ChassisIDState::off;
enclosureIdentifyLed(ledIDBlinkObj, false);
}
@@ -147,6 +155,7 @@
if (asserted)
{
// LED is blinking, turn off the LED
+ chassisIDState = ChassisIDState::off;
enclosureIdentifyLed(ledIDBlinkObj, false);
enclosureIdentifyLed(ledIDOnObj, false);
}
@@ -185,8 +194,10 @@
enclosureIdentifyLed(ledIDBlinkObj, true);
if (forceIdentify)
{
+ chassisIDState = ChassisIDState::indefinite;
return ipmi::responseSuccess();
}
+ chassisIDState = ChassisIDState::temporary;
// start the timer
auto time = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::seconds(identifyInterval));
@@ -194,6 +205,7 @@
}
else
{
+ chassisIDState = ChassisIDState::off;
enclosureIdentifyLed(ledIDBlinkObj, false);
}
return ipmi::responseSuccess();
@@ -453,7 +465,7 @@
constexpr bool coolingFanFault = false;
// chassisIdentifySupport set because this command is implemented
constexpr bool chassisIdentifySupport = true;
- uint2_t chassisIdentifyState = 0;
+ uint2_t chassisIdentifyState = chassisIDState;
constexpr bool sleepButtonDisabled = false;
constexpr bool sleepButtonDisableAllow = false;