1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace battery 7 { 8 // clang-format off 9 10 enum class ChargeState{ 11 Invalid, 12 Idle, 13 Charging, 14 Discharging, 15 }; 16 17 NLOHMANN_JSON_SERIALIZE_ENUM(ChargeState, { 18 {ChargeState::Invalid, "Invalid"}, 19 {ChargeState::Idle, "Idle"}, 20 {ChargeState::Charging, "Charging"}, 21 {ChargeState::Discharging, "Discharging"}, 22 }); 23 24 } 25 // clang-format on 26