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