1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace cable 5 { 6 // clang-format off 7 8 enum class CableClass{ 9 Invalid, 10 Power, 11 Network, 12 Storage, 13 Fan, 14 PCIe, 15 USB, 16 Video, 17 Fabric, 18 Serial, 19 General, 20 }; 21 22 enum class ConnectorType{ 23 Invalid, 24 ACPower, 25 DB9, 26 DCPower, 27 DisplayPort, 28 HDMI, 29 ICI, 30 IPASS, 31 PCIe, 32 Proprietary, 33 RJ45, 34 SATA, 35 SCSI, 36 SlimSAS, 37 SFP, 38 SFPPlus, 39 USBA, 40 USBC, 41 QSFP, 42 CDFP, 43 OSFP, 44 }; 45 46 enum class CableStatus{ 47 Invalid, 48 Normal, 49 Degraded, 50 Failed, 51 Testing, 52 Disabled, 53 SetByService, 54 }; 55 56 NLOHMANN_JSON_SERIALIZE_ENUM(CableClass, { 57 {CableClass::Invalid, "Invalid"}, 58 {CableClass::Power, "Power"}, 59 {CableClass::Network, "Network"}, 60 {CableClass::Storage, "Storage"}, 61 {CableClass::Fan, "Fan"}, 62 {CableClass::PCIe, "PCIe"}, 63 {CableClass::USB, "USB"}, 64 {CableClass::Video, "Video"}, 65 {CableClass::Fabric, "Fabric"}, 66 {CableClass::Serial, "Serial"}, 67 {CableClass::General, "General"}, 68 }); 69 70 NLOHMANN_JSON_SERIALIZE_ENUM(ConnectorType, { 71 {ConnectorType::Invalid, "Invalid"}, 72 {ConnectorType::ACPower, "ACPower"}, 73 {ConnectorType::DB9, "DB9"}, 74 {ConnectorType::DCPower, "DCPower"}, 75 {ConnectorType::DisplayPort, "DisplayPort"}, 76 {ConnectorType::HDMI, "HDMI"}, 77 {ConnectorType::ICI, "ICI"}, 78 {ConnectorType::IPASS, "IPASS"}, 79 {ConnectorType::PCIe, "PCIe"}, 80 {ConnectorType::Proprietary, "Proprietary"}, 81 {ConnectorType::RJ45, "RJ45"}, 82 {ConnectorType::SATA, "SATA"}, 83 {ConnectorType::SCSI, "SCSI"}, 84 {ConnectorType::SlimSAS, "SlimSAS"}, 85 {ConnectorType::SFP, "SFP"}, 86 {ConnectorType::SFPPlus, "SFPPlus"}, 87 {ConnectorType::USBA, "USBA"}, 88 {ConnectorType::USBC, "USBC"}, 89 {ConnectorType::QSFP, "QSFP"}, 90 {ConnectorType::CDFP, "CDFP"}, 91 {ConnectorType::OSFP, "OSFP"}, 92 }); 93 94 NLOHMANN_JSON_SERIALIZE_ENUM(CableStatus, { 95 {CableStatus::Invalid, "Invalid"}, 96 {CableStatus::Normal, "Normal"}, 97 {CableStatus::Degraded, "Degraded"}, 98 {CableStatus::Failed, "Failed"}, 99 {CableStatus::Testing, "Testing"}, 100 {CableStatus::Disabled, "Disabled"}, 101 {CableStatus::SetByService, "SetByService"}, 102 }); 103 104 } 105 // clang-format on 106