works, needs more work
This commit is contained in:
parent
f94639c1a0
commit
4d23c1039b
6 changed files with 75 additions and 66 deletions
|
@ -1,14 +1,31 @@
|
|||
#include <Arduino.h>
|
||||
#include "theWifi.h"
|
||||
#include "theServer.h"
|
||||
#include "theSecrets.h"
|
||||
#include "Firewall.h"
|
||||
#include "esp32-hal-log.h"
|
||||
|
||||
const char *esp_ip_address;
|
||||
ESPFirewall *firewall;
|
||||
|
||||
void setup_wifi()
|
||||
{
|
||||
log_i("Attempting to connect to WPA SSID: %s", ssid);
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(ssid, psk);
|
||||
while (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
delay(1000);
|
||||
}
|
||||
esp_ip_address = WiFi.localIP().toString().c_str();
|
||||
log_i("Connected, IP Address: %s", esp_ip_address);
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
setup_wifi();
|
||||
setup_server();
|
||||
firewall = new ESPFirewall;
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
handle_server_clients();
|
||||
firewall->handle_clients();
|
||||
}
|
Reference in a new issue