diff --git a/configs/DSTIKE_D-duino_with_LED_Ring_Shield/A_config.h b/configs/DSTIKE_D-duino_with_LED_Ring_Shield/A_config.h deleted file mode 100644 index d3af36d..0000000 --- a/configs/DSTIKE_D-duino_with_LED_Ring_Shield/A_config.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SH1106Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED - -// === Settings for RGB LED and Neopixel LED === // -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -// === Settings for Neopixel LED === // -#define LED_NEOPIXEL_NUM 12 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_D-duino_with_LED_Ring_Shield/README.md b/configs/DSTIKE_D-duino_with_LED_Ring_Shield/README.md deleted file mode 100644 index 61ed10b..0000000 --- a/configs/DSTIKE_D-duino_with_LED_Ring_Shield/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE D-duino-b-v5 with the LED Ring Shield - -| | | -| - | - | -| LED Type | Neopixel (WS2812) | -| LED Pin | GPIO 15 | -| Number of LEDs | 12 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | No | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |Disabled | \ No newline at end of file diff --git a/configs/DSTIKE_Deauther_Boy/A_config.h b/configs/DSTIKE_Deauther_Boy/A_config.h deleted file mode 100644 index d1f24e7..0000000 --- a/configs/DSTIKE_Deauther_Boy/A_config.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SH1106Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED - -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 10 -#define BUTTON_DOWN 9 -#define BUTTON_A 14 -#define BUTTON_B 12 - -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED -// ========================================================= // - -#endif diff --git a/configs/DSTIKE_Deauther_Boy/README.md b/configs/DSTIKE_Deauther_Boy/README.md deleted file mode 100644 index fc60a67..0000000 --- a/configs/DSTIKE_Deauther_Boy/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE Deauther Boy - -| | | -| - | - | -| LED Type | Neopixel (WS2812) | -| LED Pin | GPIO 15 | -| Number of LEDs | 1 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | No | -| Button Up |GPIO 10 | -| Button Down | GPIO 9 | -| Button A | GPIO 14 | -| Button B |GPIO 12 | \ No newline at end of file diff --git a/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/A_config.h b/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/A_config.h deleted file mode 100644 index 4f0a776..0000000 --- a/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/A_config.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include -#include -#include "SH1106Wire.h" -#include "SSD1306Wire.h" -#include "SH1106Spi.h" -#include "SSD1306Spi.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of LED you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -//#define DIGITAL_LED -//#define RGB_LED -#define NEOPIXEL_LED - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust following settings for your type of LED - you can ignore the rest of the #define's - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ - -// === Settings for Digital LED and RGB LED === // -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 16 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// === Settings for RGB LED and Neopixel LED === // -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -// === Settings for Neopixel LED === // -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY false // default display setting - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust the pins to match your setup - Comment out the buttons you don't use. - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -//#define BUTTON_LEFT 12 -//#define BUTTON_RIGHT 13 -//#define BUTTON_B 10 - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of display you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - 0x3c = I2C address - SDA = GPIO 5 (D1) - SCL/SCK = GPIO 4 (D2) */ -//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED - -/* RST = GPIO 5 (D1) - DC = GPIO 4 (D2) - CS = GPIO 15 (D8) or GND - SCK/SCL = GPIO 14 (D5) - SDA/MOSI = GPIO 13 (D7) */ -//#define DEAUTHER_DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI -//#define DEAUTHER_DISPLAY SH1106Spi display = SH1106Spi(5, 4, 15); // for 1.3" OLED with SPI - -//#define FLIP_DIPLAY // uncomment that to flip the display vertically -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/README.md b/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/README.md deleted file mode 100644 index 9c3abcf..0000000 --- a/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE Deauther v3 & DSTIKE NodeMCU-07 v2 - -| | | -| - | - | -| LED Type | Neopixel (WS2812b) | -| LED Pin | GPIO 15 | -| Number of LEDs | 1 | -| Highlight LED | disabled | -| Display and buttons enabled | NO | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v1.5S/A_config.h b/configs/DSTIKE_OLED_v1.5S/A_config.h deleted file mode 100644 index 52ff85b..0000000 --- a/configs/DSTIKE_OLED_v1.5S/A_config.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SSD1306Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED - -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v1.5S/README.md b/configs/DSTIKE_OLED_v1.5S/README.md deleted file mode 100644 index 48c7813..0000000 --- a/configs/DSTIKE_OLED_v1.5S/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE Deauther OLED v1.5S - -| | | -| - | - | -| LED Type | Neopixel (WS2812) | -| LED Pin | GPIO 15 | -| Number of LEDs | 1 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SSD1306 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | diff --git a/configs/DSTIKE_OLED_v1_v1.5/A_config.h b/configs/DSTIKE_OLED_v1_v1.5/A_config.h deleted file mode 100644 index 5f48388..0000000 --- a/configs/DSTIKE_OLED_v1_v1.5/A_config.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SSD1306Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define DIGITAL_LED -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 16 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v1_v1.5/README.md b/configs/DSTIKE_OLED_v1_v1.5/README.md deleted file mode 100644 index 13217b6..0000000 --- a/configs/DSTIKE_OLED_v1_v1.5/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# DSTIKE Deauther OLED v1 - v1.5 - -| | | -| - | - | -| LED Type | Digital | -| LED R | GPIO 16 | -| LED G | disabled | -| LED B | GPIO 2 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SSD1306 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v2_v2.5_v3/A_config.h b/configs/DSTIKE_OLED_v2_v2.5_v3/A_config.h deleted file mode 100644 index 345b7fd..0000000 --- a/configs/DSTIKE_OLED_v2_v2.5_v3/A_config.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SH1106Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define DIGITAL_LED - -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 16 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v2_v2.5_v3/README.md b/configs/DSTIKE_OLED_v2_v2.5_v3/README.md deleted file mode 100644 index 0163a36..0000000 --- a/configs/DSTIKE_OLED_v2_v2.5_v3/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# DSTIKE Deauther OLED v2 - v3 - -| | | -| - | - | -| LED Type | Digital | -| LED R | GPIO 16 | -| LED G | disabled | -| LED B | GPIO 2 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v3.5_v4_Monster/A_config.h b/configs/DSTIKE_OLED_v3.5_v4_Monster/A_config.h deleted file mode 100644 index 19900a6..0000000 --- a/configs/DSTIKE_OLED_v3.5_v4_Monster/A_config.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SH1106Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED - -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_OLED_v3.5_v4_Monster/README.md b/configs/DSTIKE_OLED_v3.5_v4_Monster/README.md deleted file mode 100644 index 2bda2ad..0000000 --- a/configs/DSTIKE_OLED_v3.5_v4_Monster/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE Deauther OLED v3.5, v4 & DSTIKE Deauth Monster - -| | | -| - | - | -| LED Type | Neopixel (WS2812) | -| LED Pin | GPIO 15 | -| Number of LEDs | 1 | -| Highlight LED | disabled | -| Display and buttons enabled | YES | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | No | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | diff --git a/configs/DSTIKE_USB_Deauther_v2/A_config.h b/configs/DSTIKE_USB_Deauther_v2/A_config.h deleted file mode 100644 index f3a5e25..0000000 --- a/configs/DSTIKE_USB_Deauther_v2/A_config.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SSD1306Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED - -// === Settings for RGB LED and Neopixel LED === // -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -// === Settings for Neopixel LED === // -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 4 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY false // default display setting - -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -// ========================================================= // - -#endif diff --git a/configs/DSTIKE_USB_Deauther_v2/README.md b/configs/DSTIKE_USB_Deauther_v2/README.md deleted file mode 100644 index c6fe1de..0000000 --- a/configs/DSTIKE_USB_Deauther_v2/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE USB Deauther v2 - -| | | -| - | - | -| LED Type | Neopixel (WS2812b) | -| LED Pin | GPIO 4 | -| Number of LEDs | 1 | -| Highlight LED | disabled | -| Display and buttons enabled | NO | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up | disabled | -| Button Down | disabled | -| Button A | disabled | -| Button B | disabled | diff --git a/configs/DSTIKE_Wristband_Mini/A_config.h b/configs/DSTIKE_Wristband_Mini/A_config.h deleted file mode 100644 index 74ee455..0000000 --- a/configs/DSTIKE_Wristband_Mini/A_config.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SH1106Wire.h" -// =========================== // - -// ===================== LED CONFIG ==================== // -#define NEOPIXEL_LED -#define HIGHLIGHT_LED 16 - -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRBW + NEO_KHZ800 - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY true // default display setting - -#define BUTTON_UP 12 -#define BUTTON_DOWN 13 -#define BUTTON_A 14 - -#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED -// ========================================================= // - -#endif \ No newline at end of file diff --git a/configs/DSTIKE_Wristband_Mini/README.md b/configs/DSTIKE_Wristband_Mini/README.md deleted file mode 100644 index 7f33fb7..0000000 --- a/configs/DSTIKE_Wristband_Mini/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DSTIKE Deauther Wristband and Deauther Mini - -| | | -| - | - | -| LED Type | Neopixel (WS2812) | -| LED Pin | GPIO 15 | -| Number of LEDs | 1 | -| Highlight LED | 16 | -| Display and buttons enabled | YES | -| Display Driver | SH1106 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | No | -| Button Up |GPIO 12 | -| Button Down | GPIO 13 | -| Button A | GPIO 14 | -| Button B |disabled | \ No newline at end of file diff --git a/configs/Default/A_config.h b/configs/Default/A_config.h deleted file mode 100644 index a555ee9..0000000 --- a/configs/Default/A_config.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include -#include -#include "SH1106Wire.h" -#include "SSD1306Wire.h" -#include "SH1106Spi.h" -#include "SSD1306Spi.h" -// =========================== // - -//#define DEFAULT_SSID "pwned" -//#define HIGHLIGHT_LED 16 - -// ===================== LED CONFIG ==================== // -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of LED you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -#define DIGITAL_LED -//#define RGB_LED -//#define NEOPIXEL_LED - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust following settings for your type of LED - you can ignore the rest of the #define's - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ - -// === Settings for Digital LED and RGB LED === // -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 16 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// === Settings for RGB LED and Neopixel LED === // -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -// === Settings for Neopixel LED === // -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY false // default display setting - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust the pins to match your setup - Comment out the buttons you don't use. - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -#define BUTTON_UP 14 -#define BUTTON_DOWN 12 -#define BUTTON_A 13 - -//#define BUTTON_LEFT 12 -//#define BUTTON_RIGHT 13 -//#define BUTTON_B 10 - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of display you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -*/ -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -//#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED - -/* RST = GPIO 5 (D1) - DC = GPIO 4 (D2) - CS = GPIO 15 (D8) or GND - SCK/SCL = GPIO 14 (D5) - SDA/MOSI = GPIO 13 (D7) */ -//#define DEAUTHER_DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI -//#define DEAUTHER_DISPLAY SH1106Spi display = SH1106Spi(5, 4, 15); // for 1.3" OLED with SPI - -//#define FLIP_DIPLAY // uncomment that to flip the display vertically -// ========================================================= // - -#endif diff --git a/configs/Default/README.md b/configs/Default/README.md deleted file mode 100644 index 7c900fd..0000000 --- a/configs/Default/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Default Config -Default configuration for all boards without using a display or RGB LED. -The display can be enabled over the settings. - -| | | -| - | - | -| LED Type | Digital | -| LED R | GPIO 2 | -| LED G | disabled | -| LED B | GPIO 16 | -| Highlight LED | disabled | -| Display and buttons enabled | NO | -| Display Driver | SSD1306 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 14 (D5) | -| Button Down | GPIO 12 (D6) | -| Button A | GPIO 13 (D7) | -| Button B |disabled | \ No newline at end of file diff --git a/configs/MrRobotBadge_Dickbutt_Addon/A_config.h b/configs/MrRobotBadge_Dickbutt_Addon/A_config.h deleted file mode 100644 index 1590022..0000000 --- a/configs/MrRobotBadge_Dickbutt_Addon/A_config.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include "SSD1306Wire.h" -// =========================== // - -#define DEFAULT_SSID "Dickbutt " + bytesToStr(&(settings.getMacAP()[3]), 3) - -// ===================== LED CONFIG ==================== // -#define DIGITAL_LED - -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 255 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY false // default display setting - -#define BUTTON_UP 14 -#define BUTTON_DOWN 12 -#define BUTTON_A 13 - - -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -// ========================================================= // - -#endif diff --git a/configs/MrRobotBadge_Dickbutt_Addon/README.md b/configs/MrRobotBadge_Dickbutt_Addon/README.md deleted file mode 100644 index 7dc0ce1..0000000 --- a/configs/MrRobotBadge_Dickbutt_Addon/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# MrRobotBadge Dickbutt Shitty Addon - --> https://twitter.com/MrRobotBadge - -Has a default SSID "Dickbutt 00:11:22" (00:11:22 = last 3 bytes of the MAC address) - -| | | -| - | - | -| LED Type | Digital | -| LED R | disabled | -| LED G | disabled | -| LED B | 2 | -| Highlight LED | disabled | -| Display and buttons enabled | NO | -| Display Driver | SSD1306 | -| Display SDA | GPIO 5 (D1) | -| Display SCL | GPIO 4 (D2) | -| Flip Display | NO | -| Button Up |GPIO 14 (D5) | -| Button Down | GPIO 12 (D6) | -| Button A | GPIO 13 (D7) | -| Button B |disabled | diff --git a/configs/README.md b/configs/README.md deleted file mode 100644 index bdedeca..0000000 --- a/configs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Config Files - -Here you find a bunch of modified config files for different boards. -The default config should be fine for all boards that don't have a display or a RGB LED (like the NodeMCU). - -Copy the `A_config.h` file and paste it in the Arduino sektch and replace the default config file. - -- [Default Config (NodeMCU, Wemos d1 mini, ...)](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/Default/A_config.h) - -- DSTIKE Deauther (without OLED) - - [DSTIKE Deauther v1, v2, v3](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/Default/A_config.h) - - [DSTIKE Deauther v3.5](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/A_config.h) -- DSTIKE Deauther OLED - - [DSTIKE Deauther OLED v1, v1.5](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_OLED_v1_v1.5/A_config.h) - - [DSTIKE Deauther OLED v1.5S (with RGB)](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_OLED_v1.5S/A_config.h) - - [DSTIKE Deauther OLED v2, v2.5, v3](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_OLED_v2_v2.5_v3/A_config.h) - - [DSTIKE Deauther OLED v3.5, v4](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_OLED_v3.5_v4_Monster/A_config.h) - - [DSTIKE Deauther OLED Mini](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_Wristband_Mini/A_config.h) -- [DSTIKE Deauther Wristband](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_Wristband_Mini/A_config.h) -- [DSTIKE Deauther Monster](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_OLED_v3.5_v4_Monster/A_config.h) -- [DSTIKE Deauther Boy](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_Deauther_Boy/A_config.h) -- [DSTIKE NodeMCU-07 v1](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/Default/A_config.h) -- [DSTIKE NodeMCU-07 v2](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_Deauther_v3.5_and_NodeMCU-07_v2/A_config.h) -- [DSTIKE USB Deauther v1](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/Default/A_config.h) -- [DSTIKE USB Deauther v2 (with RGB)](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_USB_Deauther_v2/A_config.h) -- [DSTIKE D-duino with LED Ring Shield](https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/DSTIKE_D-duino_with_LED_Ring_Shield/A_config.h) diff --git a/esp8266_deauther/A_config.h b/esp8266_deauther/A_config.h index e86da7a..b89b7d7 100644 --- a/esp8266_deauther/A_config.h +++ b/esp8266_deauther/A_config.h @@ -1,83 +1,331 @@ -#ifndef config_h -#define config_h - -// ===== DISPLAY LIBRARY ===== // -#include -#include -#include "SH1106Wire.h" -#include "SSD1306Wire.h" -#include "SH1106Spi.h" -#include "SSD1306Spi.h" -// =========================== // - -//#define DEFAULT_SSID "pwned" -//#define HIGHLIGHT_LED 16 - -// ===================== LED CONFIG ==================== // -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of LED you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -#define DIGITAL_LED -//#define RGB_LED -//#define NEOPIXEL_LED - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust following settings for your type of LED - you can ignore the rest of the #define's - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ - -// === Settings for Digital LED and RGB LED === // -#define LED_ANODE false // common vcc (+) -#define LED_PIN_R 16 // NodeMCU on-board LED -#define LED_PIN_G 255 // 255 = LED disabled -#define LED_PIN_B 2 // ESP-12 LED - -// === Settings for RGB LED and Neopixel LED === // -#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes - -// === Settings for Neopixel LED === // -#define LED_NEOPIXEL_NUM 1 -#define LED_NEOPIXEL_PIN 15 -#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800 -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// ===================== DISPLAY CONFIG ==================== // -#define USE_DISPLAY false // default display setting - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Adjust the pins to match your setup - Comment out the buttons you don't use. - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ -#define BUTTON_UP 14 -#define BUTTON_DOWN 12 -#define BUTTON_A 13 - -//#define BUTTON_LEFT 12 -//#define BUTTON_RIGHT 13 -//#define BUTTON_B 10 - -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - Uncomment the type of display you're using - Only one of them can be defined at a time! - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -*/ -#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED -//#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED - -/* RST = GPIO 5 (D1) - DC = GPIO 4 (D2) - CS = GPIO 15 (D8) or GND - SCK/SCL = GPIO 14 (D5) - SDA/MOSI = GPIO 13 (D7) */ -//#define DEAUTHER_DISPLAY SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI -//#define DEAUTHER_DISPLAY SH1106Spi display = SH1106Spi(5, 4, 15); // for 1.3" OLED with SPI - -//#define FLIP_DIPLAY // uncomment that to flip the display vertically -// ========================================================= // - -#endif +#ifndef config_h +#define config_h + +/* !!! Uncomment the board taht you're using !!! */ + +// #define NODEMCU +// #define WEMOS_D1_MINI +// #define USB_DEAUTHER +// #define DEAUTHER +// #define DEAUTHER_V1 +// #define DEAUTHER_V2 +// #define DEAUTHER_V3 +// #define D_DUINO_B_V5_LED_RING +// #define DEAUTHER_BOY +// #define DEAUTHER_V3_5 +// #define NODEMCU_07 +// #define NODEMCU_07_V2 +// #define DEAUTHER_OLED_V1_5_S +// #define DEAUTHER_OLED +// #define DEAUTHER_OLED_V1_5 +// #define DEAUTHER_OLED_V2 +// #define DEAUTHER_OLED_V2_5 +// #define DEAUTHER_OLED_V3 +// #define DEAUTHER_OLED_V3_5 +// #define DEAUTHER_OLED_V4 +// #define DEAUTHER_MOSTER +// #define USB_DEAUTHER +// #define USB_DEAUTHER_V2 +// #define DEAUTHER_WRISTBAND +// #define DEAUTHER_WRISTBAND_V2 +// #define DEAUTHER_MINI + +#define DEFAULT_ESP8266 + +// ========== CONFIGS ========== // +#if defined(DEFAULT_ESP8266) || defined(NODEMCU) || defined(WEMOS_D1_MINI) || defined(USB_DEAUTHER) || defined(NODEMCU_07) || defined(DEAUTHER) || defined(DEAUTHER_V1) || defined(DEAUTHER_V2) || defined(DEAUTHER_V3) +// ===== LED ===== // + #define LED_DIGITAL + #define LED_PIN_R 16 // NodeMCU on-board LED + #define LED_PIN_B 2 // ESP-12 LED + +#elif defined(D_DUINO_B_V5_LED_RING) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 12 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DEAUTHER_BOY) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 10 + #define BUTTON_DOWN 9 + #define BUTTON_A 14 + #define BUTTON_B 12 + +#elif defined(DEAUTHER_V3_5) || defined(NODEMCU_07_V2) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +#elif defined(DEAUTHER_OLED_V1_5_S) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DEAUTHER_OLED) || defined(DEAUTHER_OLED_V1_5) + +// ===== LED ===== // + #define LED_DIGITAL + + #define LED_PIN_R 16 + #define LED_PIN_B 2 + +// ===== DISPLAY ===== // + #define SSD1306_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DEAUTHER_OLED_V2) || defined(DEAUTHER_OLED_V2_5) || defined(DEAUTHER_OLED_V3) + +// ===== LED ===== // + #define LED_DIGITAL + + #define LED_PIN_R 16 + #define LED_PIN_B 2 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DEAUTHER_OLED_V3_5) || defined(DEAUTHER_OLED_V4) || defined(DEAUTHER_MOSTER) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(USB_DEAUTHER_V2) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 4 + +#elif defined(DEAUTHER_WRISTBAND) || defined(DEAUTHER_WRISTBAND_V2) || defined(DEAUTHER_MINI) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 15 + + #define HIGHLIGHT_LED 16 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 +#endif /* if defined(DEFAULT_ESP8266) || defined(NODEMCU) || defined(WEMOS_D1_MINI) || defined(USB_DEAUTHER) || defined(NODEMCU_07) || defined(DEAUTHER) || defined(DEAUTHER_V1) || defined(DEAUTHER_V2) || defined(DEAUTHER_V3) */ +// ============================== // + + +// ========= FALLBACK ========= // + +#ifndef DEFAULT_SSID + #define DEFAULT_SSID "pwned" +#endif /* ifndef DEFAULT_SSID */ + +// ===== LED ===== // +#ifndef LED_PIN_R + #define LED_PIN_R 255 +#endif /* ifndef LED_PIN_R */ + +#ifndef LED_PIN_G + #define LED_PIN_G 255 +#endif /* ifndef LED_PIN_G */ + +#ifndef LED_PIN_B + #define LED_PIN_B 255 +#endif /* ifndef LED_PIN_B */ + +#ifndef LED_ANODE + #define LED_ANODE false +#endif /* ifndef LED_ANODE */ + +#ifndef LED_MODE_BRIGHTNESS + #define LED_MODE_BRIGHTNESS 10 +#endif /* ifndef LED_MODE_BRIGHTNESS */ + +#if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) + #define NEOPIXEL_LED +#endif /* if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) */ + +// ===== DISPLAY ===== // +#ifndef DISPLAY_TEXT + #define DISPLAY_TEXT "" +#endif /* ifndef DISPLAY_TEXT */ + +#ifndef FLIP_DIPLAY + #define FLIP_DIPLAY false +#endif /* ifndef USE_DISPLAY */ + +#if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) + #define SSD1306_I2C + #define USE_DISPLAY false +#else /* if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) */ + #define USE_DISPLAY true +#endif /* if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) */ + +#ifndef I2C_ADDR + #define I2C_ADDR 0x3C +#endif /* ifndef I2C_ADDR */ + +#ifndef I2C_SDA + #define I2C_SDA 5 +#endif /* ifndef I2C_SDA */ + +#ifndef I2C_SCL + #define I2C_SCL 4 +#endif /* ifndef I2C_SCL */ + +#ifndef SPI_RES + #define SPI_RES 5 +#endif /* ifndef SPI_RES */ + +#ifndef SPI_DC + #define SPI_DC 4 +#endif /* ifndef SPI_DC */ + +#ifndef SPI_CS + #define SPI_CS 15 +#endif /* ifndef SPI_CS */ + +// ===== BUTTONS ===== // +#ifndef BUTTON_UP + #define BUTTON_UP 255 +#endif // ifndef BUTTON_UP + +#ifndef BUTTON_DOWN + #define BUTTON_DOWN 255 +#endif // ifndef BUTTON_DOWN + +#ifndef BUTTON_A + #define BUTTON_A 255 +#endif // ifndef BUTTON_A + +#ifndef BUTTON_B + #define BUTTON_B 255 +#endif // ifndef BUTTON_B + +// ======== AVAILABLE SETTINGS ========== // + +/* + #define DEFAULT_SSID "something" + + // ===== LED ===== // + #define LED_DIGITAL + #define LED_RGB + #define LED_NEOPIXEL + #define MY92 + + #define LED_ANODE false + + #define LED_PIN_R 16 + #define LED_PIN_G 255 + #define LED_PIN_B 2 + + #define LED_NEOPIXEL_RGB + #define LED_NEOPIXEL_GRB + + #define LED_NEOPIXEL_NUM 1 + #define LED_NEOPIXEL_PIN 255 + + #define LED_MODE_BRIGHTNESS 100 + + #define MY92_NUM 1 + #define MY92_DATA 4 + #define MY92_CLOCK 5 + #define MY92_CH_R 0 + #define MY92_CH_G 1 + #define MY92_CH_B 2 + #define MY92_CH_BRIGHTNESS 3 + #define MY92_MODEL MY92XX_MODEL_MY9291 + #define MY92_MODEL MY92XX_MODEL_MY9231 + + // ===== DISPLAY ===== // + #define USE_DISPLAY false + #define FLIP_DIPLAY false + + #define SSD1306_I2C + #define SSD1306_SPI + #define SH1106_I2C + #define SH1106_SPI + + #define I2C_ADDR 0x3C + #define I2C_SDA 5 + #define I2C_SCL 4 + + #define SPI_RES 5 + #define SPI_DC 4 + #define SPI_CS 15 + + // ===== BUTTONS ===== // + #define BUTTON_UP 255 + #define BUTTON_DOWN 255 + #define BUTTON_A 255 + #define BUTTON_B 255 + + */ + +#endif /* ifndef config_h */ \ No newline at end of file diff --git a/esp8266_deauther/DisplayUI.cpp b/esp8266_deauther/DisplayUI.cpp index ad64339..6ed4889 100644 --- a/esp8266_deauther/DisplayUI.cpp +++ b/esp8266_deauther/DisplayUI.cpp @@ -1,893 +1,892 @@ -#include "DisplayUI.h" - -// ===== adjustable ===== // -void DisplayUI::configInit() { - // initialize display - display.init(); - - /* - In case of a compiler (conversion char/uint8_t) error, - make sure to have version 4 of the display library installed - https://github.com/ThingPulse/esp8266-oled-ssd1306/releases/tag/4.0.0 - */ - display.setFont(DejaVu_Sans_Mono_12); - - display.setContrast(255); - -#ifndef FLIP_DIPLAY - display.flipScreenVertically(); -#endif // ifndef FLIP_DIPLAY - - display.clear(); - display.display(); -} - -void DisplayUI::configOn() { - display.displayOn(); -} - -void DisplayUI::configOff() { - display.displayOff(); -} - -void DisplayUI::updatePrefix() { - display.clear(); -} - -void DisplayUI::updateSuffix() { - display.display(); -} - -void DisplayUI::drawString(int x, int y, String str) { - display.drawString(x, y, replaceUtf8(str, String(QUESTIONMARK))); -} - -void DisplayUI::drawString(int row, String str) { - drawString(0, row * lineHeight, str); -} - -void DisplayUI::drawLine(int x1, int y1, int x2, int y2) { - display.drawLine(x1, y1, x2, y2); -} - -// ====================== // - - -DisplayUI::DisplayUI() {} - -DisplayUI::~DisplayUI() {} - - -void DisplayUI::setup() { - configInit(); - setupButtons(); - buttonTime = currentTime; - - clockHour = random(12); - clockMinute = random(60); - - // ===== MENUS ===== // - - // MAIN MENU - createMenu(&mainMenu, NULL, [this]() { - addMenuNode(&mainMenu, D_SCAN, &scanMenu); /// SCAN - addMenuNode(&mainMenu, D_SHOW, &showMenu); // SHOW - addMenuNode(&mainMenu, D_ATTACK, &attackMenu); // ATTACK - addMenuNode(&mainMenu, D_PACKET_MONITOR, [this]() { // PACKET MONITOR - scan.start(SCAN_MODE_SNIFFER, 0, SCAN_MODE_OFF, 0, false, wifi_channel); - mode = DISPLAY_MODE::PACKETMONITOR; - }); - - addMenuNode(&mainMenu, D_CLOCK, [this]() { // PACKET MONITOR - mode = DISPLAY_MODE::CLOCK; - display.setFont(ArialMT_Plain_24); - display.setTextAlignment(TEXT_ALIGN_CENTER); - }); - -#ifdef HIGHLIGHT_LED - addMenuNode(&mainMenu, D_LED, [this]() { // LED - highlightLED = !highlightLED; - digitalWrite(HIGHLIGHT_LED, highlightLED); - }); -#endif // ifdef HIGHLIGHT_LED - }); - - // SCAN MENU - createMenu(&scanMenu, &mainMenu, [this]() { - addMenuNode(&scanMenu, D_SCAN_APST, [this]() { // SCAN AP + ST - scan.start(SCAN_MODE_ALL, 15000, SCAN_MODE_OFF, 0, true, wifi_channel); - mode = DISPLAY_MODE::LOADSCAN; - }); - addMenuNode(&scanMenu, D_SCAN_AP, [this]() { // SCAN AP - scan.start(SCAN_MODE_APS, 0, SCAN_MODE_OFF, 0, true, wifi_channel); - mode = DISPLAY_MODE::LOADSCAN; - }); - addMenuNode(&scanMenu, D_SCAN_ST, [this]() { // SCAN ST - scan.start(SCAN_MODE_STATIONS, 30000, SCAN_MODE_OFF, 0, true, wifi_channel); - mode = DISPLAY_MODE::LOADSCAN; - }); - }); - - // SHOW MENU - createMenu(&showMenu, &mainMenu, [this]() { - addMenuNode(&showMenu, [this]() { // Accesspoints 0 [0] - return leftRight(str(D_ACCESSPOINTS), (String)accesspoints.count(), maxLen - 1); - }, &apListMenu); - addMenuNode(&showMenu, [this]() { // Stations 0 [0] - return leftRight(str(D_STATIONS), (String)stations.count(), maxLen - 1); - }, &stationListMenu); - addMenuNode(&showMenu, [this]() { // Names 0 [0] - return leftRight(str(D_NAMES), (String)names.count(), maxLen - 1); - }, &nameListMenu); - addMenuNode(&showMenu, [this]() { // SSIDs 0 - return leftRight(str(D_SSIDS), (String)ssids.count(), maxLen - 1); - }, &ssidListMenu); - }); - - // AP LIST MENU - createMenu(&apListMenu, &showMenu, [this]() { - // add APs to list - int c = accesspoints.count(); - - for (int i = 0; i < c; i++) { - addMenuNode(&apListMenu, [i]() { - return b2a(accesspoints.getSelected(i)) + accesspoints.getSSID(i); - }, [this, i]() { - accesspoints.getSelected(i) ? accesspoints.deselect(i) : accesspoints.select(i); - }, [this, i]() { - selectedID = i; - changeMenu(&apMenu); - }); - } - addMenuNode(&apListMenu, D_SELECT_ALL, [this]() { // SELECT ALL - accesspoints.selectAll(); - changeMenu(&apListMenu); - }); - addMenuNode(&apListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL - accesspoints.deselectAll(); - changeMenu(&apListMenu); - }); - addMenuNode(&apListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL - accesspoints.removeAll(); - goBack(); - }); - }); - - // STATION LIST MENU - createMenu(&stationListMenu, &showMenu, [this]() { - // add stations to list - int c = stations.count(); - - for (int i = 0; i < c; i++) { - addMenuNode(&stationListMenu, [i]() { - return b2a(stations.getSelected(i)) + - (stations.hasName(i) ? stations.getNameStr(i) : stations.getMacVendorStr(i)); - }, [this, i]() { - stations.getSelected(i) ? stations.deselect(i) : stations.select(i); - }, [this, i]() { - selectedID = i; - changeMenu(&stationMenu); - }); - } - - addMenuNode(&stationListMenu, D_SELECT_ALL, [this]() { // SELECT ALL - stations.selectAll(); - changeMenu(&stationListMenu); - }); - addMenuNode(&stationListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL - stations.deselectAll(); - changeMenu(&stationListMenu); - }); - addMenuNode(&stationListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL - stations.removeAll(); - goBack(); - }); - }); - - // NAME LIST MENU - createMenu(&nameListMenu, &showMenu, [this]() { - // add device names to list - int c = names.count(); - - for (int i = 0; i < c; i++) { - addMenuNode(&nameListMenu, [i]() { - return names.getSelectedStr(i) + names.getName(i); - }, [this, i]() { - names.getSelected(i) ? names.deselect(i) : names.select(i); - }, [this, i]() { - selectedID = i; - changeMenu(&nameMenu); - }); - } - addMenuNode(&nameListMenu, D_SELECT_ALL, [this]() { // SELECT ALL - names.selectAll(); - changeMenu(&nameListMenu); - }); - addMenuNode(&nameListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL - names.deselectAll(); - changeMenu(&nameListMenu); - }); - addMenuNode(&nameListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL - names.removeAll(); - goBack(); - }); - }); - - // SSID LIST MENU - createMenu(&ssidListMenu, &showMenu, [this]() { - addMenuNode(&ssidListMenu, D_CLONE_APS, [this]() { // CLONE APs - ssids.cloneSelected(true); - changeMenu(&ssidListMenu); - ssids.save(false); - }); - addMenuNode(&ssidListMenu, [this]() { - return b2a(ssids.getRandom()) + str(D_RANDOM_MODE); // *RANDOM MODE - }, [this]() { - if (ssids.getRandom()) ssids.disableRandom(); - else ssids.enableRandom(10); - changeMenu(&ssidListMenu); - }); - - // add ssids to list - int c = ssids.count(); - - for (int i = 0; i < c; i++) { - addMenuNode(&ssidListMenu, [i]() { - return ssids.getName(i).substring(0, ssids.getLen(i)); - }, [this, i]() { - selectedID = i; - changeMenu(&ssidMenu); - }, [this, i]() { - ssids.remove(i); - changeMenu(&ssidListMenu); - ssidListMenu.selected = i; - }); - } - - addMenuNode(&ssidListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL - ssids.removeAll(); - goBack(); - }); - }); - - // AP MENU - createMenu(&apMenu, &apListMenu, [this]() { - addMenuNode(&apMenu, [this]() { - return accesspoints.getSelectedStr(selectedID) + accesspoints.getSSID(selectedID); // * - }, [this]() { - accesspoints.getSelected(selectedID) ? accesspoints.deselect(selectedID) : accesspoints.select(selectedID); - }); - addMenuNode(&apMenu, [this]() { - return str(D_ENCRYPTION) + accesspoints.getEncStr(selectedID); - }, NULL); // Encryption: -/WPA2 - addMenuNode(&apMenu, [this]() { - return str(D_RSSI) + (String)accesspoints.getRSSI(selectedID); - }, NULL); // RSSI: -90 - addMenuNode(&apMenu, [this]() { - return str(D_CHANNEL) + (String)accesspoints.getCh(selectedID); - }, NULL); // Channel: 11 - addMenuNode(&apMenu, [this]() { - return accesspoints.getMacStr(selectedID); - }, NULL); // 00:11:22:00:11:22 - addMenuNode(&apMenu, [this]() { - return str(D_VENDOR) + accesspoints.getVendorStr(selectedID); - }, NULL); // Vendor: INTEL - addMenuNode(&apMenu, [this]() { - return accesspoints.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT - }, [this]() { - accesspoints.getSelected(selectedID) ? accesspoints.deselect(selectedID) : accesspoints.select(selectedID); - }); - addMenuNode(&apMenu, D_CLONE, [this]() { // CLONE - ssids.add(accesspoints.getSSID(selectedID), accesspoints.getEnc(selectedID) != ENC_TYPE_NONE, 60, true); - changeMenu(&showMenu); - ssids.save(false); - }); - addMenuNode(&apMenu, D_REMOVE, [this]() { // REMOVE - accesspoints.remove(selectedID); - apListMenu.list->remove(apListMenu.selected); - goBack(); - }); - }); - - // STATION MENU - createMenu(&stationMenu, &stationListMenu, [this]() { - addMenuNode(&stationMenu, [this]() { - return stations.getSelectedStr(selectedID) + - (stations.hasName(selectedID) ? stations.getNameStr(selectedID) : stations.getMacVendorStr(selectedID)); // - }, [this]() { - stations.getSelected(selectedID) ? stations.deselect(selectedID) : stations.select(selectedID); - }); - addMenuNode(&stationMenu, [this]() { - return stations.getMacStr(selectedID); - }, NULL); // 00:11:22:00:11:22 - addMenuNode(&stationMenu, [this]() { - return str(D_VENDOR) + stations.getVendorStr(selectedID); - }, NULL); // Vendor: INTEL - addMenuNode(&stationMenu, [this]() { - return str(D_AP) + stations.getAPStr(selectedID); // AP: someAP - }, [this]() { - int apID = accesspoints.find(stations.getAP(selectedID)); - - if (apID >= 0) { - selectedID = apID; - changeMenu(&apMenu); - } - }); - addMenuNode(&stationMenu, [this]() { - return str(D_PKTS) + String(*stations.getPkts(selectedID)); - }, NULL); // Pkts: 12 - addMenuNode(&stationMenu, [this]() { - return str(D_CHANNEL) + String(stations.getCh(selectedID)); - }, NULL); // Channel: 11 - addMenuNode(&stationMenu, [this]() { - return str(D_SEEN) + stations.getTimeStr(selectedID); - }, NULL); // Seen: <1min - - addMenuNode(&stationMenu, [this]() { - return stations.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT - }, [this]() { - stations.getSelected(selectedID) ? stations.deselect(selectedID) : stations.select(selectedID); - }); - addMenuNode(&stationMenu, D_REMOVE, [this]() { // REMOVE - stations.remove(selectedID); - stationListMenu.list->remove(stationListMenu.selected); - goBack(); - }); - }); - - // NAME MENU - createMenu(&nameMenu, &nameListMenu, [this]() { - addMenuNode(&nameMenu, [this]() { - return names.getSelectedStr(selectedID) + names.getName(selectedID); // - }, [this]() { - names.getSelected(selectedID) ? names.deselect(selectedID) : names.select(selectedID); - }); - addMenuNode(&nameMenu, [this]() { - return names.getMacStr(selectedID); - }, NULL); // 00:11:22:00:11:22 - addMenuNode(&nameMenu, [this]() { - return str(D_VENDOR) + names.getVendorStr(selectedID); - }, NULL); // Vendor: INTEL - addMenuNode(&nameMenu, [this]() { - return str(D_AP) + names.getBssidStr(selectedID); - }, NULL); // AP: 00:11:22:00:11:22 - addMenuNode(&nameMenu, [this]() { - return str(D_CHANNEL) + (String)names.getCh(selectedID); - }, NULL); // Channel: 11 - - addMenuNode(&nameMenu, [this]() { - return names.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT - }, [this]() { - names.getSelected(selectedID) ? names.deselect(selectedID) : names.select(selectedID); - }); - addMenuNode(&nameMenu, D_REMOVE, [this]() { // REMOVE - names.remove(selectedID); - nameListMenu.list->remove(nameListMenu.selected); - goBack(); - }); - }); - - // SSID MENU - createMenu(&ssidMenu, &ssidListMenu, [this]() { - addMenuNode(&ssidMenu, [this]() { - return ssids.getName(selectedID).substring(0, ssids.getLen(selectedID)); - }, NULL); // SSID - addMenuNode(&ssidMenu, [this]() { - return str(D_ENCRYPTION) + ssids.getEncStr(selectedID); // WPA2 - }, [this]() { - ssids.setWPA2(selectedID, !ssids.getWPA2(selectedID)); - }); - addMenuNode(&ssidMenu, D_REMOVE, [this]() { // REMOVE - ssids.remove(selectedID); - ssidListMenu.list->remove(ssidListMenu.selected); - goBack(); - }); - }); - - // ATTACK MENU - createMenu(&attackMenu, &mainMenu, [this]() { - addMenuNode(&attackMenu, [this]() { // *DEAUTH 0/0 - if (attack.isRunning()) return leftRight(b2a(deauthSelected) + str(D_DEAUTH), - (String)attack.getDeauthPkts() + SLASH + - (String)attack.getDeauthMaxPkts(), maxLen - 1); - else return leftRight(b2a(deauthSelected) + str(D_DEAUTH), (String)scan.countSelected(), maxLen - 1); - }, [this]() { // deauth - deauthSelected = !deauthSelected; - - if (attack.isRunning()) { - attack.start(beaconSelected, deauthSelected, false, probeSelected, true, - settings.getAttackTimeout() * 1000); - } - }); - addMenuNode(&attackMenu, [this]() { // *BEACON 0/0 - if (attack.isRunning()) return leftRight(b2a(beaconSelected) + str(D_BEACON), - (String)attack.getBeaconPkts() + SLASH + - (String)attack.getBeaconMaxPkts(), maxLen - 1); - else return leftRight(b2a(beaconSelected) + str(D_BEACON), (String)ssids.count(), maxLen - 1); - }, [this]() { // beacon - beaconSelected = !beaconSelected; - - if (attack.isRunning()) { - attack.start(beaconSelected, deauthSelected, false, probeSelected, true, - settings.getAttackTimeout() * 1000); - } - }); - addMenuNode(&attackMenu, [this]() { // *PROBE 0/0 - if (attack.isRunning()) return leftRight(b2a(probeSelected) + str(D_PROBE), - (String)attack.getProbePkts() + SLASH + - (String)attack.getProbeMaxPkts(), maxLen - 1); - else return leftRight(b2a(probeSelected) + str(D_PROBE), (String)ssids.count(), maxLen - 1); - }, [this]() { // probe - probeSelected = !probeSelected; - - if (attack.isRunning()) { - attack.start(beaconSelected, deauthSelected, false, probeSelected, true, - settings.getAttackTimeout() * 1000); - } - }); - addMenuNode(&attackMenu, [this]() { // START - return leftRight(str(attack.isRunning() ? D_STOP_ATTACK : D_START_ATTACK), - attack.getPacketRate() > 0 ? (String)attack.getPacketRate() : String(), maxLen - 1); - }, [this]() { - if (attack.isRunning()) attack.stop(); - else attack.start(beaconSelected, deauthSelected, false, probeSelected, true, - settings.getAttackTimeout() * 1000); - }); - }); - - // ===================== // - - // set current menu to main menu - changeMenu(&mainMenu); - enabled = true; - startTime = currentTime; -} - -#ifdef HIGHLIGHT_LED -void DisplayUI::setupLED() { - pinMode(HIGHLIGHT_LED, OUTPUT); - digitalWrite(HIGHLIGHT_LED, HIGH); - highlightLED = true; -} - -#endif // ifdef HIGHLIGHT_LED - -void DisplayUI::update() { - if (!enabled) return; - - up->update(); - down->update(); - a->update(); - b->update(); - - draw(); - - uint32_t timeout = settings.getDisplayTimeout() * 1000; - - if (currentTime > timeout) { - if (!tempOff) { - if (buttonTime < currentTime - timeout) off(); - } else { - if (buttonTime > currentTime - timeout) on(); - } - } -} - -void DisplayUI::on() { - if (enabled) { - configOn(); - tempOff = false; - buttonTime = currentTime; // update a button time to keep display on - prntln(D_MSG_DISPLAY_ON); - } else { - prntln(D_ERROR_NOT_ENABLED); - } -} - -void DisplayUI::off() { - if (enabled) { - configOff(); - tempOff = true; - prntln(D_MSG_DISPLAY_OFF); - } else { - prntln(D_ERROR_NOT_ENABLED); - } -} - -void DisplayUI::setupButtons() { - up = new ButtonPullup(BUTTON_UP); - down = new ButtonPullup(BUTTON_DOWN); - a = new ButtonPullup(BUTTON_A); - b = new ButtonPullup(BUTTON_B); - - // === BUTTON UP === // - up->setOnClicked([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - - if (!tempOff) { - if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor - if (currentMenu->selected > 0) currentMenu->selected--; - else currentMenu->selected = currentMenu->list->size() - 1; - } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel - scan.setChannel(wifi_channel + 1); - } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel - setTime(clockHour, clockMinute + 1, clockSecond); - } - } - }); - - up->setOnHolding([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor - if (currentMenu->selected > 0) currentMenu->selected--; - else currentMenu->selected = currentMenu->list->size() - 1; - } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel - scan.setChannel(wifi_channel + 1); - } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel - setTime(clockHour, clockMinute + 10, clockSecond); - } - } - }, buttonDelay); - - // === BUTTON DOWN === // - down->setOnClicked([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor - if (currentMenu->selected < currentMenu->list->size() - 1) currentMenu->selected++; - else currentMenu->selected = 0; - } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel - scan.setChannel(wifi_channel - 1); - } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel - setTime(clockHour, clockMinute - 1, clockSecond); - } - } - }); - - down->setOnHolding([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor - if (currentMenu->selected < currentMenu->list->size() - 1) currentMenu->selected++; - else currentMenu->selected = 0; - } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel - scan.setChannel(wifi_channel - 1); - } - - else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel - setTime(clockHour, clockMinute - 10, clockSecond); - } - } - }, buttonDelay); - - // === BUTTON A === // - a->setOnClicked([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - switch (mode) { - case DISPLAY_MODE::MENU: - - if (currentMenu->list->get(currentMenu->selected).click) { - currentMenu->list->get(currentMenu->selected).click(); - } - break; - - case DISPLAY_MODE::PACKETMONITOR: - case DISPLAY_MODE::LOADSCAN: - scan.stop(); - mode = DISPLAY_MODE::MENU; - break; - - case DISPLAY_MODE::CLOCK: - mode = DISPLAY_MODE::MENU; - display.setFont(DejaVu_Sans_Mono_12); - display.setTextAlignment(TEXT_ALIGN_LEFT); - break; - } - } - }); - - a->setOnHolding([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - if (mode == DISPLAY_MODE::MENU) { - if (currentMenu->list->get(currentMenu->selected).hold) { - currentMenu->list->get(currentMenu->selected).hold(); - } - } - } - }, 800); - - // === BUTTON B === // - b->setOnClicked([this]() { - scrollCounter = 0; - scrollTime = currentTime; - buttonTime = currentTime; - if (!tempOff) { - switch (mode) { - case DISPLAY_MODE::MENU: - goBack(); - break; - - case DISPLAY_MODE::PACKETMONITOR: - case DISPLAY_MODE::LOADSCAN: - scan.stop(); - mode = DISPLAY_MODE::MENU; - break; - - case DISPLAY_MODE::CLOCK: - mode = DISPLAY_MODE::MENU; - display.setFont(DejaVu_Sans_Mono_12); - display.setTextAlignment(TEXT_ALIGN_LEFT); - break; - } - } - }); -} - -String DisplayUI::getChannel() { - String ch = String(wifi_channel); - - if (ch.length() < 2) ch = ' ' + ch; - return ch; -} - -void DisplayUI::draw() { - if ((currentTime - drawTime > drawInterval) && currentMenu) { - drawTime = currentTime; - - updatePrefix(); - - if (clockTime < currentTime - 1000) { - setTime(clockHour, clockMinute++, clockSecond + 1); - clockTime += 1000; - } - - switch (mode) { - case DISPLAY_MODE::BUTTON_TEST: - drawButtonTest(); - break; - - case DISPLAY_MODE::MENU: - drawMenu(); - break; - - case DISPLAY_MODE::LOADSCAN: - drawLoadingScan(); - break; - - case DISPLAY_MODE::PACKETMONITOR: - drawPacketMonitor(); - break; - - case DISPLAY_MODE::INTRO: - if (currentTime - startTime >= screenIntroTime) { - mode = DISPLAY_MODE::MENU; - } - drawIntro(); - break; - case DISPLAY_MODE::CLOCK: - drawClock(); - break; - } - - updateSuffix(); - } -} - -void DisplayUI::drawButtonTest() { - drawString(0, str(D_UP) + b2s(up->read())); - drawString(1, str(D_DOWN) + b2s(down->read())); - drawString(2, str(D_A) + b2s(a->read())); - drawString(3, str(D_B) + b2s(b->read())); -} - -void DisplayUI::drawMenu() { - String tmp; - int tmpLen; - int row = (currentMenu->selected / 5) * 5; - - // correct selected if it's off - if (currentMenu->selected < 0) currentMenu->selected = 0; - else if (currentMenu->selected >= currentMenu->list->size()) currentMenu->selected = currentMenu->list->size() - 1; - - // draw menu entries - for (int i = row; i < currentMenu->list->size() && i < row + 5; i++) { - tmp = currentMenu->list->get(i).getStr(); - tmpLen = tmp.length(); - - // horizontal scrolling - if ((currentMenu->selected == i) && (tmpLen >= maxLen)) { - tmp = tmp + tmp; - tmp = tmp.substring(scrollCounter, scrollCounter + maxLen - 1); - - if ((scrollCounter > 0 && scrollTime < currentTime - scrollSpeed) || (scrollCounter == 0 && scrollTime < currentTime - scrollSpeed * 4)){ - scrollTime = currentTime; - scrollCounter++; - } - - if (scrollCounter > tmpLen) scrollCounter = 0; - } - - tmp = (currentMenu->selected == i ? CURSOR : SPACE) + tmp; - drawString(0, (i - row) * 12, tmp); - } -} - -void DisplayUI::drawLoadingScan() { - String percentage; - - if (scan.isScanning()) { - percentage = String(scan.getPercentage()) + '%'; - } else { - percentage = str(DSP_SCAN_DONE); - } - - drawString(0, leftRight(str(DSP_SCAN_FOR), scan.getMode(), maxLen)); - drawString(1, leftRight(str(DSP_APS), String(accesspoints.count()), maxLen)); - drawString(2, leftRight(str(DSP_STS), String(stations.count()), maxLen)); - drawString(3, leftRight(str(DSP_PKTS), String(scan.getPacketRate()) + str(DSP_S), maxLen)); - drawString(4, center(percentage, maxLen)); -} - -void DisplayUI::drawPacketMonitor() { - double scale = scan.getScaleFactor(sreenHeight - lineHeight - 2); - - String headline = leftRight(str(D_CH) + getChannel() + String(' ') + String('[') + String(scan.deauths) + String(']'), String(scan.getPacketRate()) + str(D_PKTS), maxLen); - - drawString(0, 0, headline); - - if (scan.getMaxPacket() > 0) { - int i = 0; - int x = 0; - int y = 0; - while(i < SCAN_PACKET_LIST_SIZE && x < screenWidth){ - y = (sreenHeight-1) - (scan.getPackets(i) * scale); - i++; - - //Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y); - drawLine(x, (sreenHeight-1), x, y); - x++; - - //Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y); - drawLine(x, (sreenHeight-1), x, y); - x++; - } - //Serial.println("---------"); - } -} - -void DisplayUI::drawIntro() { - drawString(0, center(str(D_INTRO_0), maxLen)); - drawString(1, center(str(D_INTRO_1), maxLen)); - drawString(2, center(str(D_INTRO_2), maxLen)); - drawString(3, center(str(D_INTRO_3), maxLen)); - drawString(4, center(settings.getVersion(), maxLen)); -} - -void DisplayUI::drawClock() { - String clockTime = String(clockHour); - - clockTime += ':'; - if (clockMinute < 10) clockTime += '0'; - clockTime += String(clockMinute); - - display.drawString(64, 20, clockTime); -} - -void DisplayUI::clearMenu(Menu* menu) { - while (menu->list->size() > 0) { - menu->list->remove(0); - } -} - -void DisplayUI::changeMenu(Menu* menu) { - if (menu) { - // only open list menu if it has nodes - if (((menu == &apListMenu) && (accesspoints.count() == 0)) || - ((menu == &stationListMenu) && (stations.count() == 0)) || - ((menu == &nameListMenu) && (names.count() == 0))) { - return; - } - - if (currentMenu) clearMenu(currentMenu); - currentMenu = menu; - currentMenu->selected = 0; - buttonTime = currentTime; - - if (selectedID < 0) selectedID = 0; - - if (currentMenu->parentMenu) { - addMenuNode(currentMenu, D_BACK, currentMenu->parentMenu); // add [BACK] - currentMenu->selected = 1; - } - - if (currentMenu->build) currentMenu->build(); - } -} - -void DisplayUI::goBack() { - if (currentMenu->parentMenu) changeMenu(currentMenu->parentMenu); -} - -void DisplayUI::createMenu(Menu* menu, Menu* parent, std::functionbuild) { - menu->list = new SimpleList; - menu->parentMenu = parent; - menu->selected = 0; - menu->build = build; -} - -void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, std::functionclick, - std::functionhold) { - menu->list->add(MenuNode{ getStr, click, hold }); -} - -void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, std::functionclick) { - addMenuNode(menu, getStr, click, NULL); -} - -void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, Menu* next) { - addMenuNode(menu, getStr, [this, next]() { - changeMenu(next); - }); -} - -void DisplayUI::addMenuNode(Menu* menu, const char* ptr, std::functionclick) { - addMenuNode(menu, [ptr]() { - return str(ptr); - }, click); -} - -void DisplayUI::addMenuNode(Menu* menu, const char* ptr, Menu* next) { - addMenuNode(menu, [ptr]() { - return str(ptr); - }, next); -} - -void DisplayUI::setTime(int h, int m, int s) { - if (s >= 60) { - s = 0; - m++; - } - - if (m >= 60) { - m = 0; - h++; - } - - if (h >= 24) { - h = 0; - } - - if (s < 0) { - s = 59; - m--; - } - - if (m < 0) { - m = 59; - h--; - } - - if (h < 0) { - h = 23; - } - - clockHour = h; - clockMinute = m; - clockSecond = s; -} +#include "DisplayUI.h" + +// ===== adjustable ===== // +void DisplayUI::configInit() { + // initialize display + display.init(); + + /* + In case of a compiler (conversion char/uint8_t) error, + make sure to have version 4 of the display library installed + https://github.com/ThingPulse/esp8266-oled-ssd1306/releases/tag/4.0.0 + */ + display.setFont(DejaVu_Sans_Mono_12); + + display.setContrast(255); + + if (FLIP_DIPLAY) display.flipScreenVertically(); + + display.clear(); + display.display(); +} + +void DisplayUI::configOn() { + display.displayOn(); +} + +void DisplayUI::configOff() { + display.displayOff(); +} + +void DisplayUI::updatePrefix() { + display.clear(); +} + +void DisplayUI::updateSuffix() { + display.display(); +} + +void DisplayUI::drawString(int x, int y, String str) { + display.drawString(x, y, replaceUtf8(str, String(QUESTIONMARK))); +} + +void DisplayUI::drawString(int row, String str) { + drawString(0, row * lineHeight, str); +} + +void DisplayUI::drawLine(int x1, int y1, int x2, int y2) { + display.drawLine(x1, y1, x2, y2); +} + +// ====================== // + + +DisplayUI::DisplayUI() {} + +DisplayUI::~DisplayUI() {} + + +void DisplayUI::setup() { + configInit(); + setupButtons(); + buttonTime = currentTime; + + clockHour = random(12); + clockMinute = random(60); + + // ===== MENUS ===== // + + // MAIN MENU + createMenu(&mainMenu, NULL, [this]() { + addMenuNode(&mainMenu, D_SCAN, &scanMenu); /// SCAN + addMenuNode(&mainMenu, D_SHOW, &showMenu); // SHOW + addMenuNode(&mainMenu, D_ATTACK, &attackMenu); // ATTACK + addMenuNode(&mainMenu, D_PACKET_MONITOR, [this]() { // PACKET MONITOR + scan.start(SCAN_MODE_SNIFFER, 0, SCAN_MODE_OFF, 0, false, wifi_channel); + mode = DISPLAY_MODE::PACKETMONITOR; + }); + + addMenuNode(&mainMenu, D_CLOCK, [this]() { // PACKET MONITOR + mode = DISPLAY_MODE::CLOCK; + display.setFont(ArialMT_Plain_24); + display.setTextAlignment(TEXT_ALIGN_CENTER); + }); + +#ifdef HIGHLIGHT_LED + addMenuNode(&mainMenu, D_LED, [this]() { // LED + highlightLED = !highlightLED; + digitalWrite(HIGHLIGHT_LED, highlightLED); + }); +#endif // ifdef HIGHLIGHT_LED + }); + + // SCAN MENU + createMenu(&scanMenu, &mainMenu, [this]() { + addMenuNode(&scanMenu, D_SCAN_APST, [this]() { // SCAN AP + ST + scan.start(SCAN_MODE_ALL, 15000, SCAN_MODE_OFF, 0, true, wifi_channel); + mode = DISPLAY_MODE::LOADSCAN; + }); + addMenuNode(&scanMenu, D_SCAN_AP, [this]() { // SCAN AP + scan.start(SCAN_MODE_APS, 0, SCAN_MODE_OFF, 0, true, wifi_channel); + mode = DISPLAY_MODE::LOADSCAN; + }); + addMenuNode(&scanMenu, D_SCAN_ST, [this]() { // SCAN ST + scan.start(SCAN_MODE_STATIONS, 30000, SCAN_MODE_OFF, 0, true, wifi_channel); + mode = DISPLAY_MODE::LOADSCAN; + }); + }); + + // SHOW MENU + createMenu(&showMenu, &mainMenu, [this]() { + addMenuNode(&showMenu, [this]() { // Accesspoints 0 [0] + return leftRight(str(D_ACCESSPOINTS), (String)accesspoints.count(), maxLen - 1); + }, &apListMenu); + addMenuNode(&showMenu, [this]() { // Stations 0 [0] + return leftRight(str(D_STATIONS), (String)stations.count(), maxLen - 1); + }, &stationListMenu); + addMenuNode(&showMenu, [this]() { // Names 0 [0] + return leftRight(str(D_NAMES), (String)names.count(), maxLen - 1); + }, &nameListMenu); + addMenuNode(&showMenu, [this]() { // SSIDs 0 + return leftRight(str(D_SSIDS), (String)ssids.count(), maxLen - 1); + }, &ssidListMenu); + }); + + // AP LIST MENU + createMenu(&apListMenu, &showMenu, [this]() { + // add APs to list + int c = accesspoints.count(); + + for (int i = 0; i < c; i++) { + addMenuNode(&apListMenu, [i]() { + return b2a(accesspoints.getSelected(i)) + accesspoints.getSSID(i); + }, [this, i]() { + accesspoints.getSelected(i) ? accesspoints.deselect(i) : accesspoints.select(i); + }, [this, i]() { + selectedID = i; + changeMenu(&apMenu); + }); + } + addMenuNode(&apListMenu, D_SELECT_ALL, [this]() { // SELECT ALL + accesspoints.selectAll(); + changeMenu(&apListMenu); + }); + addMenuNode(&apListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL + accesspoints.deselectAll(); + changeMenu(&apListMenu); + }); + addMenuNode(&apListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL + accesspoints.removeAll(); + goBack(); + }); + }); + + // STATION LIST MENU + createMenu(&stationListMenu, &showMenu, [this]() { + // add stations to list + int c = stations.count(); + + for (int i = 0; i < c; i++) { + addMenuNode(&stationListMenu, [i]() { + return b2a(stations.getSelected(i)) + + (stations.hasName(i) ? stations.getNameStr(i) : stations.getMacVendorStr(i)); + }, [this, i]() { + stations.getSelected(i) ? stations.deselect(i) : stations.select(i); + }, [this, i]() { + selectedID = i; + changeMenu(&stationMenu); + }); + } + + addMenuNode(&stationListMenu, D_SELECT_ALL, [this]() { // SELECT ALL + stations.selectAll(); + changeMenu(&stationListMenu); + }); + addMenuNode(&stationListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL + stations.deselectAll(); + changeMenu(&stationListMenu); + }); + addMenuNode(&stationListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL + stations.removeAll(); + goBack(); + }); + }); + + // NAME LIST MENU + createMenu(&nameListMenu, &showMenu, [this]() { + // add device names to list + int c = names.count(); + + for (int i = 0; i < c; i++) { + addMenuNode(&nameListMenu, [i]() { + return names.getSelectedStr(i) + names.getName(i); + }, [this, i]() { + names.getSelected(i) ? names.deselect(i) : names.select(i); + }, [this, i]() { + selectedID = i; + changeMenu(&nameMenu); + }); + } + addMenuNode(&nameListMenu, D_SELECT_ALL, [this]() { // SELECT ALL + names.selectAll(); + changeMenu(&nameListMenu); + }); + addMenuNode(&nameListMenu, D_DESELECT_ALL, [this]() { // DESELECT ALL + names.deselectAll(); + changeMenu(&nameListMenu); + }); + addMenuNode(&nameListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL + names.removeAll(); + goBack(); + }); + }); + + // SSID LIST MENU + createMenu(&ssidListMenu, &showMenu, [this]() { + addMenuNode(&ssidListMenu, D_CLONE_APS, [this]() { // CLONE APs + ssids.cloneSelected(true); + changeMenu(&ssidListMenu); + ssids.save(false); + }); + addMenuNode(&ssidListMenu, [this]() { + return b2a(ssids.getRandom()) + str(D_RANDOM_MODE); // *RANDOM MODE + }, [this]() { + if (ssids.getRandom()) ssids.disableRandom(); + else ssids.enableRandom(10); + changeMenu(&ssidListMenu); + }); + + // add ssids to list + int c = ssids.count(); + + for (int i = 0; i < c; i++) { + addMenuNode(&ssidListMenu, [i]() { + return ssids.getName(i).substring(0, ssids.getLen(i)); + }, [this, i]() { + selectedID = i; + changeMenu(&ssidMenu); + }, [this, i]() { + ssids.remove(i); + changeMenu(&ssidListMenu); + ssidListMenu.selected = i; + }); + } + + addMenuNode(&ssidListMenu, D_REMOVE_ALL, [this]() { // REMOVE ALL + ssids.removeAll(); + goBack(); + }); + }); + + // AP MENU + createMenu(&apMenu, &apListMenu, [this]() { + addMenuNode(&apMenu, [this]() { + return accesspoints.getSelectedStr(selectedID) + accesspoints.getSSID(selectedID); // * + }, [this]() { + accesspoints.getSelected(selectedID) ? accesspoints.deselect(selectedID) : accesspoints.select(selectedID); + }); + addMenuNode(&apMenu, [this]() { + return str(D_ENCRYPTION) + accesspoints.getEncStr(selectedID); + }, NULL); // Encryption: -/WPA2 + addMenuNode(&apMenu, [this]() { + return str(D_RSSI) + (String)accesspoints.getRSSI(selectedID); + }, NULL); // RSSI: -90 + addMenuNode(&apMenu, [this]() { + return str(D_CHANNEL) + (String)accesspoints.getCh(selectedID); + }, NULL); // Channel: 11 + addMenuNode(&apMenu, [this]() { + return accesspoints.getMacStr(selectedID); + }, NULL); // 00:11:22:00:11:22 + addMenuNode(&apMenu, [this]() { + return str(D_VENDOR) + accesspoints.getVendorStr(selectedID); + }, NULL); // Vendor: INTEL + addMenuNode(&apMenu, [this]() { + return accesspoints.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT + }, [this]() { + accesspoints.getSelected(selectedID) ? accesspoints.deselect(selectedID) : accesspoints.select(selectedID); + }); + addMenuNode(&apMenu, D_CLONE, [this]() { // CLONE + ssids.add(accesspoints.getSSID(selectedID), accesspoints.getEnc(selectedID) != ENC_TYPE_NONE, 60, true); + changeMenu(&showMenu); + ssids.save(false); + }); + addMenuNode(&apMenu, D_REMOVE, [this]() { // REMOVE + accesspoints.remove(selectedID); + apListMenu.list->remove(apListMenu.selected); + goBack(); + }); + }); + + // STATION MENU + createMenu(&stationMenu, &stationListMenu, [this]() { + addMenuNode(&stationMenu, [this]() { + return stations.getSelectedStr(selectedID) + + (stations.hasName(selectedID) ? stations.getNameStr(selectedID) : stations.getMacVendorStr(selectedID)); // + }, [this]() { + stations.getSelected(selectedID) ? stations.deselect(selectedID) : stations.select(selectedID); + }); + addMenuNode(&stationMenu, [this]() { + return stations.getMacStr(selectedID); + }, NULL); // 00:11:22:00:11:22 + addMenuNode(&stationMenu, [this]() { + return str(D_VENDOR) + stations.getVendorStr(selectedID); + }, NULL); // Vendor: INTEL + addMenuNode(&stationMenu, [this]() { + return str(D_AP) + stations.getAPStr(selectedID); // AP: someAP + }, [this]() { + int apID = accesspoints.find(stations.getAP(selectedID)); + + if (apID >= 0) { + selectedID = apID; + changeMenu(&apMenu); + } + }); + addMenuNode(&stationMenu, [this]() { + return str(D_PKTS) + String(*stations.getPkts(selectedID)); + }, NULL); // Pkts: 12 + addMenuNode(&stationMenu, [this]() { + return str(D_CHANNEL) + String(stations.getCh(selectedID)); + }, NULL); // Channel: 11 + addMenuNode(&stationMenu, [this]() { + return str(D_SEEN) + stations.getTimeStr(selectedID); + }, NULL); // Seen: <1min + + addMenuNode(&stationMenu, [this]() { + return stations.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT + }, [this]() { + stations.getSelected(selectedID) ? stations.deselect(selectedID) : stations.select(selectedID); + }); + addMenuNode(&stationMenu, D_REMOVE, [this]() { // REMOVE + stations.remove(selectedID); + stationListMenu.list->remove(stationListMenu.selected); + goBack(); + }); + }); + + // NAME MENU + createMenu(&nameMenu, &nameListMenu, [this]() { + addMenuNode(&nameMenu, [this]() { + return names.getSelectedStr(selectedID) + names.getName(selectedID); // + }, [this]() { + names.getSelected(selectedID) ? names.deselect(selectedID) : names.select(selectedID); + }); + addMenuNode(&nameMenu, [this]() { + return names.getMacStr(selectedID); + }, NULL); // 00:11:22:00:11:22 + addMenuNode(&nameMenu, [this]() { + return str(D_VENDOR) + names.getVendorStr(selectedID); + }, NULL); // Vendor: INTEL + addMenuNode(&nameMenu, [this]() { + return str(D_AP) + names.getBssidStr(selectedID); + }, NULL); // AP: 00:11:22:00:11:22 + addMenuNode(&nameMenu, [this]() { + return str(D_CHANNEL) + (String)names.getCh(selectedID); + }, NULL); // Channel: 11 + + addMenuNode(&nameMenu, [this]() { + return names.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT + }, [this]() { + names.getSelected(selectedID) ? names.deselect(selectedID) : names.select(selectedID); + }); + addMenuNode(&nameMenu, D_REMOVE, [this]() { // REMOVE + names.remove(selectedID); + nameListMenu.list->remove(nameListMenu.selected); + goBack(); + }); + }); + + // SSID MENU + createMenu(&ssidMenu, &ssidListMenu, [this]() { + addMenuNode(&ssidMenu, [this]() { + return ssids.getName(selectedID).substring(0, ssids.getLen(selectedID)); + }, NULL); // SSID + addMenuNode(&ssidMenu, [this]() { + return str(D_ENCRYPTION) + ssids.getEncStr(selectedID); // WPA2 + }, [this]() { + ssids.setWPA2(selectedID, !ssids.getWPA2(selectedID)); + }); + addMenuNode(&ssidMenu, D_REMOVE, [this]() { // REMOVE + ssids.remove(selectedID); + ssidListMenu.list->remove(ssidListMenu.selected); + goBack(); + }); + }); + + // ATTACK MENU + createMenu(&attackMenu, &mainMenu, [this]() { + addMenuNode(&attackMenu, [this]() { // *DEAUTH 0/0 + if (attack.isRunning()) return leftRight(b2a(deauthSelected) + str(D_DEAUTH), + (String)attack.getDeauthPkts() + SLASH + + (String)attack.getDeauthMaxPkts(), maxLen - 1); + else return leftRight(b2a(deauthSelected) + str(D_DEAUTH), (String)scan.countSelected(), maxLen - 1); + }, [this]() { // deauth + deauthSelected = !deauthSelected; + + if (attack.isRunning()) { + attack.start(beaconSelected, deauthSelected, false, probeSelected, true, + settings.getAttackTimeout() * 1000); + } + }); + addMenuNode(&attackMenu, [this]() { // *BEACON 0/0 + if (attack.isRunning()) return leftRight(b2a(beaconSelected) + str(D_BEACON), + (String)attack.getBeaconPkts() + SLASH + + (String)attack.getBeaconMaxPkts(), maxLen - 1); + else return leftRight(b2a(beaconSelected) + str(D_BEACON), (String)ssids.count(), maxLen - 1); + }, [this]() { // beacon + beaconSelected = !beaconSelected; + + if (attack.isRunning()) { + attack.start(beaconSelected, deauthSelected, false, probeSelected, true, + settings.getAttackTimeout() * 1000); + } + }); + addMenuNode(&attackMenu, [this]() { // *PROBE 0/0 + if (attack.isRunning()) return leftRight(b2a(probeSelected) + str(D_PROBE), + (String)attack.getProbePkts() + SLASH + + (String)attack.getProbeMaxPkts(), maxLen - 1); + else return leftRight(b2a(probeSelected) + str(D_PROBE), (String)ssids.count(), maxLen - 1); + }, [this]() { // probe + probeSelected = !probeSelected; + + if (attack.isRunning()) { + attack.start(beaconSelected, deauthSelected, false, probeSelected, true, + settings.getAttackTimeout() * 1000); + } + }); + addMenuNode(&attackMenu, [this]() { // START + return leftRight(str(attack.isRunning() ? D_STOP_ATTACK : D_START_ATTACK), + attack.getPacketRate() > 0 ? (String)attack.getPacketRate() : String(), maxLen - 1); + }, [this]() { + if (attack.isRunning()) attack.stop(); + else attack.start(beaconSelected, deauthSelected, false, probeSelected, true, + settings.getAttackTimeout() * 1000); + }); + }); + + // ===================== // + + // set current menu to main menu + changeMenu(&mainMenu); + enabled = true; + startTime = currentTime; +} + +#ifdef HIGHLIGHT_LED +void DisplayUI::setupLED() { + pinMode(HIGHLIGHT_LED, OUTPUT); + digitalWrite(HIGHLIGHT_LED, HIGH); + highlightLED = true; +} + +#endif // ifdef HIGHLIGHT_LED + +void DisplayUI::update() { + if (!enabled) return; + + up->update(); + down->update(); + a->update(); + b->update(); + + draw(); + + uint32_t timeout = settings.getDisplayTimeout() * 1000; + + if (currentTime > timeout) { + if (!tempOff) { + if (buttonTime < currentTime - timeout) off(); + } else { + if (buttonTime > currentTime - timeout) on(); + } + } +} + +void DisplayUI::on() { + if (enabled) { + configOn(); + tempOff = false; + buttonTime = currentTime; // update a button time to keep display on + prntln(D_MSG_DISPLAY_ON); + } else { + prntln(D_ERROR_NOT_ENABLED); + } +} + +void DisplayUI::off() { + if (enabled) { + configOff(); + tempOff = true; + prntln(D_MSG_DISPLAY_OFF); + } else { + prntln(D_ERROR_NOT_ENABLED); + } +} + +void DisplayUI::setupButtons() { + up = new ButtonPullup(BUTTON_UP); + down = new ButtonPullup(BUTTON_DOWN); + a = new ButtonPullup(BUTTON_A); + b = new ButtonPullup(BUTTON_B); + + // === BUTTON UP === // + up->setOnClicked([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + + if (!tempOff) { + if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor + if (currentMenu->selected > 0) currentMenu->selected--; + else currentMenu->selected = currentMenu->list->size() - 1; + } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel + scan.setChannel(wifi_channel + 1); + } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel + setTime(clockHour, clockMinute + 1, clockSecond); + } + } + }); + + up->setOnHolding([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor + if (currentMenu->selected > 0) currentMenu->selected--; + else currentMenu->selected = currentMenu->list->size() - 1; + } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel + scan.setChannel(wifi_channel + 1); + } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel + setTime(clockHour, clockMinute + 10, clockSecond); + } + } + }, buttonDelay); + + // === BUTTON DOWN === // + down->setOnClicked([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor + if (currentMenu->selected < currentMenu->list->size() - 1) currentMenu->selected++; + else currentMenu->selected = 0; + } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel + scan.setChannel(wifi_channel - 1); + } else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel + setTime(clockHour, clockMinute - 1, clockSecond); + } + } + }); + + down->setOnHolding([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + if (mode == DISPLAY_MODE::MENU) { // when in menu, go up or down with cursor + if (currentMenu->selected < currentMenu->list->size() - 1) currentMenu->selected++; + else currentMenu->selected = 0; + } else if (mode == DISPLAY_MODE::PACKETMONITOR) { // when in packet monitor, change channel + scan.setChannel(wifi_channel - 1); + } + + else if (mode == DISPLAY_MODE::CLOCK) { // when in packet monitor, change channel + setTime(clockHour, clockMinute - 10, clockSecond); + } + } + }, buttonDelay); + + // === BUTTON A === // + a->setOnClicked([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + switch (mode) { + case DISPLAY_MODE::MENU: + + if (currentMenu->list->get(currentMenu->selected).click) { + currentMenu->list->get(currentMenu->selected).click(); + } + break; + + case DISPLAY_MODE::PACKETMONITOR: + case DISPLAY_MODE::LOADSCAN: + scan.stop(); + mode = DISPLAY_MODE::MENU; + break; + + case DISPLAY_MODE::CLOCK: + mode = DISPLAY_MODE::MENU; + display.setFont(DejaVu_Sans_Mono_12); + display.setTextAlignment(TEXT_ALIGN_LEFT); + break; + } + } + }); + + a->setOnHolding([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + if (mode == DISPLAY_MODE::MENU) { + if (currentMenu->list->get(currentMenu->selected).hold) { + currentMenu->list->get(currentMenu->selected).hold(); + } + } + } + }, 800); + + // === BUTTON B === // + b->setOnClicked([this]() { + scrollCounter = 0; + scrollTime = currentTime; + buttonTime = currentTime; + if (!tempOff) { + switch (mode) { + case DISPLAY_MODE::MENU: + goBack(); + break; + + case DISPLAY_MODE::PACKETMONITOR: + case DISPLAY_MODE::LOADSCAN: + scan.stop(); + mode = DISPLAY_MODE::MENU; + break; + + case DISPLAY_MODE::CLOCK: + mode = DISPLAY_MODE::MENU; + display.setFont(DejaVu_Sans_Mono_12); + display.setTextAlignment(TEXT_ALIGN_LEFT); + break; + } + } + }); +} + +String DisplayUI::getChannel() { + String ch = String(wifi_channel); + + if (ch.length() < 2) ch = ' ' + ch; + return ch; +} + +void DisplayUI::draw() { + if ((currentTime - drawTime > drawInterval) && currentMenu) { + drawTime = currentTime; + + updatePrefix(); + + if (clockTime < currentTime - 1000) { + setTime(clockHour, clockMinute++, clockSecond + 1); + clockTime += 1000; + } + + switch (mode) { + case DISPLAY_MODE::BUTTON_TEST: + drawButtonTest(); + break; + + case DISPLAY_MODE::MENU: + drawMenu(); + break; + + case DISPLAY_MODE::LOADSCAN: + drawLoadingScan(); + break; + + case DISPLAY_MODE::PACKETMONITOR: + drawPacketMonitor(); + break; + + case DISPLAY_MODE::INTRO: + if (currentTime - startTime >= screenIntroTime) { + mode = DISPLAY_MODE::MENU; + } + drawIntro(); + break; + case DISPLAY_MODE::CLOCK: + drawClock(); + break; + } + + updateSuffix(); + } +} + +void DisplayUI::drawButtonTest() { + drawString(0, str(D_UP) + b2s(up->read())); + drawString(1, str(D_DOWN) + b2s(down->read())); + drawString(2, str(D_A) + b2s(a->read())); + drawString(3, str(D_B) + b2s(b->read())); +} + +void DisplayUI::drawMenu() { + String tmp; + int tmpLen; + int row = (currentMenu->selected / 5) * 5; + + // correct selected if it's off + if (currentMenu->selected < 0) currentMenu->selected = 0; + else if (currentMenu->selected >= currentMenu->list->size()) currentMenu->selected = currentMenu->list->size() - 1; + + // draw menu entries + for (int i = row; i < currentMenu->list->size() && i < row + 5; i++) { + tmp = currentMenu->list->get(i).getStr(); + tmpLen = tmp.length(); + + // horizontal scrolling + if ((currentMenu->selected == i) && (tmpLen >= maxLen)) { + tmp = tmp + tmp; + tmp = tmp.substring(scrollCounter, scrollCounter + maxLen - 1); + + if (((scrollCounter > 0) && (scrollTime < currentTime - scrollSpeed)) || ((scrollCounter == 0) && (scrollTime < currentTime - scrollSpeed * 4))) { + scrollTime = currentTime; + scrollCounter++; + } + + if (scrollCounter > tmpLen) scrollCounter = 0; + } + + tmp = (currentMenu->selected == i ? CURSOR : SPACE) + tmp; + drawString(0, (i - row) * 12, tmp); + } +} + +void DisplayUI::drawLoadingScan() { + String percentage; + + if (scan.isScanning()) { + percentage = String(scan.getPercentage()) + '%'; + } else { + percentage = str(DSP_SCAN_DONE); + } + + drawString(0, leftRight(str(DSP_SCAN_FOR), scan.getMode(), maxLen)); + drawString(1, leftRight(str(DSP_APS), String(accesspoints.count()), maxLen)); + drawString(2, leftRight(str(DSP_STS), String(stations.count()), maxLen)); + drawString(3, leftRight(str(DSP_PKTS), String(scan.getPacketRate()) + str(DSP_S), maxLen)); + drawString(4, center(percentage, maxLen)); +} + +void DisplayUI::drawPacketMonitor() { + double scale = scan.getScaleFactor(sreenHeight - lineHeight - 2); + + String headline = leftRight(str(D_CH) + getChannel() + String(' ') + String('[') + String(scan.deauths) + String(']'), String(scan.getPacketRate()) + str(D_PKTS), maxLen); + + drawString(0, 0, headline); + + if (scan.getMaxPacket() > 0) { + int i = 0; + int x = 0; + int y = 0; + + while (i < SCAN_PACKET_LIST_SIZE && x < screenWidth) { + y = (sreenHeight-1) - (scan.getPackets(i) * scale); + i++; + + // Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y); + drawLine(x, (sreenHeight-1), x, y); + x++; + + // Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y); + drawLine(x, (sreenHeight-1), x, y); + x++; + } + // Serial.println("---------"); + } +} + +void DisplayUI::drawIntro() { + drawString(0, center(str(D_INTRO_0), maxLen)); + drawString(1, center(str(D_INTRO_1), maxLen)); + drawString(2, center(str(D_INTRO_2), maxLen)); + drawString(3, center(str(D_INTRO_3), maxLen)); + drawString(4, center(settings.getVersion(), maxLen)); +} + +void DisplayUI::drawClock() { + String clockTime = String(clockHour); + + clockTime += ':'; + if (clockMinute < 10) clockTime += '0'; + clockTime += String(clockMinute); + + display.drawString(64, 20, clockTime); +} + +void DisplayUI::clearMenu(Menu* menu) { + while (menu->list->size() > 0) { + menu->list->remove(0); + } +} + +void DisplayUI::changeMenu(Menu* menu) { + if (menu) { + // only open list menu if it has nodes + if (((menu == &apListMenu) && (accesspoints.count() == 0)) || + ((menu == &stationListMenu) && (stations.count() == 0)) || + ((menu == &nameListMenu) && (names.count() == 0))) { + return; + } + + if (currentMenu) clearMenu(currentMenu); + currentMenu = menu; + currentMenu->selected = 0; + buttonTime = currentTime; + + if (selectedID < 0) selectedID = 0; + + if (currentMenu->parentMenu) { + addMenuNode(currentMenu, D_BACK, currentMenu->parentMenu); // add [BACK] + currentMenu->selected = 1; + } + + if (currentMenu->build) currentMenu->build(); + } +} + +void DisplayUI::goBack() { + if (currentMenu->parentMenu) changeMenu(currentMenu->parentMenu); +} + +void DisplayUI::createMenu(Menu* menu, Menu* parent, std::functionbuild) { + menu->list = new SimpleList; + menu->parentMenu = parent; + menu->selected = 0; + menu->build = build; +} + +void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, std::functionclick, + std::functionhold) { + menu->list->add(MenuNode{ getStr, click, hold }); +} + +void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, std::functionclick) { + addMenuNode(menu, getStr, click, NULL); +} + +void DisplayUI::addMenuNode(Menu* menu, std::functiongetStr, Menu* next) { + addMenuNode(menu, getStr, [this, next]() { + changeMenu(next); + }); +} + +void DisplayUI::addMenuNode(Menu* menu, const char* ptr, std::functionclick) { + addMenuNode(menu, [ptr]() { + return str(ptr); + }, click); +} + +void DisplayUI::addMenuNode(Menu* menu, const char* ptr, Menu* next) { + addMenuNode(menu, [ptr]() { + return str(ptr); + }, next); +} + +void DisplayUI::setTime(int h, int m, int s) { + if (s >= 60) { + s = 0; + m++; + } + + if (m >= 60) { + m = 0; + h++; + } + + if (h >= 24) { + h = 0; + } + + if (s < 0) { + s = 59; + m--; + } + + if (m < 0) { + m = 59; + h--; + } + + if (h < 0) { + h = 23; + } + + clockHour = h; + clockMinute = m; + clockSecond = s; +} \ No newline at end of file diff --git a/esp8266_deauther/DisplayUI.h b/esp8266_deauther/DisplayUI.h index 808727a..6023feb 100644 --- a/esp8266_deauther/DisplayUI.h +++ b/esp8266_deauther/DisplayUI.h @@ -1,644 +1,642 @@ -#ifndef DisplayUI_h -#define DisplayUI_h - -#include "language.h" -#include "A_config.h" -#include "Settings.h" -#include "Names.h" -#include "SSIDs.h" -#include "Scan.h" -#include "Attack.h" - -#include - -using namespace simplebutton; - -extern Settings settings; -extern Names names; -extern SSIDs ssids; -extern Accesspoints accesspoints; -extern Stations stations; -extern Scan scan; -extern Attack attack; -extern uint32_t currentTime; - -extern String leftRight(String a, String b, int len); -extern String center(String a, int len); -extern String left(String a, int len); -extern String right(String a, int len); -extern String leftRight(String a, String b, int len); -extern String replaceUtf8(String str, String r); - -const char D_INTRO_0[] PROGMEM = ""; -const char D_INTRO_1[] PROGMEM = "ESP8266 Deauther"; -const char D_INTRO_2[] PROGMEM = "by @Spacehuhn"; -const char D_INTRO_3[] PROGMEM = ""; - -// fallback for the buttons -#ifndef BUTTON_UP - #define BUTTON_UP 255 -#endif // ifndef BUTTON_UP - -#ifndef BUTTON_DOWN - #define BUTTON_DOWN 255 -#endif // ifndef BUTTON_DOWN - -#ifndef BUTTON_A - #define BUTTON_A 255 -#endif // ifndef BUTTON_A - -#ifndef BUTTON_B - #define BUTTON_B 255 -#endif // ifndef BUTTON_B - -struct MenuNode { - std::functiongetStr; // function used to create the displayed string - std::function click; // function that is executed when node is clicked - std::function hold; // function that is executed when node is pressed for > 800ms -}; - -struct Menu { - SimpleList* list; - Menu * parentMenu; - uint8_t selected; - std::function build; // function that is executed when button is clicked -}; - -class DisplayUI { - public: - enum DISPLAY_MODE { OFF = 0, BUTTON_TEST = 1, MENU = 2, LOADSCAN = 3, PACKETMONITOR = 4, INTRO = 5, CLOCK = 6 }; - - uint8_t mode = DISPLAY_MODE::MENU; - bool highlightLED = false; - - Button* up = NULL; - Button* down = NULL; - Button* a = NULL; - Button* b = NULL; - - // ===== adjustable ===== // - DEAUTHER_DISPLAY // see config.h - - const uint8_t maxLen = 18; - const uint8_t lineHeight = 12; - const uint8_t buttonDelay = 250; - const uint8_t drawInterval = 100; // 100ms = 10 FPS - const uint16_t scrollSpeed = 500; // time interval in ms - const uint16_t screenIntroTime = 2500; - const uint16_t screenWidth = 128; - const uint16_t sreenHeight = 64; - - void configInit(); - void configOn(); - void configOff(); - void updatePrefix(); - void updateSuffix(); - void drawString(int x, int y, String str); - void drawString(int row, String str); - void drawLine(int x1, int y1, int x2, int y2); - // ====================== // - - DisplayUI(); - ~DisplayUI(); - - void setup(); -#ifdef HIGHLIGHT_LED - void setupLED(); -#endif // ifdef HIGHLIGHT_LED - - void update(); - void on(); - void off(); - - private: - int16_t selectedID = 0; // i.e. access point ID to draw the apMenu - uint8_t scrollCounter = 0; // for horizontal scrolling - - uint32_t scrollTime = 0; // last time a character was moved - uint32_t drawTime = 0; // last time a frame was drawn - uint32_t startTime = 0; // when the screen was enabled - uint32_t buttonTime = 0; // last time a button was pressed - - bool enabled = false; // display enabled - bool tempOff = false; - - // selected attack modes - bool beaconSelected = false; - bool deauthSelected = false; - bool probeSelected = false; - - // menus - Menu* currentMenu; - - Menu mainMenu; - - Menu scanMenu; - Menu showMenu; - Menu attackMenu; - - Menu apListMenu; - Menu stationListMenu; - Menu nameListMenu; - Menu ssidListMenu; - - Menu apMenu; - Menu stationMenu; - Menu nameMenu; - Menu ssidMenu; - - void setupButtons(); - - String getChannel(); - - // draw functions - void draw(); - void drawButtonTest(); - void drawMenu(); - void drawLoadingScan(); - void drawPacketMonitor(); - void drawIntro(); - void clearMenu(Menu* menu); - - // menu functions - void changeMenu(Menu* menu); - void goBack(); - void createMenu(Menu* menu, Menu* parent, std::functionbuild); - - void addMenuNode(Menu* menu, std::functiongetStr, std::functionclick, std::functionhold); - void addMenuNode(Menu* menu, std::functiongetStr, std::functionclick); - void addMenuNode(Menu* menu, std::functiongetStr, Menu* next); - void addMenuNode(Menu* menu, const char* ptr, std::functionclick); - void addMenuNode(Menu* menu, const char* ptr, Menu* next); - - // fake clock - void drawClock(); - void setTime(int h, int m, int s); - - int clockHour = 6; - int clockMinute = 0; - int clockSecond = 0; - - uint32_t clockTime = 0; -}; - -// ===== FONT ===== // -// Created by http://oleddisplay.squix.ch/ Consider a donation -// In case of problems make sure that you are using the font file with the correct version! -const uint8_t DejaVu_Sans_Mono_12[] PROGMEM = { - 0x07, // Width: 7 - 0x0F, // Height: 15 - 0x20, // First Char: 32 - 0xE0, // Numbers of Chars: 224 - - // Jump Table: - 0xFF, 0xFF, 0x00, 0x07, // 32:65535 - 0x00, 0x00, 0x08, 0x07, // 33:0 - 0x00, 0x08, 0x09, 0x07, // 34:8 - 0x00, 0x11, 0x0D, 0x07, // 35:17 - 0x00, 0x1E, 0x0C, 0x07, // 36:30 - 0x00, 0x2A, 0x0E, 0x07, // 37:42 - 0x00, 0x38, 0x0E, 0x07, // 38:56 - 0x00, 0x46, 0x07, 0x07, // 39:70 - 0x00, 0x4D, 0x0C, 0x07, // 40:77 - 0x00, 0x59, 0x0A, 0x07, // 41:89 - 0x00, 0x63, 0x0B, 0x07, // 42:99 - 0x00, 0x6E, 0x0E, 0x07, // 43:110 - 0x00, 0x7C, 0x08, 0x07, // 44:124 - 0x00, 0x84, 0x0A, 0x07, // 45:132 - 0x00, 0x8E, 0x08, 0x07, // 46:142 - 0x00, 0x96, 0x0D, 0x07, // 47:150 - 0x00, 0xA3, 0x0E, 0x07, // 48:163 - 0x00, 0xB1, 0x0C, 0x07, // 49:177 - 0x00, 0xBD, 0x0E, 0x07, // 50:189 - 0x00, 0xCB, 0x0E, 0x07, // 51:203 - 0x00, 0xD9, 0x0E, 0x07, // 52:217 - 0x00, 0xE7, 0x0E, 0x07, // 53:231 - 0x00, 0xF5, 0x0E, 0x07, // 54:245 - 0x01, 0x03, 0x0D, 0x07, // 55:259 - 0x01, 0x10, 0x0E, 0x07, // 56:272 - 0x01, 0x1E, 0x0E, 0x07, // 57:286 - 0x01, 0x2C, 0x08, 0x07, // 58:300 - 0x01, 0x34, 0x08, 0x07, // 59:308 - 0x01, 0x3C, 0x0E, 0x07, // 60:316 - 0x01, 0x4A, 0x0E, 0x07, // 61:330 - 0x01, 0x58, 0x0E, 0x07, // 62:344 - 0x01, 0x66, 0x0D, 0x07, // 63:358 - 0x01, 0x73, 0x0E, 0x07, // 64:371 - 0x01, 0x81, 0x0E, 0x07, // 65:385 - 0x01, 0x8F, 0x0E, 0x07, // 66:399 - 0x01, 0x9D, 0x0E, 0x07, // 67:413 - 0x01, 0xAB, 0x0E, 0x07, // 68:427 - 0x01, 0xB9, 0x0E, 0x07, // 69:441 - 0x01, 0xC7, 0x0D, 0x07, // 70:455 - 0x01, 0xD4, 0x0E, 0x07, // 71:468 - 0x01, 0xE2, 0x0E, 0x07, // 72:482 - 0x01, 0xF0, 0x0C, 0x07, // 73:496 - 0x01, 0xFC, 0x0C, 0x07, // 74:508 - 0x02, 0x08, 0x0E, 0x07, // 75:520 - 0x02, 0x16, 0x0E, 0x07, // 76:534 - 0x02, 0x24, 0x0E, 0x07, // 77:548 - 0x02, 0x32, 0x0E, 0x07, // 78:562 - 0x02, 0x40, 0x0E, 0x07, // 79:576 - 0x02, 0x4E, 0x0D, 0x07, // 80:590 - 0x02, 0x5B, 0x0E, 0x07, // 81:603 - 0x02, 0x69, 0x0E, 0x07, // 82:617 - 0x02, 0x77, 0x0E, 0x07, // 83:631 - 0x02, 0x85, 0x0D, 0x07, // 84:645 - 0x02, 0x92, 0x0E, 0x07, // 85:658 - 0x02, 0xA0, 0x0D, 0x07, // 86:672 - 0x02, 0xAD, 0x0E, 0x07, // 87:685 - 0x02, 0xBB, 0x0E, 0x07, // 88:699 - 0x02, 0xC9, 0x0D, 0x07, // 89:713 - 0x02, 0xD6, 0x0E, 0x07, // 90:726 - 0x02, 0xE4, 0x0A, 0x07, // 91:740 - 0x02, 0xEE, 0x0E, 0x07, // 92:750 - 0x02, 0xFC, 0x08, 0x07, // 93:764 - 0x03, 0x04, 0x0B, 0x07, // 94:772 - 0x03, 0x0F, 0x0E, 0x07, // 95:783 - 0x03, 0x1D, 0x09, 0x07, // 96:797 - 0x03, 0x26, 0x0C, 0x07, // 97:806 - 0x03, 0x32, 0x0C, 0x07, // 98:818 - 0x03, 0x3E, 0x0C, 0x07, // 99:830 - 0x03, 0x4A, 0x0C, 0x07, // 100:842 - 0x03, 0x56, 0x0C, 0x07, // 101:854 - 0x03, 0x62, 0x0B, 0x07, // 102:866 - 0x03, 0x6D, 0x0C, 0x07, // 103:877 - 0x03, 0x79, 0x0C, 0x07, // 104:889 - 0x03, 0x85, 0x0C, 0x07, // 105:901 - 0x03, 0x91, 0x0A, 0x07, // 106:913 - 0x03, 0x9B, 0x0C, 0x07, // 107:923 - 0x03, 0xA7, 0x0C, 0x07, // 108:935 - 0x03, 0xB3, 0x0C, 0x07, // 109:947 - 0x03, 0xBF, 0x0C, 0x07, // 110:959 - 0x03, 0xCB, 0x0C, 0x07, // 111:971 - 0x03, 0xD7, 0x0C, 0x07, // 112:983 - 0x03, 0xE3, 0x0C, 0x07, // 113:995 - 0x03, 0xEF, 0x0D, 0x07, // 114:1007 - 0x03, 0xFC, 0x0C, 0x07, // 115:1020 - 0x04, 0x08, 0x0C, 0x07, // 116:1032 - 0x04, 0x14, 0x0C, 0x07, // 117:1044 - 0x04, 0x20, 0x0B, 0x07, // 118:1056 - 0x04, 0x2B, 0x0D, 0x07, // 119:1067 - 0x04, 0x38, 0x0C, 0x07, // 120:1080 - 0x04, 0x44, 0x0B, 0x07, // 121:1092 - 0x04, 0x4F, 0x0C, 0x07, // 122:1103 - 0x04, 0x5B, 0x0C, 0x07, // 123:1115 - 0x04, 0x67, 0x08, 0x07, // 124:1127 - 0x04, 0x6F, 0x0B, 0x07, // 125:1135 - 0x04, 0x7A, 0x0E, 0x07, // 126:1146 - 0x04, 0x88, 0x0E, 0x07, // 127:1160 - 0x04, 0x96, 0x0E, 0x07, // 128:1174 - 0x04, 0xA4, 0x0E, 0x07, // 129:1188 - 0x04, 0xB2, 0x0E, 0x07, // 130:1202 - 0x04, 0xC0, 0x0E, 0x07, // 131:1216 - 0x04, 0xCE, 0x0E, 0x07, // 132:1230 - 0x04, 0xDC, 0x0E, 0x07, // 133:1244 - 0x04, 0xEA, 0x0E, 0x07, // 134:1258 - 0x04, 0xF8, 0x0E, 0x07, // 135:1272 - 0x05, 0x06, 0x0E, 0x07, // 136:1286 - 0x05, 0x14, 0x0E, 0x07, // 137:1300 - 0x05, 0x22, 0x0E, 0x07, // 138:1314 - 0x05, 0x30, 0x0E, 0x07, // 139:1328 - 0x05, 0x3E, 0x0E, 0x07, // 140:1342 - 0x05, 0x4C, 0x0E, 0x07, // 141:1356 - 0x05, 0x5A, 0x0E, 0x07, // 142:1370 - 0x05, 0x68, 0x0E, 0x07, // 143:1384 - 0x05, 0x76, 0x0E, 0x07, // 144:1398 - 0x05, 0x84, 0x0E, 0x07, // 145:1412 - 0x05, 0x92, 0x0E, 0x07, // 146:1426 - 0x05, 0xA0, 0x0E, 0x07, // 147:1440 - 0x05, 0xAE, 0x0E, 0x07, // 148:1454 - 0x05, 0xBC, 0x0E, 0x07, // 149:1468 - 0x05, 0xCA, 0x0E, 0x07, // 150:1482 - 0x05, 0xD8, 0x0E, 0x07, // 151:1496 - 0x05, 0xE6, 0x0E, 0x07, // 152:1510 - 0x05, 0xF4, 0x0E, 0x07, // 153:1524 - 0x06, 0x02, 0x0E, 0x07, // 154:1538 - 0x06, 0x10, 0x0E, 0x07, // 155:1552 - 0x06, 0x1E, 0x0E, 0x07, // 156:1566 - 0x06, 0x2C, 0x0E, 0x07, // 157:1580 - 0x06, 0x3A, 0x0E, 0x07, // 158:1594 - 0x06, 0x48, 0x0E, 0x07, // 159:1608 - 0xFF, 0xFF, 0x00, 0x07, // 160:65535 - 0x06, 0x56, 0x08, 0x07, // 161:1622 - 0x06, 0x5E, 0x0C, 0x07, // 162:1630 - 0x06, 0x6A, 0x0C, 0x07, // 163:1642 - 0x06, 0x76, 0x0E, 0x07, // 164:1654 - 0x06, 0x84, 0x0D, 0x07, // 165:1668 - 0x06, 0x91, 0x08, 0x07, // 166:1681 - 0x06, 0x99, 0x0C, 0x07, // 167:1689 - 0x06, 0xA5, 0x09, 0x07, // 168:1701 - 0x06, 0xAE, 0x0E, 0x07, // 169:1710 - 0x06, 0xBC, 0x0A, 0x07, // 170:1724 - 0x06, 0xC6, 0x0E, 0x07, // 171:1734 - 0x06, 0xD4, 0x0E, 0x07, // 172:1748 - 0x06, 0xE2, 0x0A, 0x07, // 173:1762 - 0x06, 0xEC, 0x0E, 0x07, // 174:1772 - 0x06, 0xFA, 0x0B, 0x07, // 175:1786 - 0x07, 0x05, 0x0B, 0x07, // 176:1797 - 0x07, 0x10, 0x0E, 0x07, // 177:1808 - 0x07, 0x1E, 0x09, 0x07, // 178:1822 - 0x07, 0x27, 0x0B, 0x07, // 179:1831 - 0x07, 0x32, 0x09, 0x07, // 180:1842 - 0x07, 0x3B, 0x0E, 0x07, // 181:1851 - 0x07, 0x49, 0x0E, 0x07, // 182:1865 - 0x07, 0x57, 0x08, 0x07, // 183:1879 - 0x07, 0x5F, 0x0A, 0x07, // 184:1887 - 0x07, 0x69, 0x09, 0x07, // 185:1897 - 0x07, 0x72, 0x0A, 0x07, // 186:1906 - 0x07, 0x7C, 0x0E, 0x07, // 187:1916 - 0x07, 0x8A, 0x0E, 0x07, // 188:1930 - 0x07, 0x98, 0x0C, 0x07, // 189:1944 - 0x07, 0xA4, 0x0E, 0x07, // 190:1956 - 0x07, 0xB2, 0x0A, 0x07, // 191:1970 - 0x07, 0xBC, 0x0E, 0x07, // 192:1980 - 0x07, 0xCA, 0x0E, 0x07, // 193:1994 - 0x07, 0xD8, 0x0E, 0x07, // 194:2008 - 0x07, 0xE6, 0x0E, 0x07, // 195:2022 - 0x07, 0xF4, 0x0E, 0x07, // 196:2036 - 0x08, 0x02, 0x0E, 0x07, // 197:2050 - 0x08, 0x10, 0x0E, 0x07, // 198:2064 - 0x08, 0x1E, 0x0E, 0x07, // 199:2078 - 0x08, 0x2C, 0x0E, 0x07, // 200:2092 - 0x08, 0x3A, 0x0E, 0x07, // 201:2106 - 0x08, 0x48, 0x0E, 0x07, // 202:2120 - 0x08, 0x56, 0x0E, 0x07, // 203:2134 - 0x08, 0x64, 0x0C, 0x07, // 204:2148 - 0x08, 0x70, 0x0C, 0x07, // 205:2160 - 0x08, 0x7C, 0x0C, 0x07, // 206:2172 - 0x08, 0x88, 0x0C, 0x07, // 207:2184 - 0x08, 0x94, 0x0E, 0x07, // 208:2196 - 0x08, 0xA2, 0x0E, 0x07, // 209:2210 - 0x08, 0xB0, 0x0E, 0x07, // 210:2224 - 0x08, 0xBE, 0x0E, 0x07, // 211:2238 - 0x08, 0xCC, 0x0E, 0x07, // 212:2252 - 0x08, 0xDA, 0x0E, 0x07, // 213:2266 - 0x08, 0xE8, 0x0E, 0x07, // 214:2280 - 0x08, 0xF6, 0x0C, 0x07, // 215:2294 - 0x09, 0x02, 0x0E, 0x07, // 216:2306 - 0x09, 0x10, 0x0E, 0x07, // 217:2320 - 0x09, 0x1E, 0x0E, 0x07, // 218:2334 - 0x09, 0x2C, 0x0E, 0x07, // 219:2348 - 0x09, 0x3A, 0x0E, 0x07, // 220:2362 - 0x09, 0x48, 0x0D, 0x07, // 221:2376 - 0x09, 0x55, 0x0D, 0x07, // 222:2389 - 0x09, 0x62, 0x0C, 0x07, // 223:2402 - 0x09, 0x6E, 0x0C, 0x07, // 224:2414 - 0x09, 0x7A, 0x0C, 0x07, // 225:2426 - 0x09, 0x86, 0x0C, 0x07, // 226:2438 - 0x09, 0x92, 0x0C, 0x07, // 227:2450 - 0x09, 0x9E, 0x0C, 0x07, // 228:2462 - 0x09, 0xAA, 0x0C, 0x07, // 229:2474 - 0x09, 0xB6, 0x0C, 0x07, // 230:2486 - 0x09, 0xC2, 0x0C, 0x07, // 231:2498 - 0x09, 0xCE, 0x0C, 0x07, // 232:2510 - 0x09, 0xDA, 0x0C, 0x07, // 233:2522 - 0x09, 0xE6, 0x0C, 0x07, // 234:2534 - 0x09, 0xF2, 0x0C, 0x07, // 235:2546 - 0x09, 0xFE, 0x0C, 0x07, // 236:2558 - 0x0A, 0x0A, 0x0C, 0x07, // 237:2570 - 0x0A, 0x16, 0x0C, 0x07, // 238:2582 - 0x0A, 0x22, 0x0C, 0x07, // 239:2594 - 0x0A, 0x2E, 0x0C, 0x07, // 240:2606 - 0x0A, 0x3A, 0x0C, 0x07, // 241:2618 - 0x0A, 0x46, 0x0C, 0x07, // 242:2630 - 0x0A, 0x52, 0x0C, 0x07, // 243:2642 - 0x0A, 0x5E, 0x0C, 0x07, // 244:2654 - 0x0A, 0x6A, 0x0C, 0x07, // 245:2666 - 0x0A, 0x76, 0x0C, 0x07, // 246:2678 - 0x0A, 0x82, 0x0C, 0x07, // 247:2690 - 0x0A, 0x8E, 0x0C, 0x07, // 248:2702 - 0x0A, 0x9A, 0x0C, 0x07, // 249:2714 - 0x0A, 0xA6, 0x0C, 0x07, // 250:2726 - 0x0A, 0xB2, 0x0C, 0x07, // 251:2738 - 0x0A, 0xBE, 0x0C, 0x07, // 252:2750 - 0x0A, 0xCA, 0x0B, 0x07, // 253:2762 - 0x0A, 0xD5, 0x0C, 0x07, // 254:2773 - 0x0A, 0xE1, 0x0B, 0x07, // 255:2785 - - // Font Data: - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x0D, // 33 - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, // 34 - 0x00, 0x02, 0x40, 0x0E, 0xE0, 0x03, 0x50, 0x0A, 0xC0, 0x07, 0x70, 0x02, 0x40, // 35 - 0x00, 0x00, 0xE0, 0x04, 0x90, 0x08, 0xF8, 0x3F, 0x10, 0x09, 0x20, 0x07, // 36 - 0x30, 0x00, 0x48, 0x01, 0x48, 0x01, 0xB0, 0x06, 0x80, 0x09, 0x40, 0x09, 0x00, 0x06, // 37 - 0x00, 0x00, 0x00, 0x07, 0xF0, 0x0C, 0xC8, 0x08, 0x08, 0x0B, 0x08, 0x06, 0x00, 0x0B, // 38 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // 39 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x1C, 0x1C, 0x04, 0x10, // 40 - 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x1C, 0x1C, 0xE0, 0x03, // 41 - 0x00, 0x00, 0x90, 0x00, 0x60, 0x00, 0xF8, 0x01, 0x60, 0x00, 0x90, // 42 - 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 43 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0C, // 44 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 45 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, // 46 - 0x00, 0x00, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x03, 0xC0, 0x00, 0x30, 0x00, 0x08, // 47 - 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x88, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 48 - 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x0F, 0x00, 0x08, 0x00, 0x08, // 49 - 0x00, 0x00, 0x10, 0x08, 0x08, 0x0C, 0x08, 0x0A, 0x08, 0x09, 0x88, 0x08, 0x70, 0x08, // 50 - 0x00, 0x00, 0x10, 0x04, 0x08, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 51 - 0x00, 0x00, 0x00, 0x03, 0xC0, 0x02, 0x60, 0x02, 0x18, 0x02, 0xF8, 0x0F, 0x00, 0x02, // 52 - 0x00, 0x00, 0x78, 0x04, 0x48, 0x08, 0x48, 0x08, 0x48, 0x08, 0xC8, 0x0C, 0x80, 0x07, // 53 - 0x00, 0x00, 0xE0, 0x03, 0x90, 0x0C, 0x48, 0x08, 0x48, 0x08, 0xC8, 0x0C, 0x90, 0x07, // 54 - 0x00, 0x00, 0x08, 0x00, 0x08, 0x08, 0x08, 0x06, 0x88, 0x01, 0x78, 0x00, 0x18, // 55 - 0x00, 0x00, 0x70, 0x07, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 56 - 0x00, 0x00, 0xF0, 0x04, 0x18, 0x09, 0x08, 0x09, 0x08, 0x09, 0x98, 0x04, 0xE0, 0x03, // 57 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, // 58 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xC0, 0x0C, // 59 - 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x20, 0x04, // 60 - 0x00, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, // 61 - 0x00, 0x00, 0x20, 0x04, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0x80, 0x01, // 62 - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x88, 0x0D, 0xC8, 0x00, 0x48, 0x00, 0x30, // 63 - 0x00, 0x00, 0xC0, 0x0F, 0x20, 0x18, 0x10, 0x23, 0x90, 0x24, 0xB0, 0x24, 0xE0, 0x07, // 64 - 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x03, 0x38, 0x02, 0x38, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 65 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 66 - 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, // 67 - 0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 68 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, // 69 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, // 70 - 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, 0x08, 0x08, 0x88, 0x08, 0x90, 0x07, // 71 - 0x00, 0x00, 0xF8, 0x0F, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x0F, // 72 - 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x0F, 0x08, 0x08, 0x08, 0x08, // 73 - 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x07, // 74 - 0x00, 0x00, 0xF8, 0x0F, 0x80, 0x00, 0xC0, 0x00, 0x20, 0x03, 0x10, 0x06, 0x08, 0x08, // 75 - 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 76 - 0x00, 0x00, 0xF8, 0x0F, 0x30, 0x00, 0xC0, 0x01, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x0F, // 77 - 0x00, 0x00, 0xF8, 0x0F, 0x18, 0x00, 0xE0, 0x00, 0x80, 0x03, 0x00, 0x0C, 0xF8, 0x0F, // 78 - 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 79 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, // 80 - 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x18, 0x3C, 0xE0, 0x07, // 81 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x01, 0x70, 0x06, // 82 - 0x00, 0x00, 0x70, 0x04, 0xC8, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x10, 0x07, // 83 - 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0x08, 0x00, 0x08, // 84 - 0x00, 0x00, 0xF8, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xF8, 0x07, // 85 - 0x00, 0x00, 0x18, 0x00, 0xE0, 0x01, 0x00, 0x0E, 0x00, 0x0E, 0xE0, 0x01, 0x18, // 86 - 0xF8, 0x01, 0x00, 0x0E, 0xC0, 0x03, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0E, 0xF8, 0x01, // 87 - 0x00, 0x00, 0x08, 0x08, 0x30, 0x06, 0xC0, 0x01, 0xC0, 0x01, 0x30, 0x06, 0x08, 0x08, // 88 - 0x08, 0x00, 0x10, 0x00, 0x60, 0x00, 0x80, 0x0F, 0x60, 0x00, 0x10, 0x00, 0x08, // 89 - 0x00, 0x00, 0x08, 0x0C, 0x08, 0x0E, 0x88, 0x09, 0xC8, 0x08, 0x38, 0x08, 0x18, 0x08, // 90 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x1F, 0x04, 0x10, // 91 - 0x00, 0x00, 0x08, 0x00, 0x30, 0x00, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x10, // 92 - 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0xFC, 0x1F, // 93 - 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, // 94 - 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, // 95 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, // 96 - 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x20, 0x09, 0x20, 0x09, 0xC0, 0x0F, // 97 - 0x00, 0x00, 0xFC, 0x0F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 98 - 0x00, 0x00, 0xC0, 0x07, 0x60, 0x0C, 0x20, 0x08, 0x20, 0x08, 0x40, 0x08, // 99 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xFC, 0x0F, // 100 - 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x20, 0x09, 0x20, 0x09, 0xC0, 0x05, // 101 - 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x0F, 0x24, 0x00, 0x24, // 102 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x28, 0x20, 0x48, 0x20, 0x48, 0xE0, 0x3F, // 103 - 0x00, 0x00, 0xFC, 0x0F, 0x40, 0x00, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x0F, // 104 - 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE4, 0x0F, 0x00, 0x08, 0x00, 0x08, // 105 - 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x20, 0x40, 0xE4, 0x3F, // 106 - 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, // 107 - 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0xFC, 0x07, 0x00, 0x08, 0x00, 0x08, // 108 - 0x00, 0x00, 0xE0, 0x0F, 0x20, 0x00, 0xE0, 0x0F, 0x20, 0x00, 0xE0, 0x0F, // 109 - 0x00, 0x00, 0xE0, 0x0F, 0x40, 0x00, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x0F, // 110 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 111 - 0x00, 0x00, 0xE0, 0x7F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 112 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xE0, 0x7F, // 113 - 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x40, // 114 - 0x00, 0x00, 0xC0, 0x04, 0x20, 0x09, 0x20, 0x09, 0x20, 0x09, 0x40, 0x06, // 115 - 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x0F, 0x20, 0x08, 0x20, 0x08, // 116 - 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xE0, 0x0F, // 117 - 0x00, 0x00, 0x60, 0x00, 0x80, 0x03, 0x00, 0x0C, 0x80, 0x03, 0x60, // 118 - 0x60, 0x00, 0x80, 0x03, 0x00, 0x0E, 0x80, 0x01, 0x00, 0x0E, 0x80, 0x03, 0x60, // 119 - 0x00, 0x00, 0x20, 0x08, 0xC0, 0x06, 0x00, 0x01, 0xC0, 0x06, 0x20, 0x08, // 120 - 0x00, 0x00, 0x60, 0x40, 0x80, 0x67, 0x00, 0x1C, 0x80, 0x03, 0x60, // 121 - 0x00, 0x00, 0x20, 0x0C, 0x20, 0x0A, 0x20, 0x09, 0xA0, 0x08, 0x60, 0x08, // 122 - 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7C, 0x1F, 0x04, 0x10, 0x04, 0x10, // 123 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, // 124 - 0x00, 0x00, 0x04, 0x10, 0x04, 0x10, 0x7C, 0x1F, 0x80, 0x00, 0x80, // 125 - 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 126 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 127 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 128 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 129 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 130 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 131 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 132 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 133 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 134 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 135 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 136 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 137 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 138 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 139 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 140 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 141 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 142 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 143 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 144 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 145 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 146 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 147 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 148 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 149 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 150 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 151 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 152 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 153 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 154 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 155 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 156 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 157 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 158 - 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 159 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3F, // 161 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0xF8, 0x3F, 0x20, 0x08, 0x40, 0x04, // 162 - 0x00, 0x00, 0x80, 0x08, 0xF0, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x08, 0x08, // 163 - 0x00, 0x00, 0x20, 0x04, 0xC0, 0x03, 0x40, 0x02, 0x40, 0x02, 0xC0, 0x03, 0x20, 0x04, // 164 - 0x08, 0x00, 0x50, 0x01, 0x60, 0x01, 0x80, 0x0F, 0x60, 0x01, 0x50, 0x01, 0x08, // 165 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3C, // 166 - 0x00, 0x00, 0xF0, 0x11, 0x28, 0x13, 0x48, 0x12, 0xC8, 0x14, 0x88, 0x0F, // 167 - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, // 168 - 0xC0, 0x01, 0x20, 0x02, 0xD0, 0x05, 0x50, 0x05, 0x50, 0x05, 0x20, 0x02, 0xC0, 0x01, // 169 - 0x00, 0x00, 0xE8, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0xF0, 0x02, // 170 - 0x00, 0x00, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, // 171 - 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x03, // 172 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 173 - 0xC0, 0x01, 0x20, 0x02, 0xD0, 0x05, 0xD0, 0x05, 0xD0, 0x05, 0x20, 0x02, 0xC0, 0x01, // 174 - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 175 - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 176 - 0x80, 0x08, 0x80, 0x08, 0x80, 0x08, 0xE0, 0x0B, 0x80, 0x08, 0x80, 0x08, 0x80, 0x08, // 177 - 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xE8, 0x00, 0xB8, // 178 - 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xD8, // 179 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, // 180 - 0x00, 0x00, 0xE0, 0x7F, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xE0, 0x0F, 0x00, 0x08, // 181 - 0x00, 0x00, 0x70, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0xF8, 0x1F, 0x08, 0x00, 0xF8, 0x1F, // 182 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, // 183 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x30, // 184 - 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xF8, 0x00, 0x80, // 185 - 0x00, 0x00, 0x70, 0x02, 0x88, 0x02, 0x88, 0x02, 0x70, 0x02, // 186 - 0x00, 0x00, 0x40, 0x04, 0x80, 0x02, 0x00, 0x01, 0x40, 0x04, 0x80, 0x02, 0x00, 0x01, // 187 - 0x44, 0x02, 0x7C, 0x03, 0x40, 0x01, 0x00, 0x0D, 0x80, 0x0B, 0x80, 0x1F, 0x00, 0x08, // 188 - 0x44, 0x02, 0x7C, 0x03, 0x40, 0x01, 0x00, 0x11, 0x80, 0x1D, 0x80, 0x17, // 189 - 0x00, 0x02, 0x44, 0x03, 0x54, 0x01, 0x54, 0x0D, 0xEC, 0x0B, 0x80, 0x1F, 0x00, 0x08, // 190 - 0x00, 0x38, 0x00, 0x4C, 0x00, 0x44, 0x60, 0x43, 0x00, 0x20, // 191 - 0x00, 0x00, 0x00, 0x0C, 0xC1, 0x03, 0x3A, 0x02, 0x38, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 192 - 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x03, 0x3A, 0x02, 0x39, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 193 - 0x00, 0x00, 0x00, 0x0C, 0xC2, 0x03, 0x39, 0x02, 0x39, 0x02, 0xC2, 0x03, 0x00, 0x0C, // 194 - 0x00, 0x00, 0x00, 0x0C, 0xC3, 0x03, 0x39, 0x02, 0x3A, 0x02, 0xC3, 0x03, 0x00, 0x0C, // 195 - 0x00, 0x00, 0x00, 0x0C, 0xC2, 0x03, 0x38, 0x02, 0x38, 0x02, 0xC2, 0x03, 0x00, 0x0C, // 196 - 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xFE, 0x02, 0xE6, 0x02, 0x00, 0x07, 0x00, 0x08, // 197 - 0x00, 0x0C, 0x80, 0x03, 0x78, 0x02, 0x08, 0x02, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, // 198 - 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x28, 0x08, 0x28, 0x08, 0x38, 0x10, 0x04, // 199 - 0x00, 0x00, 0xF8, 0x0F, 0x89, 0x08, 0x8A, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, // 200 - 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x8A, 0x08, 0x89, 0x08, 0x88, 0x08, 0x88, 0x08, // 201 - 0x00, 0x00, 0xF8, 0x0F, 0x8A, 0x08, 0x89, 0x08, 0x89, 0x08, 0x8A, 0x08, 0x88, 0x08, // 202 - 0x00, 0x00, 0xF8, 0x0F, 0x8A, 0x08, 0x88, 0x08, 0x8A, 0x08, 0x88, 0x08, 0x88, 0x08, // 203 - 0x00, 0x00, 0x08, 0x08, 0x09, 0x08, 0xFA, 0x0F, 0x08, 0x08, 0x08, 0x08, // 204 - 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xFA, 0x0F, 0x09, 0x08, 0x08, 0x08, // 205 - 0x00, 0x00, 0x08, 0x08, 0x0A, 0x08, 0xF9, 0x0F, 0x0A, 0x08, 0x08, 0x08, // 206 - 0x00, 0x00, 0x08, 0x08, 0x0A, 0x08, 0xF8, 0x0F, 0x0A, 0x08, 0x08, 0x08, // 207 - 0x80, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 208 - 0x00, 0x00, 0xF8, 0x0F, 0x1B, 0x00, 0xE1, 0x00, 0x82, 0x03, 0x03, 0x0C, 0xF8, 0x0F, // 209 - 0x00, 0x00, 0xE0, 0x03, 0x19, 0x0C, 0x0A, 0x08, 0x08, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 210 - 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x0A, 0x08, 0x09, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 211 - 0x00, 0x00, 0xE0, 0x03, 0x1A, 0x0C, 0x09, 0x08, 0x09, 0x08, 0x1A, 0x0C, 0xE0, 0x03, // 212 - 0x00, 0x00, 0xE0, 0x03, 0x1B, 0x0C, 0x09, 0x08, 0x0A, 0x08, 0x1B, 0x0C, 0xE0, 0x03, // 213 - 0x00, 0x00, 0xE0, 0x03, 0x1A, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x1A, 0x0C, 0xE0, 0x03, // 214 - 0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 215 - 0x00, 0x08, 0xE0, 0x07, 0x18, 0x0E, 0x88, 0x09, 0x48, 0x08, 0x38, 0x0C, 0xF8, 0x03, // 216 - 0x00, 0x00, 0xF8, 0x07, 0x01, 0x08, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0xF8, 0x07, // 217 - 0x00, 0x00, 0xF8, 0x07, 0x00, 0x08, 0x02, 0x08, 0x01, 0x08, 0x00, 0x08, 0xF8, 0x07, // 218 - 0x00, 0x00, 0xF8, 0x07, 0x02, 0x08, 0x01, 0x08, 0x01, 0x08, 0x02, 0x08, 0xF8, 0x07, // 219 - 0x00, 0x00, 0xF8, 0x07, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0x02, 0x08, 0xF8, 0x07, // 220 - 0x08, 0x00, 0x10, 0x00, 0x60, 0x00, 0x82, 0x0F, 0x61, 0x00, 0x10, 0x00, 0x08, // 221 - 0x00, 0x00, 0xF8, 0x0F, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xE0, // 222 - 0x00, 0x00, 0xF8, 0x0F, 0xE4, 0x00, 0xA4, 0x09, 0x18, 0x09, 0x00, 0x06, // 223 - 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x24, 0x09, 0x28, 0x09, 0xC0, 0x0F, // 224 - 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x28, 0x09, 0x24, 0x09, 0xC0, 0x0F, // 225 - 0x00, 0x00, 0x40, 0x06, 0x28, 0x09, 0x24, 0x09, 0x24, 0x09, 0xC8, 0x0F, // 226 - 0x00, 0x00, 0x40, 0x06, 0x2C, 0x09, 0x24, 0x09, 0x28, 0x09, 0xCC, 0x0F, // 227 - 0x00, 0x00, 0x40, 0x06, 0x28, 0x09, 0x20, 0x09, 0x28, 0x09, 0xC0, 0x0F, // 228 - 0x00, 0x00, 0x40, 0x06, 0x26, 0x09, 0x29, 0x09, 0x29, 0x09, 0xC6, 0x0F, // 229 - 0x00, 0x00, 0x40, 0x0F, 0x20, 0x09, 0xC0, 0x07, 0x20, 0x09, 0xE0, 0x09, // 230 - 0x00, 0x00, 0xC0, 0x07, 0x60, 0x0C, 0x20, 0x28, 0x20, 0x28, 0x40, 0x38, // 231 - 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x24, 0x09, 0x28, 0x09, 0xC0, 0x05, // 232 - 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x28, 0x09, 0x24, 0x09, 0xC0, 0x05, // 233 - 0x00, 0x00, 0xC0, 0x07, 0x68, 0x09, 0x24, 0x09, 0x24, 0x09, 0xC8, 0x05, // 234 - 0x00, 0x00, 0xC0, 0x07, 0x68, 0x09, 0x20, 0x09, 0x28, 0x09, 0xC0, 0x05, // 235 - 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE4, 0x0F, 0x08, 0x08, 0x00, 0x08, // 236 - 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE8, 0x0F, 0x04, 0x08, 0x00, 0x08, // 237 - 0x00, 0x00, 0x28, 0x08, 0x24, 0x08, 0xE4, 0x0F, 0x08, 0x08, 0x00, 0x08, // 238 - 0x00, 0x00, 0x20, 0x08, 0x28, 0x08, 0xE0, 0x0F, 0x08, 0x08, 0x00, 0x08, // 239 - 0x00, 0x00, 0x80, 0x07, 0x54, 0x08, 0x58, 0x08, 0x68, 0x08, 0xC0, 0x07, // 240 - 0x00, 0x00, 0xE0, 0x0F, 0x4C, 0x00, 0x24, 0x00, 0x28, 0x00, 0xCC, 0x0F, // 241 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x24, 0x08, 0x28, 0x08, 0xC0, 0x07, // 242 - 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x28, 0x08, 0x24, 0x08, 0xC0, 0x07, // 243 - 0x00, 0x00, 0xC0, 0x07, 0x28, 0x08, 0x24, 0x08, 0x28, 0x08, 0xC0, 0x07, // 244 - 0x00, 0x00, 0xCC, 0x07, 0x24, 0x08, 0x2C, 0x08, 0x28, 0x08, 0xCC, 0x07, // 245 - 0x00, 0x00, 0xC0, 0x07, 0x28, 0x08, 0x20, 0x08, 0x28, 0x08, 0xC0, 0x07, // 246 - 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x40, 0x05, 0x00, 0x01, 0x00, 0x01, // 247 - 0x00, 0x00, 0xC0, 0x0F, 0x20, 0x0A, 0x20, 0x09, 0xA0, 0x08, 0xE0, 0x07, // 248 - 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x04, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 249 - 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x08, 0x08, 0x04, 0x08, 0xE0, 0x0F, // 250 - 0x00, 0x00, 0xE0, 0x07, 0x08, 0x08, 0x04, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 251 - 0x00, 0x00, 0xE0, 0x07, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 252 - 0x00, 0x00, 0x60, 0x40, 0x80, 0x67, 0x08, 0x1C, 0x84, 0x03, 0x60, // 253 - 0x00, 0x00, 0xFC, 0x7F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 254 - 0x00, 0x00, 0x60, 0x40, 0x88, 0x67, 0x00, 0x1C, 0x88, 0x03, 0x60 // 255 -}; - -#endif // ifndef DisplayUI_h +#ifndef DisplayUI_h +#define DisplayUI_h + +#include "language.h" +#include "A_config.h" +#include "Settings.h" +#include "Names.h" +#include "SSIDs.h" +#include "Scan.h" +#include "Attack.h" + +#include +#include +#include +#include +#include +#include + +#include + +using namespace simplebutton; + +extern Settings settings; +extern Names names; +extern SSIDs ssids; +extern Accesspoints accesspoints; +extern Stations stations; +extern Scan scan; +extern Attack attack; +extern uint32_t currentTime; + +extern String leftRight(String a, String b, int len); +extern String center(String a, int len); +extern String left(String a, int len); +extern String right(String a, int len); +extern String leftRight(String a, String b, int len); +extern String replaceUtf8(String str, String r); + +const char D_INTRO_0[] PROGMEM = ""; +const char D_INTRO_1[] PROGMEM = "ESP8266 Deauther"; +const char D_INTRO_2[] PROGMEM = "by @Spacehuhn"; +const char D_INTRO_3[] PROGMEM = DISPLAY_TEXT; + +struct MenuNode { + std::functiongetStr; // function used to create the displayed string + std::function click; // function that is executed when node is clicked + std::function hold; // function that is executed when node is pressed for > 800ms +}; + +struct Menu { + SimpleList*list; + Menu * parentMenu; + uint8_t selected; + std::function build; // function that is executed when button is clicked +}; + +class DisplayUI { + public: + enum DISPLAY_MODE { OFF = 0, BUTTON_TEST = 1, MENU = 2, LOADSCAN = 3, PACKETMONITOR = 4, INTRO = 5, CLOCK = 6 }; + + uint8_t mode = DISPLAY_MODE::MENU; + bool highlightLED = false; + + Button* up = NULL; + Button* down = NULL; + Button* a = NULL; + Button* b = NULL; + + // ===== adjustable ===== // +#if defined(SSD1306_I2C) + SSD1306Wire display = SSD1306Wire(I2C_ADDR, I2C_SDA, I2C_SCL); +#elif defined(SSD1306_SPI) + SSD1306Spi display = SSD1306Spi(SPI_RES, SPI_DC, SPI_CS); +#elif defined(SH1106_I2C) + SH1106Wire display = SH1106Wire(I2C_ADDR, I2C_SDA, I2C_SCL); +#elif defined(SH1106_SPI) + SH1106Spi display = SH1106Spi(SPI_RES, SPI_DC, SPI_CS); +#endif /* if defined(SSD1306_I2C) */ + + const uint8_t maxLen = 18; + const uint8_t lineHeight = 12; + const uint8_t buttonDelay = 250; + const uint8_t drawInterval = 100; // 100ms = 10 FPS + const uint16_t scrollSpeed = 500; // time interval in ms + const uint16_t screenIntroTime = 2500; + const uint16_t screenWidth = 128; + const uint16_t sreenHeight = 64; + + void configInit(); + void configOn(); + void configOff(); + void updatePrefix(); + void updateSuffix(); + void drawString(int x, int y, String str); + void drawString(int row, String str); + void drawLine(int x1, int y1, int x2, int y2); + // ====================== // + + DisplayUI(); + ~DisplayUI(); + + void setup(); +#ifdef HIGHLIGHT_LED + void setupLED(); +#endif // ifdef HIGHLIGHT_LED + + void update(); + void on(); + void off(); + + private: + int16_t selectedID = 0; // i.e. access point ID to draw the apMenu + uint8_t scrollCounter = 0; // for horizontal scrolling + + uint32_t scrollTime = 0; // last time a character was moved + uint32_t drawTime = 0; // last time a frame was drawn + uint32_t startTime = 0; // when the screen was enabled + uint32_t buttonTime = 0; // last time a button was pressed + + bool enabled = false; // display enabled + bool tempOff = false; + + // selected attack modes + bool beaconSelected = false; + bool deauthSelected = false; + bool probeSelected = false; + + // menus + Menu* currentMenu; + + Menu mainMenu; + + Menu scanMenu; + Menu showMenu; + Menu attackMenu; + + Menu apListMenu; + Menu stationListMenu; + Menu nameListMenu; + Menu ssidListMenu; + + Menu apMenu; + Menu stationMenu; + Menu nameMenu; + Menu ssidMenu; + + void setupButtons(); + + String getChannel(); + + // draw functions + void draw(); + void drawButtonTest(); + void drawMenu(); + void drawLoadingScan(); + void drawPacketMonitor(); + void drawIntro(); + void clearMenu(Menu* menu); + + // menu functions + void changeMenu(Menu* menu); + void goBack(); + void createMenu(Menu* menu, Menu* parent, std::functionbuild); + + void addMenuNode(Menu* menu, std::functiongetStr, std::functionclick, std::functionhold); + void addMenuNode(Menu* menu, std::functiongetStr, std::functionclick); + void addMenuNode(Menu* menu, std::functiongetStr, Menu* next); + void addMenuNode(Menu* menu, const char* ptr, std::functionclick); + void addMenuNode(Menu* menu, const char* ptr, Menu* next); + + // fake clock + void drawClock(); + void setTime(int h, int m, int s); + + int clockHour = 6; + int clockMinute = 0; + int clockSecond = 0; + + uint32_t clockTime = 0; +}; + +// ===== FONT ===== // +// Created by http://oleddisplay.squix.ch/ Consider a donation +// In case of problems make sure that you are using the font file with the correct version! +const uint8_t DejaVu_Sans_Mono_12[] PROGMEM = { + 0x07, // Width: 7 + 0x0F, // Height: 15 + 0x20, // First Char: 32 + 0xE0, // Numbers of Chars: 224 + + // Jump Table: + 0xFF, 0xFF, 0x00, 0x07, // 32:65535 + 0x00, 0x00, 0x08, 0x07, // 33:0 + 0x00, 0x08, 0x09, 0x07, // 34:8 + 0x00, 0x11, 0x0D, 0x07, // 35:17 + 0x00, 0x1E, 0x0C, 0x07, // 36:30 + 0x00, 0x2A, 0x0E, 0x07, // 37:42 + 0x00, 0x38, 0x0E, 0x07, // 38:56 + 0x00, 0x46, 0x07, 0x07, // 39:70 + 0x00, 0x4D, 0x0C, 0x07, // 40:77 + 0x00, 0x59, 0x0A, 0x07, // 41:89 + 0x00, 0x63, 0x0B, 0x07, // 42:99 + 0x00, 0x6E, 0x0E, 0x07, // 43:110 + 0x00, 0x7C, 0x08, 0x07, // 44:124 + 0x00, 0x84, 0x0A, 0x07, // 45:132 + 0x00, 0x8E, 0x08, 0x07, // 46:142 + 0x00, 0x96, 0x0D, 0x07, // 47:150 + 0x00, 0xA3, 0x0E, 0x07, // 48:163 + 0x00, 0xB1, 0x0C, 0x07, // 49:177 + 0x00, 0xBD, 0x0E, 0x07, // 50:189 + 0x00, 0xCB, 0x0E, 0x07, // 51:203 + 0x00, 0xD9, 0x0E, 0x07, // 52:217 + 0x00, 0xE7, 0x0E, 0x07, // 53:231 + 0x00, 0xF5, 0x0E, 0x07, // 54:245 + 0x01, 0x03, 0x0D, 0x07, // 55:259 + 0x01, 0x10, 0x0E, 0x07, // 56:272 + 0x01, 0x1E, 0x0E, 0x07, // 57:286 + 0x01, 0x2C, 0x08, 0x07, // 58:300 + 0x01, 0x34, 0x08, 0x07, // 59:308 + 0x01, 0x3C, 0x0E, 0x07, // 60:316 + 0x01, 0x4A, 0x0E, 0x07, // 61:330 + 0x01, 0x58, 0x0E, 0x07, // 62:344 + 0x01, 0x66, 0x0D, 0x07, // 63:358 + 0x01, 0x73, 0x0E, 0x07, // 64:371 + 0x01, 0x81, 0x0E, 0x07, // 65:385 + 0x01, 0x8F, 0x0E, 0x07, // 66:399 + 0x01, 0x9D, 0x0E, 0x07, // 67:413 + 0x01, 0xAB, 0x0E, 0x07, // 68:427 + 0x01, 0xB9, 0x0E, 0x07, // 69:441 + 0x01, 0xC7, 0x0D, 0x07, // 70:455 + 0x01, 0xD4, 0x0E, 0x07, // 71:468 + 0x01, 0xE2, 0x0E, 0x07, // 72:482 + 0x01, 0xF0, 0x0C, 0x07, // 73:496 + 0x01, 0xFC, 0x0C, 0x07, // 74:508 + 0x02, 0x08, 0x0E, 0x07, // 75:520 + 0x02, 0x16, 0x0E, 0x07, // 76:534 + 0x02, 0x24, 0x0E, 0x07, // 77:548 + 0x02, 0x32, 0x0E, 0x07, // 78:562 + 0x02, 0x40, 0x0E, 0x07, // 79:576 + 0x02, 0x4E, 0x0D, 0x07, // 80:590 + 0x02, 0x5B, 0x0E, 0x07, // 81:603 + 0x02, 0x69, 0x0E, 0x07, // 82:617 + 0x02, 0x77, 0x0E, 0x07, // 83:631 + 0x02, 0x85, 0x0D, 0x07, // 84:645 + 0x02, 0x92, 0x0E, 0x07, // 85:658 + 0x02, 0xA0, 0x0D, 0x07, // 86:672 + 0x02, 0xAD, 0x0E, 0x07, // 87:685 + 0x02, 0xBB, 0x0E, 0x07, // 88:699 + 0x02, 0xC9, 0x0D, 0x07, // 89:713 + 0x02, 0xD6, 0x0E, 0x07, // 90:726 + 0x02, 0xE4, 0x0A, 0x07, // 91:740 + 0x02, 0xEE, 0x0E, 0x07, // 92:750 + 0x02, 0xFC, 0x08, 0x07, // 93:764 + 0x03, 0x04, 0x0B, 0x07, // 94:772 + 0x03, 0x0F, 0x0E, 0x07, // 95:783 + 0x03, 0x1D, 0x09, 0x07, // 96:797 + 0x03, 0x26, 0x0C, 0x07, // 97:806 + 0x03, 0x32, 0x0C, 0x07, // 98:818 + 0x03, 0x3E, 0x0C, 0x07, // 99:830 + 0x03, 0x4A, 0x0C, 0x07, // 100:842 + 0x03, 0x56, 0x0C, 0x07, // 101:854 + 0x03, 0x62, 0x0B, 0x07, // 102:866 + 0x03, 0x6D, 0x0C, 0x07, // 103:877 + 0x03, 0x79, 0x0C, 0x07, // 104:889 + 0x03, 0x85, 0x0C, 0x07, // 105:901 + 0x03, 0x91, 0x0A, 0x07, // 106:913 + 0x03, 0x9B, 0x0C, 0x07, // 107:923 + 0x03, 0xA7, 0x0C, 0x07, // 108:935 + 0x03, 0xB3, 0x0C, 0x07, // 109:947 + 0x03, 0xBF, 0x0C, 0x07, // 110:959 + 0x03, 0xCB, 0x0C, 0x07, // 111:971 + 0x03, 0xD7, 0x0C, 0x07, // 112:983 + 0x03, 0xE3, 0x0C, 0x07, // 113:995 + 0x03, 0xEF, 0x0D, 0x07, // 114:1007 + 0x03, 0xFC, 0x0C, 0x07, // 115:1020 + 0x04, 0x08, 0x0C, 0x07, // 116:1032 + 0x04, 0x14, 0x0C, 0x07, // 117:1044 + 0x04, 0x20, 0x0B, 0x07, // 118:1056 + 0x04, 0x2B, 0x0D, 0x07, // 119:1067 + 0x04, 0x38, 0x0C, 0x07, // 120:1080 + 0x04, 0x44, 0x0B, 0x07, // 121:1092 + 0x04, 0x4F, 0x0C, 0x07, // 122:1103 + 0x04, 0x5B, 0x0C, 0x07, // 123:1115 + 0x04, 0x67, 0x08, 0x07, // 124:1127 + 0x04, 0x6F, 0x0B, 0x07, // 125:1135 + 0x04, 0x7A, 0x0E, 0x07, // 126:1146 + 0x04, 0x88, 0x0E, 0x07, // 127:1160 + 0x04, 0x96, 0x0E, 0x07, // 128:1174 + 0x04, 0xA4, 0x0E, 0x07, // 129:1188 + 0x04, 0xB2, 0x0E, 0x07, // 130:1202 + 0x04, 0xC0, 0x0E, 0x07, // 131:1216 + 0x04, 0xCE, 0x0E, 0x07, // 132:1230 + 0x04, 0xDC, 0x0E, 0x07, // 133:1244 + 0x04, 0xEA, 0x0E, 0x07, // 134:1258 + 0x04, 0xF8, 0x0E, 0x07, // 135:1272 + 0x05, 0x06, 0x0E, 0x07, // 136:1286 + 0x05, 0x14, 0x0E, 0x07, // 137:1300 + 0x05, 0x22, 0x0E, 0x07, // 138:1314 + 0x05, 0x30, 0x0E, 0x07, // 139:1328 + 0x05, 0x3E, 0x0E, 0x07, // 140:1342 + 0x05, 0x4C, 0x0E, 0x07, // 141:1356 + 0x05, 0x5A, 0x0E, 0x07, // 142:1370 + 0x05, 0x68, 0x0E, 0x07, // 143:1384 + 0x05, 0x76, 0x0E, 0x07, // 144:1398 + 0x05, 0x84, 0x0E, 0x07, // 145:1412 + 0x05, 0x92, 0x0E, 0x07, // 146:1426 + 0x05, 0xA0, 0x0E, 0x07, // 147:1440 + 0x05, 0xAE, 0x0E, 0x07, // 148:1454 + 0x05, 0xBC, 0x0E, 0x07, // 149:1468 + 0x05, 0xCA, 0x0E, 0x07, // 150:1482 + 0x05, 0xD8, 0x0E, 0x07, // 151:1496 + 0x05, 0xE6, 0x0E, 0x07, // 152:1510 + 0x05, 0xF4, 0x0E, 0x07, // 153:1524 + 0x06, 0x02, 0x0E, 0x07, // 154:1538 + 0x06, 0x10, 0x0E, 0x07, // 155:1552 + 0x06, 0x1E, 0x0E, 0x07, // 156:1566 + 0x06, 0x2C, 0x0E, 0x07, // 157:1580 + 0x06, 0x3A, 0x0E, 0x07, // 158:1594 + 0x06, 0x48, 0x0E, 0x07, // 159:1608 + 0xFF, 0xFF, 0x00, 0x07, // 160:65535 + 0x06, 0x56, 0x08, 0x07, // 161:1622 + 0x06, 0x5E, 0x0C, 0x07, // 162:1630 + 0x06, 0x6A, 0x0C, 0x07, // 163:1642 + 0x06, 0x76, 0x0E, 0x07, // 164:1654 + 0x06, 0x84, 0x0D, 0x07, // 165:1668 + 0x06, 0x91, 0x08, 0x07, // 166:1681 + 0x06, 0x99, 0x0C, 0x07, // 167:1689 + 0x06, 0xA5, 0x09, 0x07, // 168:1701 + 0x06, 0xAE, 0x0E, 0x07, // 169:1710 + 0x06, 0xBC, 0x0A, 0x07, // 170:1724 + 0x06, 0xC6, 0x0E, 0x07, // 171:1734 + 0x06, 0xD4, 0x0E, 0x07, // 172:1748 + 0x06, 0xE2, 0x0A, 0x07, // 173:1762 + 0x06, 0xEC, 0x0E, 0x07, // 174:1772 + 0x06, 0xFA, 0x0B, 0x07, // 175:1786 + 0x07, 0x05, 0x0B, 0x07, // 176:1797 + 0x07, 0x10, 0x0E, 0x07, // 177:1808 + 0x07, 0x1E, 0x09, 0x07, // 178:1822 + 0x07, 0x27, 0x0B, 0x07, // 179:1831 + 0x07, 0x32, 0x09, 0x07, // 180:1842 + 0x07, 0x3B, 0x0E, 0x07, // 181:1851 + 0x07, 0x49, 0x0E, 0x07, // 182:1865 + 0x07, 0x57, 0x08, 0x07, // 183:1879 + 0x07, 0x5F, 0x0A, 0x07, // 184:1887 + 0x07, 0x69, 0x09, 0x07, // 185:1897 + 0x07, 0x72, 0x0A, 0x07, // 186:1906 + 0x07, 0x7C, 0x0E, 0x07, // 187:1916 + 0x07, 0x8A, 0x0E, 0x07, // 188:1930 + 0x07, 0x98, 0x0C, 0x07, // 189:1944 + 0x07, 0xA4, 0x0E, 0x07, // 190:1956 + 0x07, 0xB2, 0x0A, 0x07, // 191:1970 + 0x07, 0xBC, 0x0E, 0x07, // 192:1980 + 0x07, 0xCA, 0x0E, 0x07, // 193:1994 + 0x07, 0xD8, 0x0E, 0x07, // 194:2008 + 0x07, 0xE6, 0x0E, 0x07, // 195:2022 + 0x07, 0xF4, 0x0E, 0x07, // 196:2036 + 0x08, 0x02, 0x0E, 0x07, // 197:2050 + 0x08, 0x10, 0x0E, 0x07, // 198:2064 + 0x08, 0x1E, 0x0E, 0x07, // 199:2078 + 0x08, 0x2C, 0x0E, 0x07, // 200:2092 + 0x08, 0x3A, 0x0E, 0x07, // 201:2106 + 0x08, 0x48, 0x0E, 0x07, // 202:2120 + 0x08, 0x56, 0x0E, 0x07, // 203:2134 + 0x08, 0x64, 0x0C, 0x07, // 204:2148 + 0x08, 0x70, 0x0C, 0x07, // 205:2160 + 0x08, 0x7C, 0x0C, 0x07, // 206:2172 + 0x08, 0x88, 0x0C, 0x07, // 207:2184 + 0x08, 0x94, 0x0E, 0x07, // 208:2196 + 0x08, 0xA2, 0x0E, 0x07, // 209:2210 + 0x08, 0xB0, 0x0E, 0x07, // 210:2224 + 0x08, 0xBE, 0x0E, 0x07, // 211:2238 + 0x08, 0xCC, 0x0E, 0x07, // 212:2252 + 0x08, 0xDA, 0x0E, 0x07, // 213:2266 + 0x08, 0xE8, 0x0E, 0x07, // 214:2280 + 0x08, 0xF6, 0x0C, 0x07, // 215:2294 + 0x09, 0x02, 0x0E, 0x07, // 216:2306 + 0x09, 0x10, 0x0E, 0x07, // 217:2320 + 0x09, 0x1E, 0x0E, 0x07, // 218:2334 + 0x09, 0x2C, 0x0E, 0x07, // 219:2348 + 0x09, 0x3A, 0x0E, 0x07, // 220:2362 + 0x09, 0x48, 0x0D, 0x07, // 221:2376 + 0x09, 0x55, 0x0D, 0x07, // 222:2389 + 0x09, 0x62, 0x0C, 0x07, // 223:2402 + 0x09, 0x6E, 0x0C, 0x07, // 224:2414 + 0x09, 0x7A, 0x0C, 0x07, // 225:2426 + 0x09, 0x86, 0x0C, 0x07, // 226:2438 + 0x09, 0x92, 0x0C, 0x07, // 227:2450 + 0x09, 0x9E, 0x0C, 0x07, // 228:2462 + 0x09, 0xAA, 0x0C, 0x07, // 229:2474 + 0x09, 0xB6, 0x0C, 0x07, // 230:2486 + 0x09, 0xC2, 0x0C, 0x07, // 231:2498 + 0x09, 0xCE, 0x0C, 0x07, // 232:2510 + 0x09, 0xDA, 0x0C, 0x07, // 233:2522 + 0x09, 0xE6, 0x0C, 0x07, // 234:2534 + 0x09, 0xF2, 0x0C, 0x07, // 235:2546 + 0x09, 0xFE, 0x0C, 0x07, // 236:2558 + 0x0A, 0x0A, 0x0C, 0x07, // 237:2570 + 0x0A, 0x16, 0x0C, 0x07, // 238:2582 + 0x0A, 0x22, 0x0C, 0x07, // 239:2594 + 0x0A, 0x2E, 0x0C, 0x07, // 240:2606 + 0x0A, 0x3A, 0x0C, 0x07, // 241:2618 + 0x0A, 0x46, 0x0C, 0x07, // 242:2630 + 0x0A, 0x52, 0x0C, 0x07, // 243:2642 + 0x0A, 0x5E, 0x0C, 0x07, // 244:2654 + 0x0A, 0x6A, 0x0C, 0x07, // 245:2666 + 0x0A, 0x76, 0x0C, 0x07, // 246:2678 + 0x0A, 0x82, 0x0C, 0x07, // 247:2690 + 0x0A, 0x8E, 0x0C, 0x07, // 248:2702 + 0x0A, 0x9A, 0x0C, 0x07, // 249:2714 + 0x0A, 0xA6, 0x0C, 0x07, // 250:2726 + 0x0A, 0xB2, 0x0C, 0x07, // 251:2738 + 0x0A, 0xBE, 0x0C, 0x07, // 252:2750 + 0x0A, 0xCA, 0x0B, 0x07, // 253:2762 + 0x0A, 0xD5, 0x0C, 0x07, // 254:2773 + 0x0A, 0xE1, 0x0B, 0x07, // 255:2785 + + // Font Data: + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x0D, // 33 + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, // 34 + 0x00, 0x02, 0x40, 0x0E, 0xE0, 0x03, 0x50, 0x0A, 0xC0, 0x07, 0x70, 0x02, 0x40, // 35 + 0x00, 0x00, 0xE0, 0x04, 0x90, 0x08, 0xF8, 0x3F, 0x10, 0x09, 0x20, 0x07, // 36 + 0x30, 0x00, 0x48, 0x01, 0x48, 0x01, 0xB0, 0x06, 0x80, 0x09, 0x40, 0x09, 0x00, 0x06, // 37 + 0x00, 0x00, 0x00, 0x07, 0xF0, 0x0C, 0xC8, 0x08, 0x08, 0x0B, 0x08, 0x06, 0x00, 0x0B, // 38 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // 39 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x1C, 0x1C, 0x04, 0x10, // 40 + 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x1C, 0x1C, 0xE0, 0x03, // 41 + 0x00, 0x00, 0x90, 0x00, 0x60, 0x00, 0xF8, 0x01, 0x60, 0x00, 0x90, // 42 + 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 43 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0C, // 44 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 45 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, // 46 + 0x00, 0x00, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x03, 0xC0, 0x00, 0x30, 0x00, 0x08, // 47 + 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x88, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 48 + 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x0F, 0x00, 0x08, 0x00, 0x08, // 49 + 0x00, 0x00, 0x10, 0x08, 0x08, 0x0C, 0x08, 0x0A, 0x08, 0x09, 0x88, 0x08, 0x70, 0x08, // 50 + 0x00, 0x00, 0x10, 0x04, 0x08, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 51 + 0x00, 0x00, 0x00, 0x03, 0xC0, 0x02, 0x60, 0x02, 0x18, 0x02, 0xF8, 0x0F, 0x00, 0x02, // 52 + 0x00, 0x00, 0x78, 0x04, 0x48, 0x08, 0x48, 0x08, 0x48, 0x08, 0xC8, 0x0C, 0x80, 0x07, // 53 + 0x00, 0x00, 0xE0, 0x03, 0x90, 0x0C, 0x48, 0x08, 0x48, 0x08, 0xC8, 0x0C, 0x90, 0x07, // 54 + 0x00, 0x00, 0x08, 0x00, 0x08, 0x08, 0x08, 0x06, 0x88, 0x01, 0x78, 0x00, 0x18, // 55 + 0x00, 0x00, 0x70, 0x07, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 56 + 0x00, 0x00, 0xF0, 0x04, 0x18, 0x09, 0x08, 0x09, 0x08, 0x09, 0x98, 0x04, 0xE0, 0x03, // 57 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, // 58 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xC0, 0x0C, // 59 + 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x20, 0x04, // 60 + 0x00, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, // 61 + 0x00, 0x00, 0x20, 0x04, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0x80, 0x01, // 62 + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x88, 0x0D, 0xC8, 0x00, 0x48, 0x00, 0x30, // 63 + 0x00, 0x00, 0xC0, 0x0F, 0x20, 0x18, 0x10, 0x23, 0x90, 0x24, 0xB0, 0x24, 0xE0, 0x07, // 64 + 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x03, 0x38, 0x02, 0x38, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 65 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x70, 0x07, // 66 + 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, // 67 + 0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 68 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, // 69 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, // 70 + 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, 0x08, 0x08, 0x88, 0x08, 0x90, 0x07, // 71 + 0x00, 0x00, 0xF8, 0x0F, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x0F, // 72 + 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x0F, 0x08, 0x08, 0x08, 0x08, // 73 + 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0xF8, 0x07, // 74 + 0x00, 0x00, 0xF8, 0x0F, 0x80, 0x00, 0xC0, 0x00, 0x20, 0x03, 0x10, 0x06, 0x08, 0x08, // 75 + 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 76 + 0x00, 0x00, 0xF8, 0x0F, 0x30, 0x00, 0xC0, 0x01, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x0F, // 77 + 0x00, 0x00, 0xF8, 0x0F, 0x18, 0x00, 0xE0, 0x00, 0x80, 0x03, 0x00, 0x0C, 0xF8, 0x0F, // 78 + 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 79 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, // 80 + 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x18, 0x3C, 0xE0, 0x07, // 81 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x01, 0x70, 0x06, // 82 + 0x00, 0x00, 0x70, 0x04, 0xC8, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, 0x10, 0x07, // 83 + 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0x08, 0x00, 0x08, // 84 + 0x00, 0x00, 0xF8, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xF8, 0x07, // 85 + 0x00, 0x00, 0x18, 0x00, 0xE0, 0x01, 0x00, 0x0E, 0x00, 0x0E, 0xE0, 0x01, 0x18, // 86 + 0xF8, 0x01, 0x00, 0x0E, 0xC0, 0x03, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0E, 0xF8, 0x01, // 87 + 0x00, 0x00, 0x08, 0x08, 0x30, 0x06, 0xC0, 0x01, 0xC0, 0x01, 0x30, 0x06, 0x08, 0x08, // 88 + 0x08, 0x00, 0x10, 0x00, 0x60, 0x00, 0x80, 0x0F, 0x60, 0x00, 0x10, 0x00, 0x08, // 89 + 0x00, 0x00, 0x08, 0x0C, 0x08, 0x0E, 0x88, 0x09, 0xC8, 0x08, 0x38, 0x08, 0x18, 0x08, // 90 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x1F, 0x04, 0x10, // 91 + 0x00, 0x00, 0x08, 0x00, 0x30, 0x00, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x10, // 92 + 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0xFC, 0x1F, // 93 + 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, // 94 + 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, // 95 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, // 96 + 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x20, 0x09, 0x20, 0x09, 0xC0, 0x0F, // 97 + 0x00, 0x00, 0xFC, 0x0F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 98 + 0x00, 0x00, 0xC0, 0x07, 0x60, 0x0C, 0x20, 0x08, 0x20, 0x08, 0x40, 0x08, // 99 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xFC, 0x0F, // 100 + 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x20, 0x09, 0x20, 0x09, 0xC0, 0x05, // 101 + 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x0F, 0x24, 0x00, 0x24, // 102 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x28, 0x20, 0x48, 0x20, 0x48, 0xE0, 0x3F, // 103 + 0x00, 0x00, 0xFC, 0x0F, 0x40, 0x00, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x0F, // 104 + 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE4, 0x0F, 0x00, 0x08, 0x00, 0x08, // 105 + 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x20, 0x40, 0xE4, 0x3F, // 106 + 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, // 107 + 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0xFC, 0x07, 0x00, 0x08, 0x00, 0x08, // 108 + 0x00, 0x00, 0xE0, 0x0F, 0x20, 0x00, 0xE0, 0x0F, 0x20, 0x00, 0xE0, 0x0F, // 109 + 0x00, 0x00, 0xE0, 0x0F, 0x40, 0x00, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x0F, // 110 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 111 + 0x00, 0x00, 0xE0, 0x7F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 112 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xE0, 0x7F, // 113 + 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x40, // 114 + 0x00, 0x00, 0xC0, 0x04, 0x20, 0x09, 0x20, 0x09, 0x20, 0x09, 0x40, 0x06, // 115 + 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x0F, 0x20, 0x08, 0x20, 0x08, // 116 + 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xE0, 0x0F, // 117 + 0x00, 0x00, 0x60, 0x00, 0x80, 0x03, 0x00, 0x0C, 0x80, 0x03, 0x60, // 118 + 0x60, 0x00, 0x80, 0x03, 0x00, 0x0E, 0x80, 0x01, 0x00, 0x0E, 0x80, 0x03, 0x60, // 119 + 0x00, 0x00, 0x20, 0x08, 0xC0, 0x06, 0x00, 0x01, 0xC0, 0x06, 0x20, 0x08, // 120 + 0x00, 0x00, 0x60, 0x40, 0x80, 0x67, 0x00, 0x1C, 0x80, 0x03, 0x60, // 121 + 0x00, 0x00, 0x20, 0x0C, 0x20, 0x0A, 0x20, 0x09, 0xA0, 0x08, 0x60, 0x08, // 122 + 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7C, 0x1F, 0x04, 0x10, 0x04, 0x10, // 123 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, // 124 + 0x00, 0x00, 0x04, 0x10, 0x04, 0x10, 0x7C, 0x1F, 0x80, 0x00, 0x80, // 125 + 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 126 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 127 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 128 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 129 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 130 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 131 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 132 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 133 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 134 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 135 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 136 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 137 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 138 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 139 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 140 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 141 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 142 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 143 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 144 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 145 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 146 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 147 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 148 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 149 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 150 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 151 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 152 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 153 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 154 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 155 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 156 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 157 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 158 + 0x00, 0x00, 0xF0, 0x7F, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0xF0, 0x7F, // 159 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3F, // 161 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0xF8, 0x3F, 0x20, 0x08, 0x40, 0x04, // 162 + 0x00, 0x00, 0x80, 0x08, 0xF0, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x08, 0x08, // 163 + 0x00, 0x00, 0x20, 0x04, 0xC0, 0x03, 0x40, 0x02, 0x40, 0x02, 0xC0, 0x03, 0x20, 0x04, // 164 + 0x08, 0x00, 0x50, 0x01, 0x60, 0x01, 0x80, 0x0F, 0x60, 0x01, 0x50, 0x01, 0x08, // 165 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3C, // 166 + 0x00, 0x00, 0xF0, 0x11, 0x28, 0x13, 0x48, 0x12, 0xC8, 0x14, 0x88, 0x0F, // 167 + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, // 168 + 0xC0, 0x01, 0x20, 0x02, 0xD0, 0x05, 0x50, 0x05, 0x50, 0x05, 0x20, 0x02, 0xC0, 0x01, // 169 + 0x00, 0x00, 0xE8, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0xF0, 0x02, // 170 + 0x00, 0x00, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, // 171 + 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x03, // 172 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 173 + 0xC0, 0x01, 0x20, 0x02, 0xD0, 0x05, 0xD0, 0x05, 0xD0, 0x05, 0x20, 0x02, 0xC0, 0x01, // 174 + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 175 + 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 176 + 0x80, 0x08, 0x80, 0x08, 0x80, 0x08, 0xE0, 0x0B, 0x80, 0x08, 0x80, 0x08, 0x80, 0x08, // 177 + 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xE8, 0x00, 0xB8, // 178 + 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xD8, // 179 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, // 180 + 0x00, 0x00, 0xE0, 0x7F, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xE0, 0x0F, 0x00, 0x08, // 181 + 0x00, 0x00, 0x70, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0xF8, 0x1F, 0x08, 0x00, 0xF8, 0x1F, // 182 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, // 183 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x30, // 184 + 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0xF8, 0x00, 0x80, // 185 + 0x00, 0x00, 0x70, 0x02, 0x88, 0x02, 0x88, 0x02, 0x70, 0x02, // 186 + 0x00, 0x00, 0x40, 0x04, 0x80, 0x02, 0x00, 0x01, 0x40, 0x04, 0x80, 0x02, 0x00, 0x01, // 187 + 0x44, 0x02, 0x7C, 0x03, 0x40, 0x01, 0x00, 0x0D, 0x80, 0x0B, 0x80, 0x1F, 0x00, 0x08, // 188 + 0x44, 0x02, 0x7C, 0x03, 0x40, 0x01, 0x00, 0x11, 0x80, 0x1D, 0x80, 0x17, // 189 + 0x00, 0x02, 0x44, 0x03, 0x54, 0x01, 0x54, 0x0D, 0xEC, 0x0B, 0x80, 0x1F, 0x00, 0x08, // 190 + 0x00, 0x38, 0x00, 0x4C, 0x00, 0x44, 0x60, 0x43, 0x00, 0x20, // 191 + 0x00, 0x00, 0x00, 0x0C, 0xC1, 0x03, 0x3A, 0x02, 0x38, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 192 + 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x03, 0x3A, 0x02, 0x39, 0x02, 0xC0, 0x03, 0x00, 0x0C, // 193 + 0x00, 0x00, 0x00, 0x0C, 0xC2, 0x03, 0x39, 0x02, 0x39, 0x02, 0xC2, 0x03, 0x00, 0x0C, // 194 + 0x00, 0x00, 0x00, 0x0C, 0xC3, 0x03, 0x39, 0x02, 0x3A, 0x02, 0xC3, 0x03, 0x00, 0x0C, // 195 + 0x00, 0x00, 0x00, 0x0C, 0xC2, 0x03, 0x38, 0x02, 0x38, 0x02, 0xC2, 0x03, 0x00, 0x0C, // 196 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xFE, 0x02, 0xE6, 0x02, 0x00, 0x07, 0x00, 0x08, // 197 + 0x00, 0x0C, 0x80, 0x03, 0x78, 0x02, 0x08, 0x02, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, // 198 + 0x00, 0x00, 0xE0, 0x03, 0x10, 0x04, 0x08, 0x28, 0x08, 0x28, 0x08, 0x38, 0x10, 0x04, // 199 + 0x00, 0x00, 0xF8, 0x0F, 0x89, 0x08, 0x8A, 0x08, 0x88, 0x08, 0x88, 0x08, 0x88, 0x08, // 200 + 0x00, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x8A, 0x08, 0x89, 0x08, 0x88, 0x08, 0x88, 0x08, // 201 + 0x00, 0x00, 0xF8, 0x0F, 0x8A, 0x08, 0x89, 0x08, 0x89, 0x08, 0x8A, 0x08, 0x88, 0x08, // 202 + 0x00, 0x00, 0xF8, 0x0F, 0x8A, 0x08, 0x88, 0x08, 0x8A, 0x08, 0x88, 0x08, 0x88, 0x08, // 203 + 0x00, 0x00, 0x08, 0x08, 0x09, 0x08, 0xFA, 0x0F, 0x08, 0x08, 0x08, 0x08, // 204 + 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xFA, 0x0F, 0x09, 0x08, 0x08, 0x08, // 205 + 0x00, 0x00, 0x08, 0x08, 0x0A, 0x08, 0xF9, 0x0F, 0x0A, 0x08, 0x08, 0x08, // 206 + 0x00, 0x00, 0x08, 0x08, 0x0A, 0x08, 0xF8, 0x0F, 0x0A, 0x08, 0x08, 0x08, // 207 + 0x80, 0x00, 0xF8, 0x0F, 0x88, 0x08, 0x88, 0x08, 0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 208 + 0x00, 0x00, 0xF8, 0x0F, 0x1B, 0x00, 0xE1, 0x00, 0x82, 0x03, 0x03, 0x0C, 0xF8, 0x0F, // 209 + 0x00, 0x00, 0xE0, 0x03, 0x19, 0x0C, 0x0A, 0x08, 0x08, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 210 + 0x00, 0x00, 0xE0, 0x03, 0x18, 0x0C, 0x0A, 0x08, 0x09, 0x08, 0x18, 0x0C, 0xE0, 0x03, // 211 + 0x00, 0x00, 0xE0, 0x03, 0x1A, 0x0C, 0x09, 0x08, 0x09, 0x08, 0x1A, 0x0C, 0xE0, 0x03, // 212 + 0x00, 0x00, 0xE0, 0x03, 0x1B, 0x0C, 0x09, 0x08, 0x0A, 0x08, 0x1B, 0x0C, 0xE0, 0x03, // 213 + 0x00, 0x00, 0xE0, 0x03, 0x1A, 0x0C, 0x08, 0x08, 0x08, 0x08, 0x1A, 0x0C, 0xE0, 0x03, // 214 + 0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 215 + 0x00, 0x08, 0xE0, 0x07, 0x18, 0x0E, 0x88, 0x09, 0x48, 0x08, 0x38, 0x0C, 0xF8, 0x03, // 216 + 0x00, 0x00, 0xF8, 0x07, 0x01, 0x08, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0xF8, 0x07, // 217 + 0x00, 0x00, 0xF8, 0x07, 0x00, 0x08, 0x02, 0x08, 0x01, 0x08, 0x00, 0x08, 0xF8, 0x07, // 218 + 0x00, 0x00, 0xF8, 0x07, 0x02, 0x08, 0x01, 0x08, 0x01, 0x08, 0x02, 0x08, 0xF8, 0x07, // 219 + 0x00, 0x00, 0xF8, 0x07, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0x02, 0x08, 0xF8, 0x07, // 220 + 0x08, 0x00, 0x10, 0x00, 0x60, 0x00, 0x82, 0x0F, 0x61, 0x00, 0x10, 0x00, 0x08, // 221 + 0x00, 0x00, 0xF8, 0x0F, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xE0, // 222 + 0x00, 0x00, 0xF8, 0x0F, 0xE4, 0x00, 0xA4, 0x09, 0x18, 0x09, 0x00, 0x06, // 223 + 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x24, 0x09, 0x28, 0x09, 0xC0, 0x0F, // 224 + 0x00, 0x00, 0x40, 0x06, 0x20, 0x09, 0x28, 0x09, 0x24, 0x09, 0xC0, 0x0F, // 225 + 0x00, 0x00, 0x40, 0x06, 0x28, 0x09, 0x24, 0x09, 0x24, 0x09, 0xC8, 0x0F, // 226 + 0x00, 0x00, 0x40, 0x06, 0x2C, 0x09, 0x24, 0x09, 0x28, 0x09, 0xCC, 0x0F, // 227 + 0x00, 0x00, 0x40, 0x06, 0x28, 0x09, 0x20, 0x09, 0x28, 0x09, 0xC0, 0x0F, // 228 + 0x00, 0x00, 0x40, 0x06, 0x26, 0x09, 0x29, 0x09, 0x29, 0x09, 0xC6, 0x0F, // 229 + 0x00, 0x00, 0x40, 0x0F, 0x20, 0x09, 0xC0, 0x07, 0x20, 0x09, 0xE0, 0x09, // 230 + 0x00, 0x00, 0xC0, 0x07, 0x60, 0x0C, 0x20, 0x28, 0x20, 0x28, 0x40, 0x38, // 231 + 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x24, 0x09, 0x28, 0x09, 0xC0, 0x05, // 232 + 0x00, 0x00, 0xC0, 0x07, 0x60, 0x09, 0x28, 0x09, 0x24, 0x09, 0xC0, 0x05, // 233 + 0x00, 0x00, 0xC0, 0x07, 0x68, 0x09, 0x24, 0x09, 0x24, 0x09, 0xC8, 0x05, // 234 + 0x00, 0x00, 0xC0, 0x07, 0x68, 0x09, 0x20, 0x09, 0x28, 0x09, 0xC0, 0x05, // 235 + 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE4, 0x0F, 0x08, 0x08, 0x00, 0x08, // 236 + 0x00, 0x00, 0x20, 0x08, 0x20, 0x08, 0xE8, 0x0F, 0x04, 0x08, 0x00, 0x08, // 237 + 0x00, 0x00, 0x28, 0x08, 0x24, 0x08, 0xE4, 0x0F, 0x08, 0x08, 0x00, 0x08, // 238 + 0x00, 0x00, 0x20, 0x08, 0x28, 0x08, 0xE0, 0x0F, 0x08, 0x08, 0x00, 0x08, // 239 + 0x00, 0x00, 0x80, 0x07, 0x54, 0x08, 0x58, 0x08, 0x68, 0x08, 0xC0, 0x07, // 240 + 0x00, 0x00, 0xE0, 0x0F, 0x4C, 0x00, 0x24, 0x00, 0x28, 0x00, 0xCC, 0x0F, // 241 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x24, 0x08, 0x28, 0x08, 0xC0, 0x07, // 242 + 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x28, 0x08, 0x24, 0x08, 0xC0, 0x07, // 243 + 0x00, 0x00, 0xC0, 0x07, 0x28, 0x08, 0x24, 0x08, 0x28, 0x08, 0xC0, 0x07, // 244 + 0x00, 0x00, 0xCC, 0x07, 0x24, 0x08, 0x2C, 0x08, 0x28, 0x08, 0xCC, 0x07, // 245 + 0x00, 0x00, 0xC0, 0x07, 0x28, 0x08, 0x20, 0x08, 0x28, 0x08, 0xC0, 0x07, // 246 + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x40, 0x05, 0x00, 0x01, 0x00, 0x01, // 247 + 0x00, 0x00, 0xC0, 0x0F, 0x20, 0x0A, 0x20, 0x09, 0xA0, 0x08, 0xE0, 0x07, // 248 + 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x04, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 249 + 0x00, 0x00, 0xE0, 0x07, 0x00, 0x08, 0x08, 0x08, 0x04, 0x08, 0xE0, 0x0F, // 250 + 0x00, 0x00, 0xE0, 0x07, 0x08, 0x08, 0x04, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 251 + 0x00, 0x00, 0xE0, 0x07, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0xE0, 0x0F, // 252 + 0x00, 0x00, 0x60, 0x40, 0x80, 0x67, 0x08, 0x1C, 0x84, 0x03, 0x60, // 253 + 0x00, 0x00, 0xFC, 0x7F, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0xC0, 0x07, // 254 + 0x00, 0x00, 0x60, 0x40, 0x88, 0x67, 0x00, 0x1C, 0x88, 0x03, 0x60 // 255 +}; + +#endif // ifndef DisplayUI_h \ No newline at end of file diff --git a/esp8266_deauther/LED.h b/esp8266_deauther/LED.h index fb058c7..2e498bd 100644 --- a/esp8266_deauther/LED.h +++ b/esp8266_deauther/LED.h @@ -26,21 +26,21 @@ class LED { uint8_t brightness = 100; -#if defined(NEOPIXEL_LED) - Adafruit_NeoPixel strip(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, LED_NEOPIXEL_MODE); +#if defined(LED_NEOPIXEL_RGB) + Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_RGB + NEO_KHZ400); +#elif defined(LED_NEOPIXEL_GRB) + Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ400); #elif defined(MY92) - my92xx myled(MY92_MODEL, MY92_NUM, MY92_DATA, MY92_CLK, MY92XX_COMMAND_DEFAULT); + my92xx myled = my92xx(MY92_MODEL, MY92_NUM, MY92_DATA, MY92_CLK, MY92XX_COMMAND_DEFAULT); #endif // if defined(NEOPIXEL_LED) public: void setup() { analogWriteRange(0xff); -#if defined(LED_MODE_BRIGHTNESS) brightness = LED_MODE_BRIGHTNESS; -#endif // if defined(LED_MODE_BRIGHTNESS) -#if defined(DIGITAL_LED) || defined(RGB_LED) +#if defined(LED_DIGITAL) || defined(LED_RGB) if (LED_PIN_R < 255) pinMode(LED_PIN_R, OUTPUT); if (LED_PIN_G < 255) pinMode(LED_PIN_G, OUTPUT); if (LED_PIN_B < 255) pinMode(LED_PIN_B, OUTPUT); @@ -56,7 +56,7 @@ class LED { myled->setChannel(3, 100); myled.setState(true); myled.update(); -#endif // if defined(DIGITAL_LED) || defined(RGB_LED) +#endif // if defined(LED_DIGITAL) || defined(LED_RGB) } void update(); @@ -74,7 +74,7 @@ class LED { void setColor(uint8_t r, uint8_t g, uint8_t b, bool output = false) { if (output) printColor(r, g, b); -#if defined(DIGITAL_LED) +#if defined(LED_DIGITAL) if (LED_ANODE) { if (LED_PIN_R < 255) digitalWrite(LED_PIN_R, r > 0); if (LED_PIN_G < 255) digitalWrite(LED_PIN_G, g > 0); @@ -84,7 +84,7 @@ class LED { if (LED_PIN_G < 255) digitalWrite(LED_PIN_G, g == 0); if (LED_PIN_B < 255) digitalWrite(LED_PIN_B, b == 0); } -#elif defined(RGB_LED) +#elif defined(LED_RGB) if ((r > 0) && (brightness > 0)) r = r * brightness / 100; if ((g > 0) && (brightness > 0)) g = g * brightness / 100; if ((b > 0) && (brightness > 0)) b = b * brightness / 100; @@ -99,9 +99,6 @@ class LED { analogWrite(LED_PIN_G, g); analogWrite(LED_PIN_B, b); #elif defined(NEOPIXEL_LED) - if ((r > 0) && (brightness > 0)) r = r * brightness / 100; - if ((g > 0) && (brightness > 0)) g = g * brightness / 100; - if ((b > 0) && (brightness > 0)) b = b * brightness / 100; for (size_t i = 0; i < LED_NEOPIXEL_NUM; i++) { strip.setPixelColor(i, r, g, b); @@ -115,7 +112,7 @@ class LED { myled->setChannel(MY92_CH_BRIGHTNESS, brightness); myled->setState(true); myled->update(); -#endif // if defined(DIGITAL_LED) +#endif // if defined(LED_DIGITAL) } void tempEnable(); diff --git a/esp8266_deauther/Settings.h b/esp8266_deauther/Settings.h index 20340a9..fcec45c 100644 --- a/esp8266_deauther/Settings.h +++ b/esp8266_deauther/Settings.h @@ -1,139 +1,139 @@ -#ifndef Settings_h -#define Settings_h - -#include "Arduino.h" -#include -extern "C" { - #include "user_interface.h" -} -#include "ArduinoJson.h" -#include "language.h" -#include "A_config.h" - -#define VERSION "v2.1.0" - -extern void checkFile(String path, String data); -extern JsonVariant parseJSONFile(String path, DynamicJsonBuffer& jsonBuffer); -extern bool writeFile(String path, String& buf); -extern void saveJSONFile(String path, JsonObject& root); -extern String macToStr(uint8_t* mac); -extern void getRandomMac(uint8_t* mac); -extern bool strToMac(String macStr, uint8_t* mac); -extern void setWifiChannel(uint8_t ch); -extern String fixUtf8(String str); -extern void copyWebFiles(bool force); -extern bool macValid(uint8_t* mac); - -class Settings { - public: - Settings(); - void load(); - void load(String filepath); - void save(bool force); - void save(bool force, String filepath); - void reset(); - void print(); - - void set(const char* str, String value); - String get(const char* str); - - String getVersion(); - uint16_t getDeauthsPerTarget(); - uint8_t getDeauthReason(); - bool getBeaconChannel(); - uint8_t getForcePackets(); - bool getAutosave(); - uint32_t getAutosaveTime(); - bool getBeaconInterval(); - uint8_t getChannel(); - String getSSID(); - String getPassword(); - bool getCLI(); - bool getDisplayInterface(); - bool getWebInterface(); - uint16_t getChTime(); - uint8_t* getMacSt(); - uint8_t* getMacAP(); - bool getRandomTX(); - uint32_t getAttackTimeout(); - bool getLedEnabled(); - uint8_t getProbesPerSSID(); - bool getHidden(); - bool getCaptivePortal(); - uint16_t getMinDeauths(); - uint32_t getDisplayTimeout(); - String getLang(); - bool getSerialEcho(); - bool getWebSpiffs(); - - void setDeauthsPerTarget(uint16_t deauthsPerTarget); - void setDeauthReason(uint8_t deauthReason); - void setBeaconChannel(bool beaconChannel); - void setForcePackets(uint8_t forcePackets); - void setAutosave(bool autosave); - void setAutosaveTime(uint32_t autosaveTime); - void setBeaconInterval(bool beaconInterval); - void setChannel(uint8_t channel); - void setSSID(String ssid); - void setPassword(String password); - void setCLI(bool cli); - void setDisplayInterface(bool displayInterface); - void setWebInterface(bool webInterface); - void setChTime(uint16_t chTime); - void setMacSt(String macStr); - bool setMacSt(uint8_t* macSt); - void setMacAP(String macStr); - bool setMacAP(uint8_t* macAP); - void setRandomTX(bool randomTX); - void setAttackTimeout(uint32_t attackTimeout); - void setLedEnabled(bool ledEnabled); - void setProbesPerSSID(uint8_t probesPerSSID); - void setHidden(bool hidden); - void setCaptivePortal(bool captivePortal); - void setMinDeauths(uint16_t minDeauths); - void setDisplayTimeout(uint32_t displayTimeout); - void setLang(String lang); - void setSerialEcho(bool serialEcho); - void setWebSpiffs(bool webSpiffs); - - private: - bool changed = false; - - String version = VERSION; - - bool beaconChannel = false; - bool autosave = true; - bool beaconInterval = false; - bool cli = true; - bool displayInterface = USE_DISPLAY; - bool webInterface = true; - bool webSpiffs = false; - bool randomTX = false; - bool ledEnabled = true; - bool serialEcho = true; - - uint32_t attackTimeout = 600; - uint32_t autosaveTime = 10000; - uint32_t displayTimeout = 600; - uint16_t deauthsPerTarget = 20; - uint16_t chTime = 384; - uint16_t minDeauths = 3; - uint8_t forcePackets = 1; - uint8_t channel = 9; - uint8_t deauthReason = 1; - uint8_t* macSt; - uint8_t* macAP; - uint8_t probesPerSSID = 1; - - String ssid = "pwned"; - String password = "deauther"; - bool hidden = false; - bool captivePortal = true; - String lang = "en"; - - String FILE_PATH = "/settings.json"; - - String getJsonStr(); -}; - -#endif // ifndef Settings_h +#ifndef Settings_h +#define Settings_h + +#include "Arduino.h" +#include +extern "C" { + #include "user_interface.h" +} +#include "ArduinoJson.h" +#include "language.h" +#include "A_config.h" + +#define VERSION "v2.2.0" + +extern void checkFile(String path, String data); +extern JsonVariant parseJSONFile(String path, DynamicJsonBuffer& jsonBuffer); +extern bool writeFile(String path, String& buf); +extern void saveJSONFile(String path, JsonObject& root); +extern String macToStr(uint8_t* mac); +extern void getRandomMac(uint8_t* mac); +extern bool strToMac(String macStr, uint8_t* mac); +extern void setWifiChannel(uint8_t ch); +extern String fixUtf8(String str); +extern void copyWebFiles(bool force); +extern bool macValid(uint8_t* mac); + +class Settings { + public: + Settings(); + void load(); + void load(String filepath); + void save(bool force); + void save(bool force, String filepath); + void reset(); + void print(); + + void set(const char* str, String value); + String get(const char* str); + + String getVersion(); + uint16_t getDeauthsPerTarget(); + uint8_t getDeauthReason(); + bool getBeaconChannel(); + uint8_t getForcePackets(); + bool getAutosave(); + uint32_t getAutosaveTime(); + bool getBeaconInterval(); + uint8_t getChannel(); + String getSSID(); + String getPassword(); + bool getCLI(); + bool getDisplayInterface(); + bool getWebInterface(); + uint16_t getChTime(); + uint8_t* getMacSt(); + uint8_t* getMacAP(); + bool getRandomTX(); + uint32_t getAttackTimeout(); + bool getLedEnabled(); + uint8_t getProbesPerSSID(); + bool getHidden(); + bool getCaptivePortal(); + uint16_t getMinDeauths(); + uint32_t getDisplayTimeout(); + String getLang(); + bool getSerialEcho(); + bool getWebSpiffs(); + + void setDeauthsPerTarget(uint16_t deauthsPerTarget); + void setDeauthReason(uint8_t deauthReason); + void setBeaconChannel(bool beaconChannel); + void setForcePackets(uint8_t forcePackets); + void setAutosave(bool autosave); + void setAutosaveTime(uint32_t autosaveTime); + void setBeaconInterval(bool beaconInterval); + void setChannel(uint8_t channel); + void setSSID(String ssid); + void setPassword(String password); + void setCLI(bool cli); + void setDisplayInterface(bool displayInterface); + void setWebInterface(bool webInterface); + void setChTime(uint16_t chTime); + void setMacSt(String macStr); + bool setMacSt(uint8_t* macSt); + void setMacAP(String macStr); + bool setMacAP(uint8_t* macAP); + void setRandomTX(bool randomTX); + void setAttackTimeout(uint32_t attackTimeout); + void setLedEnabled(bool ledEnabled); + void setProbesPerSSID(uint8_t probesPerSSID); + void setHidden(bool hidden); + void setCaptivePortal(bool captivePortal); + void setMinDeauths(uint16_t minDeauths); + void setDisplayTimeout(uint32_t displayTimeout); + void setLang(String lang); + void setSerialEcho(bool serialEcho); + void setWebSpiffs(bool webSpiffs); + + private: + bool changed = false; + + String version = VERSION; + + bool beaconChannel = false; + bool autosave = true; + bool beaconInterval = false; + bool cli = true; + bool displayInterface = USE_DISPLAY; + bool webInterface = true; + bool webSpiffs = false; + bool randomTX = false; + bool ledEnabled = true; + bool serialEcho = true; + + uint32_t attackTimeout = 600; + uint32_t autosaveTime = 10000; + uint32_t displayTimeout = 600; + uint16_t deauthsPerTarget = 20; + uint16_t chTime = 384; + uint16_t minDeauths = 3; + uint8_t forcePackets = 1; + uint8_t channel = 9; + uint8_t deauthReason = 1; + uint8_t* macSt; + uint8_t* macAP; + uint8_t probesPerSSID = 1; + + String ssid = "pwned"; + String password = "deauther"; + bool hidden = false; + bool captivePortal = true; + String lang = "en"; + + String FILE_PATH = "/settings.json"; + + String getJsonStr(); +}; + +#endif // ifndef Settings_h \ No newline at end of file