diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 4e29579..be138ef 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -99,13 +99,13 @@ jobs: with: sketch-names: MarauderOTA.ino arduino-board-fqbn: esp32:esp32:esp32s2 - platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.3/package_esp32_dev_index.json + platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.9/package_esp32_dev_index.json - name: Replace SD lib run: | - rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD - cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD - ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD + rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD + cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD + ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD - name: Modify platform.txt run: | diff --git a/esp32_marauder/EvilPortal.cpp b/esp32_marauder/EvilPortal.cpp index 164b788..bfc85e3 100644 --- a/esp32_marauder/EvilPortal.cpp +++ b/esp32_marauder/EvilPortal.cpp @@ -1,5 +1,26 @@ #include "EvilPortal.h" EvilPortal::EvilPortal() { + this->runServer = false; + this->name_received = false; + this->password_received = false; +} + +String EvilPortal::get_user_name() { + return this->user_name; +} + +String EvilPortal::get_password() { + return this->password; +} + +void EvilPortal::startAP() { +} + +void EvilPortal::startPortal() { + // wait for flipper input to get config index + this->startAP(); + + this->runServer = true; } \ No newline at end of file diff --git a/esp32_marauder/EvilPortal.h b/esp32_marauder/EvilPortal.h index 1816cde..131203b 100644 --- a/esp32_marauder/EvilPortal.h +++ b/esp32_marauder/EvilPortal.h @@ -1,18 +1,49 @@ #ifndef EvilPortal_h #define EvilPortal_h +#include "ESPAsyncWebServer.h" +#include +#include + #include "configs.h" #include "settings.h" +#include "WiFiScan.h" extern Settings settings_obj; +extern WiFiScan wifi_scan_obj; + +#define WAITING 0 +#define GOOD 1 +#define BAD 2 + +#define SET_HTML_CMD "sethtml=" +#define SET_AP_CMD "setap=" +#define RESET_CMD "reset" +#define START_CMD "start" +#define ACK_CMD "ack" +#define MAX_HTML_SIZE 20000 class EvilPortal { private: + bool runServer; + bool name_received; + bool password_received; + String user_name; + String password; + + //DNSServer dnsServer; + //AsyncWebServer server(80); + + void startPortal(); + void startAP(); public: EvilPortal(); + String get_user_name(); + String get_password(); + }; #endif \ No newline at end of file