Go to the documentation of this file.00001 #ifndef VARIANTS_HPP
00002 #define VARIANTS_HPP
00003
00004 #include <map>
00005 #include <string>
00006
00007 namespace msp {
00008
00013 enum class FirmwareVariant : int {
00014 NONE = 0,
00015 MWII = 1,
00016 BAFL = 2,
00017 BTFL = 3,
00018 CLFL = 4,
00019 INAV = 5,
00020 RCFL = 6
00021 };
00022
00023 const static std::map<std::string, FirmwareVariant> variant_map = {
00024 {"MWII", FirmwareVariant::MWII},
00025 {"BAFL", FirmwareVariant::BAFL},
00026 {"BTFL", FirmwareVariant::BTFL},
00027 {"CLFL", FirmwareVariant::CLFL},
00028 {"INAV", FirmwareVariant::INAV},
00029 {"RCFL", FirmwareVariant::RCFL}};
00030
00036 inline std::string firmwareVariantToString(FirmwareVariant variant) {
00037 std::string var;
00038 switch(variant) {
00039 case FirmwareVariant::MWII:
00040 var = "MWII";
00041 break;
00042 case FirmwareVariant::BAFL:
00043 var = "BAFL";
00044 break;
00045 case FirmwareVariant::BTFL:
00046 var = "BTFL";
00047 break;
00048 case FirmwareVariant::CLFL:
00049 var = "CLFL";
00050 break;
00051 case FirmwareVariant::INAV:
00052 var = "INAV";
00053 break;
00054 case FirmwareVariant::RCFL:
00055 var = "RCFL";
00056 break;
00057 default:
00058 var = "NONE";
00059 }
00060 return var;
00061 }
00062
00063 }
00064 #endif