Chassishandler: Add chassis identify state support for chassis status command

Return the present chassis identify state in get chassis status command:
Off
Temporary on
Indefinite on
Reserved

Tested:
Set chassis identify in different states:
ipmitool raw 0 4 10 0
ipmitool raw 0 4 0 1
ipmitool raw 0 4 0 0

Then query the chassis status and check on the third byte
ipmitool raw 0 1

Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: I66690b74823a6b819c4fda25d95bc8690b98181a
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 0d2265f..1738ccc 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -43,6 +43,8 @@
 std::unique_ptr<phosphor::Timer> identifyTimer
     __attribute__((init_priority(101)));
 
+static ChassisIDState chassisIDState = ChassisIDState::reserved;
+
 constexpr size_t SIZE_MAC = 18;
 constexpr size_t SIZE_BOOT_OPTION = (uint8_t)
     BootOptionResponseSize::OPAL_NETWORK_SETTINGS; // Maximum size of the boot
@@ -1009,7 +1011,7 @@
     constexpr bool coolingFanFault = false;
     // chassisIdentifySupport set because this command is implemented
     constexpr bool chassisIdentifySupport = true;
-    constexpr uint2_t chassisIdentifyState(0);
+    uint2_t chassisIdentifyState = static_cast<uint2_t>(chassisIDState);
     constexpr bool diagButtonDisabled = false;
     constexpr bool sleepButtonDisabled = false;
     constexpr bool diagButtonDisableAllow = false;
@@ -1252,6 +1254,7 @@
 {
     try
     {
+        chassisIDState = ChassisIDState::off;
         enclosureIdentifyLed(false);
     }
     catch (const InternalFailure& e)
@@ -1284,6 +1287,7 @@
         identifyTimer->stop();
         try
         {
+            chassisIDState = ChassisIDState::temporaryOn;
             enclosureIdentifyLed(true);
         }
         catch (const InternalFailure& e)
@@ -1294,6 +1298,7 @@
 
         if (forceIdentify)
         {
+            chassisIDState = ChassisIDState::indefiniteOn;
             return ipmi::responseSuccess();
         }
         // start the timer