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 Other, 31 }; 32 33 enum class IndicatorLED{ 34 Invalid, 35 Unknown, 36 Lit, 37 Blinking, 38 Off, 39 }; 40 41 enum class PowerState{ 42 Invalid, 43 On, 44 Off, 45 PoweringOn, 46 PoweringOff, 47 }; 48 49 enum class IntrusionSensor{ 50 Invalid, 51 Normal, 52 HardwareIntrusion, 53 TamperingDetected, 54 }; 55 56 enum class IntrusionSensorReArm{ 57 Invalid, 58 Manual, 59 Automatic, 60 }; 61 62 enum class EnvironmentalClass{ 63 Invalid, 64 A1, 65 A2, 66 A3, 67 A4, 68 }; 69 70 enum class ThermalDirection{ 71 Invalid, 72 FrontToBack, 73 BackToFront, 74 TopExhaust, 75 Sealed, 76 }; 77 78 NLOHMANN_JSON_SERIALIZE_ENUM(ChassisType, { 79 {ChassisType::Invalid, "Invalid"}, 80 {ChassisType::Rack, "Rack"}, 81 {ChassisType::Blade, "Blade"}, 82 {ChassisType::Enclosure, "Enclosure"}, 83 {ChassisType::StandAlone, "StandAlone"}, 84 {ChassisType::RackMount, "RackMount"}, 85 {ChassisType::Card, "Card"}, 86 {ChassisType::Cartridge, "Cartridge"}, 87 {ChassisType::Row, "Row"}, 88 {ChassisType::Pod, "Pod"}, 89 {ChassisType::Expansion, "Expansion"}, 90 {ChassisType::Sidecar, "Sidecar"}, 91 {ChassisType::Zone, "Zone"}, 92 {ChassisType::Sled, "Sled"}, 93 {ChassisType::Shelf, "Shelf"}, 94 {ChassisType::Drawer, "Drawer"}, 95 {ChassisType::Module, "Module"}, 96 {ChassisType::Component, "Component"}, 97 {ChassisType::IPBasedDrive, "IPBasedDrive"}, 98 {ChassisType::RackGroup, "RackGroup"}, 99 {ChassisType::StorageEnclosure, "StorageEnclosure"}, 100 {ChassisType::Other, "Other"}, 101 }); 102 103 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 104 {IndicatorLED::Invalid, "Invalid"}, 105 {IndicatorLED::Unknown, "Unknown"}, 106 {IndicatorLED::Lit, "Lit"}, 107 {IndicatorLED::Blinking, "Blinking"}, 108 {IndicatorLED::Off, "Off"}, 109 }); 110 111 NLOHMANN_JSON_SERIALIZE_ENUM(PowerState, { 112 {PowerState::Invalid, "Invalid"}, 113 {PowerState::On, "On"}, 114 {PowerState::Off, "Off"}, 115 {PowerState::PoweringOn, "PoweringOn"}, 116 {PowerState::PoweringOff, "PoweringOff"}, 117 }); 118 119 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensor, { 120 {IntrusionSensor::Invalid, "Invalid"}, 121 {IntrusionSensor::Normal, "Normal"}, 122 {IntrusionSensor::HardwareIntrusion, "HardwareIntrusion"}, 123 {IntrusionSensor::TamperingDetected, "TamperingDetected"}, 124 }); 125 126 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensorReArm, { 127 {IntrusionSensorReArm::Invalid, "Invalid"}, 128 {IntrusionSensorReArm::Manual, "Manual"}, 129 {IntrusionSensorReArm::Automatic, "Automatic"}, 130 }); 131 132 NLOHMANN_JSON_SERIALIZE_ENUM(EnvironmentalClass, { 133 {EnvironmentalClass::Invalid, "Invalid"}, 134 {EnvironmentalClass::A1, "A1"}, 135 {EnvironmentalClass::A2, "A2"}, 136 {EnvironmentalClass::A3, "A3"}, 137 {EnvironmentalClass::A4, "A4"}, 138 }); 139 140 NLOHMANN_JSON_SERIALIZE_ENUM(ThermalDirection, { 141 {ThermalDirection::Invalid, "Invalid"}, 142 {ThermalDirection::FrontToBack, "FrontToBack"}, 143 {ThermalDirection::BackToFront, "BackToFront"}, 144 {ThermalDirection::TopExhaust, "TopExhaust"}, 145 {ThermalDirection::Sealed, "Sealed"}, 146 }); 147 148 } 149 // clang-format on 150