diff --git a/esp8266_deauther/CLI.cpp b/esp8266_deauther/CLI.cpp index d2d9e98..2139d60 100644 --- a/esp8266_deauther/CLI.cpp +++ b/esp8266_deauther/CLI.cpp @@ -285,7 +285,6 @@ void CLI::runCommand(String input) { prntln(CLI_HELP_SEND_PROBE); prntln(CLI_HELP_LED_A); prntln(CLI_HELP_LED_B); - prntln(CLI_HELP_LED_ENABLE); prntln(CLI_HELP_DRAW); prntln(CLI_HELP_SCREEN_ON); prntln(CLI_HELP_SCREEN_MODE); @@ -1088,6 +1087,21 @@ void CLI::runCommand(String input) { } } + // ===== LED ===== // + // led [] + else if ((list->size() == 4) && eqlsCMD(0, CLI_LED)) { + led::setColor(list->get(1).toInt(), list->get(2).toInt(), list->get(3).toInt()); + } + + // led <#rrggbb> [] + else if ((list->size() == 2) && + eqlsCMD(0, CLI_LED) && (list->get(1).charAt(0) == HASHSIGN)) { + uint8_t c[3]; + strToColor(list->get(1), c); + + led::setColor(c[0], c[1], c[2]); + } + // ===== DELAY ===== // else if ((list->size() == 2) && eqlsCMD(0, CLI_DELAY)) { uint32_t endTime = currentTime + getTime(list->get(1)); diff --git a/esp8266_deauther/language.h b/esp8266_deauther/language.h index 03f2fc5..b6c1ab3 100644 --- a/esp8266_deauther/language.h +++ b/esp8266_deauther/language.h @@ -201,9 +201,8 @@ const char CLI_HELP_COMMENT[] PROGMEM = "// "; const char CLI_HELP_SEND_DEAUTH[] PROGMEM = "send deauth "; const char CLI_HELP_SEND_BEACON[] PROGMEM = "send beacon [wpa2]"; const char CLI_HELP_SEND_PROBE[] PROGMEM = "send probe "; -const char CLI_HELP_LED_A[] PROGMEM = "led []"; -const char CLI_HELP_LED_B[] PROGMEM = "led <#rrggbb> []"; -const char CLI_HELP_LED_ENABLE[] PROGMEM = "led "; +const char CLI_HELP_LED_A[] PROGMEM = "led "; +const char CLI_HELP_LED_B[] PROGMEM = "led <#rrggbb>"; const char CLI_HELP_DRAW[] PROGMEM = "draw"; const char CLI_HELP_SCREEN_ON[] PROGMEM = "screen "; const char CLI_HELP_SCREEN_MODE[] PROGMEM = "screen mode "; diff --git a/esp8266_deauther/led.h b/esp8266_deauther/led.h index e08c0de..1f7b046 100644 --- a/esp8266_deauther/led.h +++ b/esp8266_deauther/led.h @@ -2,6 +2,8 @@ #pragma once +#include + enum LED_MODE { OFF, SCAN, @@ -13,4 +15,5 @@ namespace led { void setup(); void update(); void setMode(LED_MODE new_mode, bool force = false); + void setColor(uint8_t r, uint8_t g, uint8_t b); } \ No newline at end of file diff --git a/esp8266_deauther/wifi.cpp b/esp8266_deauther/wifi.cpp index 25b2b63..5b270e4 100644 --- a/esp8266_deauther/wifi.cpp +++ b/esp8266_deauther/wifi.cpp @@ -148,7 +148,7 @@ namespace wifi { else if (filename.endsWith(str(W_DOT_PDF))) return str(W_XPDF); else if (filename.endsWith(str(W_DOT_ZIP))) return str(W_XZIP); else if (filename.endsWith(str(W_DOT_JSON))) return str(W_JSON); - else return str(W_TXT); + return str(W_TXT); } bool handleFileRead(String path) { diff --git a/serialcommands.md b/serialcommands.md index fa3533b..8ad8e37 100644 --- a/serialcommands.md +++ b/serialcommands.md @@ -44,7 +44,6 @@ - [`send probe `](#send) - [`led []`](#led) - [`led <#rrggbb> []`](#led) -- [`led `](#led) - [`draw`](#draw) - [`startap`](#startap) - [`stopap`](#startap) @@ -290,19 +289,14 @@ Copy pasting packets out of Wireshark is very unlikely to work. Also note that you're still limited to 512 characters per command! ## LED -`led []` +`led ` Changes LED color based on input. -Be sure to disable the LED updates (see command below), if you don't want the color the be rewritten by a scan or attack. -The brightness is optional and must be given in percent (between 0 and 100). +Be sure to disable the LED updates (see command below), if you don't want the color the be rewritten by a scan or attack. -`led <#rrggbb> []` +`led <#rrggbb>` Changes LED color based on input in form of a hex value. The value **must** start with a `#` and have 6 following characters. -`led ` -Dis/Enables the LED updates. If disabled, the color will not change automatically anymore if you start a scan or attack. -To disable the LED in general use `set ledenabled false`. - ## DELAY `delay