1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace sensor 7 { 8 // clang-format off 9 10 enum class VoltageType{ 11 Invalid, 12 AC, 13 DC, 14 }; 15 16 enum class ElectricalContext{ 17 Invalid, 18 Line1, 19 Line2, 20 Line3, 21 Neutral, 22 LineToLine, 23 Line1ToLine2, 24 Line2ToLine3, 25 Line3ToLine1, 26 LineToNeutral, 27 Line1ToNeutral, 28 Line2ToNeutral, 29 Line3ToNeutral, 30 Line1ToNeutralAndL1L2, 31 Line2ToNeutralAndL1L2, 32 Line2ToNeutralAndL2L3, 33 Line3ToNeutralAndL3L1, 34 Total, 35 }; 36 37 enum class ThresholdActivation{ 38 Invalid, 39 Increasing, 40 Decreasing, 41 Either, 42 Disabled, 43 }; 44 45 enum class ReadingType{ 46 Invalid, 47 Temperature, 48 Humidity, 49 Power, 50 EnergykWh, 51 EnergyJoules, 52 EnergyWh, 53 ChargeAh, 54 Voltage, 55 Current, 56 Frequency, 57 Pressure, 58 PressurekPa, 59 PressurePa, 60 LiquidLevel, 61 Rotational, 62 AirFlow, 63 AirFlowCMM, 64 LiquidFlow, 65 LiquidFlowLPM, 66 Barometric, 67 Altitude, 68 Percent, 69 AbsoluteHumidity, 70 Heat, 71 }; 72 73 enum class ImplementationType{ 74 Invalid, 75 PhysicalSensor, 76 Synthesized, 77 Reported, 78 }; 79 80 enum class ReadingBasisType{ 81 Invalid, 82 Zero, 83 Delta, 84 Headroom, 85 }; 86 87 NLOHMANN_JSON_SERIALIZE_ENUM(VoltageType, { 88 {VoltageType::Invalid, "Invalid"}, 89 {VoltageType::AC, "AC"}, 90 {VoltageType::DC, "DC"}, 91 }); 92 93 NLOHMANN_JSON_SERIALIZE_ENUM(ElectricalContext, { 94 {ElectricalContext::Invalid, "Invalid"}, 95 {ElectricalContext::Line1, "Line1"}, 96 {ElectricalContext::Line2, "Line2"}, 97 {ElectricalContext::Line3, "Line3"}, 98 {ElectricalContext::Neutral, "Neutral"}, 99 {ElectricalContext::LineToLine, "LineToLine"}, 100 {ElectricalContext::Line1ToLine2, "Line1ToLine2"}, 101 {ElectricalContext::Line2ToLine3, "Line2ToLine3"}, 102 {ElectricalContext::Line3ToLine1, "Line3ToLine1"}, 103 {ElectricalContext::LineToNeutral, "LineToNeutral"}, 104 {ElectricalContext::Line1ToNeutral, "Line1ToNeutral"}, 105 {ElectricalContext::Line2ToNeutral, "Line2ToNeutral"}, 106 {ElectricalContext::Line3ToNeutral, "Line3ToNeutral"}, 107 {ElectricalContext::Line1ToNeutralAndL1L2, "Line1ToNeutralAndL1L2"}, 108 {ElectricalContext::Line2ToNeutralAndL1L2, "Line2ToNeutralAndL1L2"}, 109 {ElectricalContext::Line2ToNeutralAndL2L3, "Line2ToNeutralAndL2L3"}, 110 {ElectricalContext::Line3ToNeutralAndL3L1, "Line3ToNeutralAndL3L1"}, 111 {ElectricalContext::Total, "Total"}, 112 }); 113 114 NLOHMANN_JSON_SERIALIZE_ENUM(ThresholdActivation, { 115 {ThresholdActivation::Invalid, "Invalid"}, 116 {ThresholdActivation::Increasing, "Increasing"}, 117 {ThresholdActivation::Decreasing, "Decreasing"}, 118 {ThresholdActivation::Either, "Either"}, 119 {ThresholdActivation::Disabled, "Disabled"}, 120 }); 121 122 NLOHMANN_JSON_SERIALIZE_ENUM(ReadingType, { 123 {ReadingType::Invalid, "Invalid"}, 124 {ReadingType::Temperature, "Temperature"}, 125 {ReadingType::Humidity, "Humidity"}, 126 {ReadingType::Power, "Power"}, 127 {ReadingType::EnergykWh, "EnergykWh"}, 128 {ReadingType::EnergyJoules, "EnergyJoules"}, 129 {ReadingType::EnergyWh, "EnergyWh"}, 130 {ReadingType::ChargeAh, "ChargeAh"}, 131 {ReadingType::Voltage, "Voltage"}, 132 {ReadingType::Current, "Current"}, 133 {ReadingType::Frequency, "Frequency"}, 134 {ReadingType::Pressure, "Pressure"}, 135 {ReadingType::PressurekPa, "PressurekPa"}, 136 {ReadingType::PressurePa, "PressurePa"}, 137 {ReadingType::LiquidLevel, "LiquidLevel"}, 138 {ReadingType::Rotational, "Rotational"}, 139 {ReadingType::AirFlow, "AirFlow"}, 140 {ReadingType::AirFlowCMM, "AirFlowCMM"}, 141 {ReadingType::LiquidFlow, "LiquidFlow"}, 142 {ReadingType::LiquidFlowLPM, "LiquidFlowLPM"}, 143 {ReadingType::Barometric, "Barometric"}, 144 {ReadingType::Altitude, "Altitude"}, 145 {ReadingType::Percent, "Percent"}, 146 {ReadingType::AbsoluteHumidity, "AbsoluteHumidity"}, 147 {ReadingType::Heat, "Heat"}, 148 }); 149 150 NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, { 151 {ImplementationType::Invalid, "Invalid"}, 152 {ImplementationType::PhysicalSensor, "PhysicalSensor"}, 153 {ImplementationType::Synthesized, "Synthesized"}, 154 {ImplementationType::Reported, "Reported"}, 155 }); 156 157 NLOHMANN_JSON_SERIALIZE_ENUM(ReadingBasisType, { 158 {ReadingBasisType::Invalid, "Invalid"}, 159 {ReadingBasisType::Zero, "Zero"}, 160 {ReadingBasisType::Delta, "Delta"}, 161 {ReadingBasisType::Headroom, "Headroom"}, 162 }); 163 164 } 165 // clang-format on 166