A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
create method to map to infrared protocol enum
Geo5b4e513744a2
diff --git a/src/Enums/InfraredProtocolEnum.h b/src/Enums/InfraredProtocolEnum.hindex 83951c4e..8295595f 100644--- a/src/Enums/InfraredProtocolEnum.h+++ b/src/Enums/InfraredProtocolEnum.h@@ -242,4 +242,101 @@ public:default: return "nec2";}}++ static const InfraredProtocolEnum toEnum(const std::string& protocolStr) {+ if (protocolStr == "nec1") return _48_NEC1;+ if (protocolStr == "NEC1") return _48_NEC1;+ if (protocolStr == "nec2") return _48_NEC2;+ if (protocolStr == "aiwa") return AIWA;+ if (protocolStr == "akai") return AKAI;+ if (protocolStr == "apple") return _APPLE;+ if (protocolStr == "barco") return BARCO;+ if (protocolStr == "blaupunkt") return BLAUPUNKT;+ if (protocolStr == "bose") return BOSE;+ if (protocolStr == "canalsat") return CANALSAT;+ if (protocolStr == "denon") return _DENON;+ if (protocolStr == "Denon-K") return DENON_K;+ if (protocolStr == "denon1") return DENON_1_;+ if (protocolStr == "denon2") return DENON_2_;+ if (protocolStr == "Dgtec") return DGTEC;+ if (protocolStr == "directv") return DIRECTV;+ if (protocolStr == "DishPlayer_Network") return DISH_NETWORK;+ if (protocolStr == "emerson") return EMERSON;+ if (protocolStr == "f12") return F12;+ if (protocolStr == "fujitsu") return FUJITSU;+ if (protocolStr == "GI4dtv") return G_I_4DTV;+ if (protocolStr == "GI_cable") return G_I_CABLE;+ if (protocolStr == "gxb") return GXB;+ if (protocolStr == "grundig16") return GRUNDIG16;+ if (protocolStr == "grundig16_30") return GRUNDIG16_30;+ if (protocolStr == "jvc") return _JVC;+ if (protocolStr == "jvc_two_frames") return JVC_2_;+ if (protocolStr == "Jerrold") return JERROLD;+ if (protocolStr == "kathrein") return KATHREIN;+ if (protocolStr == "konka") return KONKA;+ if (protocolStr == "logitech") return LOGITECH;+ if (protocolStr == "lumagen") return LUMAGEN;+ if (protocolStr == "mce") return MCE;+ if (protocolStr == "Mitsubishi") return MITSUBISHI;+ if (protocolStr == "nec") return _NEC;+ if (protocolStr == "NEC") return _NEC;+ if (protocolStr == "nec1_f16") return NEC1_F16;+ if (protocolStr == "nec1_rnc") return NEC1_RNC;+ if (protocolStr == "nec1_y1") return NEC1_Y1;+ if (protocolStr == "nec1_y2") return NEC1_Y2;+ if (protocolStr == "nec1_y3") return NEC1_Y3;+ if (protocolStr == "nec2_f16") return NEC2_F16;+ if (protocolStr == "NECx1") return NECX1;+ if (protocolStr == "NECx2") return NECX2;+ if (protocolStr == "NECext") return NECX2;+ if (protocolStr == "NEC42") return NEC42;+ if (protocolStr == "NEC42ext") return NEC42ext;+ if (protocolStr == "nrc16") return NRC16;+ if (protocolStr == "nrc17") return NRC17;+ if (protocolStr == "Nokia32") return NOKIA;+ if (protocolStr == "pacemss") return PACEMSS;+ if (protocolStr == "panasonic") return _PANASONIC;+ if (protocolStr == "panasonic2") return PANASONIC2;+ if (protocolStr == "panasonic_old") return PANASONIC_OLD;+ if (protocolStr == "pioneer") return PIONEER;+ if (protocolStr == "Proton") return PROTON;+ if (protocolStr == "rc5") return _RC5;+ if (protocolStr == "RC5") return _RC5;+ if (protocolStr == "rc5x") return RC5X;+ if (protocolStr == "RC5X") return RC5X;+ if (protocolStr == "rc5odd") return RC5_7F;+ if (protocolStr == "rc6") return _RC6;+ if (protocolStr == "RC6") return _RC6;+ if (protocolStr == "rc6-6-20") return RC6_6_20;+ if (protocolStr == "rca") return RCA;+ if (protocolStr == "recs80_45") return RECS80;+ if (protocolStr == "replay") return REPLAY;+ if (protocolStr == "Samsung") return _SAMSUNG;+ if (protocolStr == "Samsung20") return SAMSUNG20;+ if (protocolStr == "Samsung32") return SAMSUNG32;+ if (protocolStr == "Samsung36") return SAMSUNG36;+ if (protocolStr == "scatl_6") return SCATL_6;+ if (protocolStr == "sejin_1_38") return SEJIN_1_38;+ if (protocolStr == "sejin_1_56") return SEJIN_1_56;+ if (protocolStr == "sharp") return _SHARP;+ if (protocolStr == "SIRC") return SIRC;+ if (protocolStr == "SIRC15") return SIRC15;+ if (protocolStr == "SIRC20") return SIRC20;+ if (protocolStr == "sony12") return SONY12;+ if (protocolStr == "sony15") return SONY15;+ if (protocolStr == "sony20") return SONY20;+ if (protocolStr == "streamzap") return STREAMZAP;+ if (protocolStr == "Teac-K") return TEAC_K;+ if (protocolStr == "Thomson") return THOMSON;+ if (protocolStr == "Tivo-Nec1") return TIVO_UNIT;+ if (protocolStr == "velleman") return VELLEMAN;+ if (protocolStr == "XMP") return XMP;+ if (protocolStr == "zaptor_56") return ZAPTOR_56;+ if (protocolStr == "zenith") return ZENITH;+ if (protocolStr == "DishPlayer_Network") return DISH_NETWO;+ if (protocolStr == "Kaseikyo") return _KASEIKYO;+ if (protocolStr == "raw") return RAW;+ return _NEC2; // Default or fallback+ }+};