1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace serial_interface 5 { 6 // clang-format off 7 8 enum class SignalType{ 9 Invalid, 10 Rs232, 11 Rs485, 12 }; 13 14 enum class Parity{ 15 Invalid, 16 None, 17 Even, 18 Odd, 19 Mark, 20 Space, 21 }; 22 23 enum class FlowControl{ 24 Invalid, 25 None, 26 Software, 27 Hardware, 28 }; 29 30 enum class PinOut{ 31 Invalid, 32 Cisco, 33 Cyclades, 34 Digi, 35 }; 36 37 NLOHMANN_JSON_SERIALIZE_ENUM(SignalType, { 38 {SignalType::Invalid, "Invalid"}, 39 {SignalType::Rs232, "Rs232"}, 40 {SignalType::Rs485, "Rs485"}, 41 }); 42 43 NLOHMANN_JSON_SERIALIZE_ENUM(Parity, { 44 {Parity::Invalid, "Invalid"}, 45 {Parity::None, "None"}, 46 {Parity::Even, "Even"}, 47 {Parity::Odd, "Odd"}, 48 {Parity::Mark, "Mark"}, 49 {Parity::Space, "Space"}, 50 }); 51 52 NLOHMANN_JSON_SERIALIZE_ENUM(FlowControl, { 53 {FlowControl::Invalid, "Invalid"}, 54 {FlowControl::None, "None"}, 55 {FlowControl::Software, "Software"}, 56 {FlowControl::Hardware, "Hardware"}, 57 }); 58 59 NLOHMANN_JSON_SERIALIZE_ENUM(PinOut, { 60 {PinOut::Invalid, "Invalid"}, 61 {PinOut::Cisco, "Cisco"}, 62 {PinOut::Cyclades, "Cyclades"}, 63 {PinOut::Digi, "Digi"}, 64 }); 65 66 } 67 // clang-format on 68