mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-22 23:26:45 -08:00
Fix status bar
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#define jquery_min_js_v3_2_1_gz_len 30178
|
#define jquery_min_js_v3_2_1_gz_len 30178
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PROGMEM static const unsigned char menu_icons[][66] = {
|
PROGMEM static const unsigned char menu_icons[][66] = {
|
||||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, 0x3A, // Attack: 0
|
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, 0x3A, // Attack: 0
|
||||||
0xFF, 0xFF, 0x39, 0xFF, 0xBF, 0x3C, 0xFF, 0x7F, 0x3E, 0xFF, 0x2F, 0x3F,
|
0xFF, 0xFF, 0x39, 0xFF, 0xBF, 0x3C, 0xFF, 0x7F, 0x3E, 0xFF, 0x2F, 0x3F,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class BatteryInterface {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int8_t battery_level = 0;
|
int8_t battery_level = 0;
|
||||||
|
int8_t old_level = 0;
|
||||||
bool i2c_supported = false;
|
bool i2c_supported = false;
|
||||||
|
|
||||||
BatteryInterface();
|
BatteryInterface();
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ void Display::twoPartDisplay(String center_text)
|
|||||||
void Display::touchToExit()
|
void Display::touchToExit()
|
||||||
{
|
{
|
||||||
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
|
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
|
||||||
tft.fillRect(0,16,HEIGHT_1,16, TFT_LIGHTGREY);
|
tft.fillRect(0,32,HEIGHT_1,16, TFT_LIGHTGREY);
|
||||||
tft.drawCentreString("Touch screen to exit",120,16,2);
|
tft.drawCentreString("Touch screen to exit",120,32,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -259,6 +259,7 @@ void Display::displayBuffer(bool do_clear)
|
|||||||
delay(print_delay_1);
|
delay(print_delay_1);
|
||||||
yDraw = scroll_line(TFT_RED);
|
yDraw = scroll_line(TFT_RED);
|
||||||
tft.setCursor(xPos, yDraw);
|
tft.setCursor(xPos, yDraw);
|
||||||
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.print(display_buffer->shift());
|
tft.print(display_buffer->shift());
|
||||||
printing = false;
|
printing = false;
|
||||||
delay(print_delay_2);
|
delay(print_delay_2);
|
||||||
@@ -336,7 +337,10 @@ int Display::scroll_line(uint32_t color) {
|
|||||||
|
|
||||||
// Function to setup hardware scroll for TFT screen
|
// Function to setup hardware scroll for TFT screen
|
||||||
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
||||||
Serial.println("setupScrollAread()");
|
Serial.println("setupScrollArea()");
|
||||||
|
Serial.println(" tfa: " + (String)tfa);
|
||||||
|
Serial.println(" bfa: " + (String)bfa);
|
||||||
|
Serial.println("yStart: " + (String)this->yStart);
|
||||||
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
|
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
|
||||||
tft.writedata(tfa >> 8); // Top Fixed Area line count
|
tft.writedata(tfa >> 8); // Top Fixed Area line count
|
||||||
tft.writedata(tfa);
|
tft.writedata(tfa);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#define STANDARD_FONT_CHAR_LIMIT 40 // number of characters on a single line with normal font
|
#define STANDARD_FONT_CHAR_LIMIT 40 // number of characters on a single line with normal font
|
||||||
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
|
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
|
||||||
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
|
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
|
||||||
#define TOP_FIXED_AREA 16 // Number of lines in top fixed area (lines counted from top of screen)
|
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
|
||||||
#define YMAX 320 // Bottom of screen area
|
#define YMAX 320 // Bottom of screen area
|
||||||
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
//#define MENU_FONT NULL
|
//#define MENU_FONT NULL
|
||||||
@@ -66,7 +66,7 @@ class Display
|
|||||||
bool tteBar = false;
|
bool tteBar = false;
|
||||||
bool draw_tft = false;
|
bool draw_tft = false;
|
||||||
|
|
||||||
int TOP_FIXED_AREA_2 = 32;
|
int TOP_FIXED_AREA_2 = 48;
|
||||||
int print_delay_1, print_delay_2 = 10;
|
int print_delay_1, print_delay_2 = 10;
|
||||||
int current_banner_pos = SCREEN_WIDTH;
|
int current_banner_pos = SCREEN_WIDTH;
|
||||||
|
|
||||||
@@ -85,9 +85,9 @@ class Display
|
|||||||
uint16_t xPos = 0;
|
uint16_t xPos = 0;
|
||||||
|
|
||||||
// The initial y coordinate of the top of the scrolling area
|
// The initial y coordinate of the top of the scrolling area
|
||||||
uint16_t yStart = TOP_FIXED_AREA;
|
uint16_t yStart = TOP_FIXED_AREA_2;
|
||||||
// yArea must be a integral multiple of TEXT_HEIGHT
|
// yArea must be a integral multiple of TEXT_HEIGHT
|
||||||
uint16_t yArea = YMAX - TOP_FIXED_AREA - BOT_FIXED_AREA;
|
uint16_t yArea = YMAX - TOP_FIXED_AREA_2 - BOT_FIXED_AREA;
|
||||||
|
|
||||||
// We have to blank the top line each time the display is scrolled, but this takes up to 13 milliseconds
|
// We have to blank the top line each time the display is scrolled, but this takes up to 13 milliseconds
|
||||||
// for a full width line, meanwhile the serial buffer may be filling... and overflowing
|
// for a full width line, meanwhile the serial buffer may be filling... and overflowing
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ MenuFunctions::MenuFunctions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function to check menu input
|
// Function to check menu input
|
||||||
void MenuFunctions::main()
|
void MenuFunctions::main(uint32_t currentTime)
|
||||||
{
|
{
|
||||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
||||||
(wifi_scan_obj.currentScanMode == OTA_UPDATE) ||
|
(wifi_scan_obj.currentScanMode == OTA_UPDATE) ||
|
||||||
@@ -17,13 +17,20 @@ void MenuFunctions::main()
|
|||||||
this->orientDisplay();
|
this->orientDisplay();
|
||||||
wifi_scan_obj.orient_display = false;
|
wifi_scan_obj.orient_display = false;
|
||||||
}
|
}
|
||||||
if ((display_obj.current_banner_pos <= 0) || (display_obj.current_banner_pos == SCREEN_WIDTH))
|
//if ((display_obj.current_banner_pos <= 0) || (display_obj.current_banner_pos == SCREEN_WIDTH))
|
||||||
{
|
//{
|
||||||
this->drawStatusBar();
|
// this->drawStatusBar();
|
||||||
}
|
//}
|
||||||
display_obj.updateBanner(current_menu->name);
|
display_obj.updateBanner(current_menu->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentTime != 0) {
|
||||||
|
if (currentTime - initTime >= 100) {
|
||||||
|
this->initTime = millis();
|
||||||
|
this->updateStatusBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//this->displayCurrentMenu();
|
//this->displayCurrentMenu();
|
||||||
|
|
||||||
boolean pressed = false;
|
boolean pressed = false;
|
||||||
@@ -147,6 +154,69 @@ void MenuFunctions::main()
|
|||||||
y = -1;
|
y = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MenuFunctions::updateStatusBar()
|
||||||
|
{
|
||||||
|
uint16_t the_color;
|
||||||
|
|
||||||
|
// Draw temp info
|
||||||
|
if (temp_obj.current_temp < 70)
|
||||||
|
the_color = TFT_GREEN;
|
||||||
|
else if ((temp_obj.current_temp >= 70) && (temp_obj.current_temp < 80))
|
||||||
|
the_color = TFT_YELLOW;
|
||||||
|
else if ((temp_obj.current_temp >= 80) && (temp_obj.current_temp < 90))
|
||||||
|
the_color = TFT_ORANGE;
|
||||||
|
else if ((temp_obj.current_temp >= 90) && (temp_obj.current_temp < 100))
|
||||||
|
the_color = TFT_RED;
|
||||||
|
else
|
||||||
|
the_color = TFT_MAROON;
|
||||||
|
|
||||||
|
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||||
|
if (temp_obj.current_temp != temp_obj.old_temp) {
|
||||||
|
temp_obj.old_temp = temp_obj.current_temp;
|
||||||
|
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
||||||
|
}
|
||||||
|
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
|
||||||
|
|
||||||
|
// Draw battery info
|
||||||
|
if (battery_obj.i2c_supported)
|
||||||
|
{
|
||||||
|
if ((String)battery_obj.battery_level != "25")
|
||||||
|
the_color = TFT_GREEN;
|
||||||
|
else
|
||||||
|
the_color = TFT_RED;
|
||||||
|
|
||||||
|
if (battery_obj.battery_level != battery_obj.old_level) {
|
||||||
|
battery_obj.old_level = battery_obj.battery_level;
|
||||||
|
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
|
display_obj.tft.setCursor(0, 1);
|
||||||
|
display_obj.tft.drawXBitmap(186,
|
||||||
|
0,
|
||||||
|
menu_icons[STATUS_BAT],
|
||||||
|
16,
|
||||||
|
16,
|
||||||
|
STATUSBAR_COLOR,
|
||||||
|
the_color);
|
||||||
|
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw SD info
|
||||||
|
if (sd_obj.supported)
|
||||||
|
the_color = TFT_GREEN;
|
||||||
|
else
|
||||||
|
the_color = TFT_RED;
|
||||||
|
|
||||||
|
display_obj.tft.drawXBitmap(170,
|
||||||
|
0,
|
||||||
|
menu_icons[STATUS_SD],
|
||||||
|
16,
|
||||||
|
16,
|
||||||
|
STATUSBAR_COLOR,
|
||||||
|
the_color);
|
||||||
|
//display_obj.tft.print((String)battery_obj.battery_level + "%");
|
||||||
|
}
|
||||||
|
|
||||||
void MenuFunctions::drawStatusBar()
|
void MenuFunctions::drawStatusBar()
|
||||||
{
|
{
|
||||||
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
@@ -156,21 +226,46 @@ void MenuFunctions::drawStatusBar()
|
|||||||
|
|
||||||
uint16_t the_color;
|
uint16_t the_color;
|
||||||
|
|
||||||
if ((String)battery_obj.battery_level != "25")
|
// Draw temp info
|
||||||
|
if (temp_obj.current_temp < 70)
|
||||||
the_color = TFT_GREEN;
|
the_color = TFT_GREEN;
|
||||||
else
|
else if ((temp_obj.current_temp >= 70) && (temp_obj.current_temp < 80))
|
||||||
|
the_color = TFT_YELLOW;
|
||||||
|
else if ((temp_obj.current_temp >= 80) && (temp_obj.current_temp < 90))
|
||||||
|
the_color = TFT_ORANGE;
|
||||||
|
else if ((temp_obj.current_temp >= 90) && (temp_obj.current_temp < 100))
|
||||||
the_color = TFT_RED;
|
the_color = TFT_RED;
|
||||||
|
else
|
||||||
display_obj.tft.setCursor(0, 1);
|
the_color = TFT_MAROON;
|
||||||
display_obj.tft.drawXBitmap(186,
|
|
||||||
0,
|
|
||||||
menu_icons[STATUS_BAT],
|
|
||||||
16,
|
|
||||||
16,
|
|
||||||
STATUSBAR_COLOR,
|
|
||||||
the_color);
|
|
||||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 200, 1, 2);
|
|
||||||
|
|
||||||
|
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||||
|
temp_obj.old_temp = temp_obj.current_temp;
|
||||||
|
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
||||||
|
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
|
||||||
|
|
||||||
|
// Draw battery info
|
||||||
|
if (battery_obj.i2c_supported)
|
||||||
|
{
|
||||||
|
if ((String)battery_obj.battery_level != "25")
|
||||||
|
the_color = TFT_GREEN;
|
||||||
|
else
|
||||||
|
the_color = TFT_RED;
|
||||||
|
|
||||||
|
battery_obj.old_level = battery_obj.battery_level;
|
||||||
|
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
|
display_obj.tft.setCursor(0, 1);
|
||||||
|
display_obj.tft.drawXBitmap(186,
|
||||||
|
0,
|
||||||
|
menu_icons[STATUS_BAT],
|
||||||
|
16,
|
||||||
|
16,
|
||||||
|
STATUSBAR_COLOR,
|
||||||
|
the_color);
|
||||||
|
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw SD info
|
||||||
if (sd_obj.supported)
|
if (sd_obj.supported)
|
||||||
the_color = TFT_GREEN;
|
the_color = TFT_GREEN;
|
||||||
else
|
else
|
||||||
@@ -276,9 +371,9 @@ void MenuFunctions::RunSetup()
|
|||||||
// Build WiFi sniffer Menu
|
// Build WiFi sniffer Menu
|
||||||
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
|
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
|
||||||
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
|
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
|
||||||
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
|
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
|
||||||
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
|
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
|
||||||
|
|
||||||
// Build WiFi scanner Menu
|
// Build WiFi scanner Menu
|
||||||
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
@@ -290,8 +385,8 @@ void MenuFunctions::RunSetup()
|
|||||||
// Build WiFi attack menu
|
// Build WiFi attack menu
|
||||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
|
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
|
||||||
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
|
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
|
||||||
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
|
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
|
||||||
|
|
||||||
// Build Bluetooth Menu
|
// Build Bluetooth Menu
|
||||||
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
||||||
@@ -302,12 +397,12 @@ void MenuFunctions::RunSetup()
|
|||||||
// Build bluetooth sniffer Menu
|
// Build bluetooth sniffer Menu
|
||||||
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||||
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
|
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
|
||||||
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
|
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
|
||||||
|
|
||||||
// Build bluetooth scanner Menu
|
// Build bluetooth scanner Menu
|
||||||
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||||
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
|
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
|
||||||
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
|
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
|
||||||
|
|
||||||
// General apps menu
|
// General apps menu
|
||||||
generalMenu.parentMenu = &mainMenu;
|
generalMenu.parentMenu = &mainMenu;
|
||||||
@@ -348,6 +443,8 @@ void MenuFunctions::RunSetup()
|
|||||||
|
|
||||||
// Set the current menu to the mainMenu
|
// Set the current menu to the mainMenu
|
||||||
changeMenu(&mainMenu);
|
changeMenu(&mainMenu);
|
||||||
|
|
||||||
|
this->initTime = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to change menu
|
// Function to change menu
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ class MenuFunctions
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
String u_result = "";
|
String u_result = "";
|
||||||
|
|
||||||
|
uint32_t initTime = 0;
|
||||||
|
|
||||||
Menu* current_menu;
|
Menu* current_menu;
|
||||||
|
|
||||||
@@ -114,6 +116,7 @@ class MenuFunctions
|
|||||||
|
|
||||||
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
|
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
|
||||||
void drawStatusBar();
|
void drawStatusBar();
|
||||||
|
void updateStatusBar();
|
||||||
void showMenuList(Menu* menu, int layer);
|
void showMenuList(Menu* menu, int layer);
|
||||||
void orientDisplay();
|
void orientDisplay();
|
||||||
|
|
||||||
@@ -126,7 +129,7 @@ class MenuFunctions
|
|||||||
void buildButtons(Menu* menu);
|
void buildButtons(Menu* menu);
|
||||||
void changeMenu(Menu* menu);
|
void changeMenu(Menu* menu);
|
||||||
void displayCurrentMenu();
|
void displayCurrentMenu();
|
||||||
void main();
|
void main(uint32_t currentTime);
|
||||||
void RunSetup();
|
void RunSetup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ uint8_t TemperatureInterface::getCurrentTemp() {
|
|||||||
|
|
||||||
void TemperatureInterface::main(uint32_t currentTime) {
|
void TemperatureInterface::main(uint32_t currentTime) {
|
||||||
if (currentTime != 0) {
|
if (currentTime != 0) {
|
||||||
if (currentTime - initTime >= 3000) {
|
if (currentTime - initTime >= 100) {
|
||||||
//Serial.println("Checking Battery Level");
|
//Serial.println("Checking Battery Level");
|
||||||
this->initTime = millis();
|
this->initTime = millis();
|
||||||
this->current_temp = this->getCurrentTemp();
|
this->current_temp = this->getCurrentTemp();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class TemperatureInterface {
|
|||||||
TemperatureInterface();
|
TemperatureInterface();
|
||||||
|
|
||||||
uint8_t current_temp = 0;
|
uint8_t current_temp = 0;
|
||||||
|
uint8_t old_temp = 0;
|
||||||
|
|
||||||
uint8_t getCurrentTemp();
|
uint8_t getCurrentTemp();
|
||||||
void RunSetup();
|
void RunSetup();
|
||||||
|
|||||||
@@ -392,16 +392,16 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
|||||||
void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
|
void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
|
||||||
{
|
{
|
||||||
//Serial.println("Rick Roll...");
|
//Serial.println("Rick Roll...");
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.print_delay_1 = 15;
|
display_obj.print_delay_1 = 15;
|
||||||
display_obj.print_delay_2 = 10;
|
display_obj.print_delay_2 = 10;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Rick Roll Beacon ",120,0,2);
|
display_obj.tft.drawCentreString(" Rick Roll Beacon ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
packets_sent = 0;
|
packets_sent = 0;
|
||||||
@@ -420,16 +420,16 @@ void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
|
|||||||
void WiFiScan::RunBeaconSpam(uint8_t scan_mode, uint16_t color)
|
void WiFiScan::RunBeaconSpam(uint8_t scan_mode, uint16_t color)
|
||||||
{
|
{
|
||||||
//Serial.println("Beacon Spam...");
|
//Serial.println("Beacon Spam...");
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.print_delay_1 = 15;
|
display_obj.print_delay_1 = 15;
|
||||||
display_obj.print_delay_2 = 10;
|
display_obj.print_delay_2 = 10;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Beacon Spam Random ",120,0,2);
|
display_obj.tft.drawCentreString(" Beacon Spam Random ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
packets_sent = 0;
|
packets_sent = 0;
|
||||||
@@ -449,16 +449,16 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
sd_obj.openCapture("beacon");
|
sd_obj.openCapture("beacon");
|
||||||
|
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.print_delay_1 = 15;
|
display_obj.print_delay_1 = 15;
|
||||||
display_obj.print_delay_2 = 10;
|
display_obj.print_delay_2 = 10;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_WHITE, color);
|
display_obj.tft.setTextColor(TFT_WHITE, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Beacon Sniffer ",120,0,2);
|
display_obj.tft.drawCentreString(" Beacon Sniffer ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
@@ -478,16 +478,16 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
sd_obj.openCapture("deauth");
|
sd_obj.openCapture("deauth");
|
||||||
|
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.print_delay_1 = 15;
|
display_obj.print_delay_1 = 15;
|
||||||
display_obj.print_delay_2 = 10;
|
display_obj.print_delay_2 = 10;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Deauthentication Sniffer ",120,0,2);
|
display_obj.tft.drawCentreString(" Deauthentication Sniffer ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
@@ -509,16 +509,16 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
sd_obj.openCapture("probe");
|
sd_obj.openCapture("probe");
|
||||||
|
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.print_delay_1 = 15;
|
display_obj.print_delay_1 = 15;
|
||||||
display_obj.print_delay_2 = 10;
|
display_obj.print_delay_2 = 10;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Probe Request Sniffer ",120,0,2);
|
display_obj.tft.drawCentreString(" Probe Request Sniffer ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
@@ -561,14 +561,14 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
|||||||
pBLEScan = BLEDevice::getScan(); //create new scan
|
pBLEScan = BLEDevice::getScan(); //create new scan
|
||||||
if (scan_mode == BT_SCAN_ALL)
|
if (scan_mode == BT_SCAN_ALL)
|
||||||
{
|
{
|
||||||
display_obj.TOP_FIXED_AREA_2 = 32;
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Bluetooth Sniff ",120,0,2);
|
display_obj.tft.drawCentreString(" Bluetooth Sniff ",120,16,2);
|
||||||
display_obj.touchToExit();
|
display_obj.touchToExit();
|
||||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
@@ -580,13 +580,13 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
display_obj.TOP_FIXED_AREA_2 = 160;
|
display_obj.TOP_FIXED_AREA_2 = 160;
|
||||||
display_obj.tteBar = true;
|
display_obj.tteBar = true;
|
||||||
display_obj.clearScreen();
|
//display_obj.clearScreen();
|
||||||
display_obj.tft.fillScreen(TFT_DARKGREY);
|
display_obj.tft.fillScreen(TFT_DARKGREY);
|
||||||
display_obj.initScrollValues(true);
|
display_obj.initScrollValues(true);
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||||
display_obj.tft.fillRect(0,0,240,16, color);
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
display_obj.tft.drawCentreString(" Detect Card Skimmers ",120,0,2);
|
display_obj.tft.drawCentreString(" Detect Card Skimmers ",120,16,2);
|
||||||
display_obj.twoPartDisplay("Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06...");
|
display_obj.twoPartDisplay("Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06...");
|
||||||
display_obj.tft.setTextColor(TFT_BLACK, TFT_DARKGREY);
|
display_obj.tft.setTextColor(TFT_BLACK, TFT_DARKGREY);
|
||||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
@@ -1571,6 +1571,7 @@ void WiFiScan::main(uint32_t currentTime)
|
|||||||
displayString.concat(packets_sent);
|
displayString.concat(packets_sent);
|
||||||
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
|
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
|
||||||
displayString2.concat(" ");
|
displayString2.concat(" ");
|
||||||
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
display_obj.showCenterText(displayString2, 160);
|
display_obj.showCenterText(displayString2, 160);
|
||||||
display_obj.showCenterText(displayString, 160);
|
display_obj.showCenterText(displayString, 160);
|
||||||
packets_sent = 0;
|
packets_sent = 0;
|
||||||
@@ -1599,6 +1600,7 @@ void WiFiScan::main(uint32_t currentTime)
|
|||||||
displayString.concat(packets_sent);
|
displayString.concat(packets_sent);
|
||||||
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
|
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
|
||||||
displayString2.concat(" ");
|
displayString2.concat(" ");
|
||||||
|
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
display_obj.showCenterText(displayString2, 160);
|
display_obj.showCenterText(displayString2, 160);
|
||||||
display_obj.showCenterText(displayString, 160);
|
display_obj.showCenterText(displayString, 160);
|
||||||
packets_sent = 0;
|
packets_sent = 0;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void loop()
|
|||||||
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
|
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
|
||||||
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
|
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
|
||||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
|
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
|
||||||
menu_function_obj.main();
|
menu_function_obj.main(currentTime);
|
||||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
||||||
web_obj.main();
|
web_obj.main();
|
||||||
delay(1);
|
delay(1);
|
||||||
|
|||||||
BIN
esp32_marauder/esp32_marauder_v0_6_5_20200514.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_6_5_20200514.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user