1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace chassis 5 { 6 // clang-format off 7 8 enum class ChassisType{ 9 Invalid, 10 Rack, 11 Blade, 12 Enclosure, 13 StandAlone, 14 RackMount, 15 Card, 16 Cartridge, 17 Row, 18 Pod, 19 Expansion, 20 Sidecar, 21 Zone, 22 Sled, 23 Shelf, 24 Drawer, 25 Module, 26 Component, 27 IPBasedDrive, 28 RackGroup, 29 StorageEnclosure, 30 ImmersionTank, 31 HeatExchanger, 32 Other, 33 }; 34 35 enum class IndicatorLED{ 36 Invalid, 37 Unknown, 38 Lit, 39 Blinking, 40 Off, 41 }; 42 43 enum class IntrusionSensor{ 44 Invalid, 45 Normal, 46 HardwareIntrusion, 47 TamperingDetected, 48 }; 49 50 enum class IntrusionSensorReArm{ 51 Invalid, 52 Manual, 53 Automatic, 54 }; 55 56 enum class EnvironmentalClass{ 57 Invalid, 58 A1, 59 A2, 60 A3, 61 A4, 62 }; 63 64 enum class ThermalDirection{ 65 Invalid, 66 FrontToBack, 67 BackToFront, 68 TopExhaust, 69 Sealed, 70 }; 71 72 enum class DoorState{ 73 Invalid, 74 Locked, 75 Closed, 76 LockedAndOpen, 77 Open, 78 }; 79 80 NLOHMANN_JSON_SERIALIZE_ENUM(ChassisType, { 81 {ChassisType::Invalid, "Invalid"}, 82 {ChassisType::Rack, "Rack"}, 83 {ChassisType::Blade, "Blade"}, 84 {ChassisType::Enclosure, "Enclosure"}, 85 {ChassisType::StandAlone, "StandAlone"}, 86 {ChassisType::RackMount, "RackMount"}, 87 {ChassisType::Card, "Card"}, 88 {ChassisType::Cartridge, "Cartridge"}, 89 {ChassisType::Row, "Row"}, 90 {ChassisType::Pod, "Pod"}, 91 {ChassisType::Expansion, "Expansion"}, 92 {ChassisType::Sidecar, "Sidecar"}, 93 {ChassisType::Zone, "Zone"}, 94 {ChassisType::Sled, "Sled"}, 95 {ChassisType::Shelf, "Shelf"}, 96 {ChassisType::Drawer, "Drawer"}, 97 {ChassisType::Module, "Module"}, 98 {ChassisType::Component, "Component"}, 99 {ChassisType::IPBasedDrive, "IPBasedDrive"}, 100 {ChassisType::RackGroup, "RackGroup"}, 101 {ChassisType::StorageEnclosure, "StorageEnclosure"}, 102 {ChassisType::ImmersionTank, "ImmersionTank"}, 103 {ChassisType::HeatExchanger, "HeatExchanger"}, 104 {ChassisType::Other, "Other"}, 105 }); 106 107 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 108 {IndicatorLED::Invalid, "Invalid"}, 109 {IndicatorLED::Unknown, "Unknown"}, 110 {IndicatorLED::Lit, "Lit"}, 111 {IndicatorLED::Blinking, "Blinking"}, 112 {IndicatorLED::Off, "Off"}, 113 }); 114 115 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensor, { 116 {IntrusionSensor::Invalid, "Invalid"}, 117 {IntrusionSensor::Normal, "Normal"}, 118 {IntrusionSensor::HardwareIntrusion, "HardwareIntrusion"}, 119 {IntrusionSensor::TamperingDetected, "TamperingDetected"}, 120 }); 121 122 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensorReArm, { 123 {IntrusionSensorReArm::Invalid, "Invalid"}, 124 {IntrusionSensorReArm::Manual, "Manual"}, 125 {IntrusionSensorReArm::Automatic, "Automatic"}, 126 }); 127 128 NLOHMANN_JSON_SERIALIZE_ENUM(EnvironmentalClass, { 129 {EnvironmentalClass::Invalid, "Invalid"}, 130 {EnvironmentalClass::A1, "A1"}, 131 {EnvironmentalClass::A2, "A2"}, 132 {EnvironmentalClass::A3, "A3"}, 133 {EnvironmentalClass::A4, "A4"}, 134 }); 135 136 NLOHMANN_JSON_SERIALIZE_ENUM(ThermalDirection, { 137 {ThermalDirection::Invalid, "Invalid"}, 138 {ThermalDirection::FrontToBack, "FrontToBack"}, 139 {ThermalDirection::BackToFront, "BackToFront"}, 140 {ThermalDirection::TopExhaust, "TopExhaust"}, 141 {ThermalDirection::Sealed, "Sealed"}, 142 }); 143 144 NLOHMANN_JSON_SERIALIZE_ENUM(DoorState, { 145 {DoorState::Invalid, "Invalid"}, 146 {DoorState::Locked, "Locked"}, 147 {DoorState::Closed, "Closed"}, 148 {DoorState::LockedAndOpen, "LockedAndOpen"}, 149 {DoorState::Open, "Open"}, 150 }); 151 152 } 153 // clang-format on 154