This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
esp-firewall/ESPFirewall/src/main.cpp

28 lines
498 B
C++
Raw Normal View History

2022-04-10 20:46:54 +02:00
#include "theSecrets.h"
2022-04-18 22:56:30 +02:00
#include "WiFi.h"
#include "esp32API.hpp"
2022-04-20 07:58:06 +02:00
firewall::API *firewall_api;
2022-04-10 20:46:54 +02:00
void setup_wifi()
{
2022-04-21 15:16:54 +02:00
log_d("Attempting to connect to WPA SSID: %s", ssid);
2022-04-10 20:46:54 +02:00
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, psk);
2022-04-21 16:10:31 +02:00
while (WiFi.status() != WL_CONNECTED)
2022-04-10 20:46:54 +02:00
{
delay(2000);
2022-04-10 20:46:54 +02:00
}
2022-04-21 15:16:54 +02:00
log_i("IP Address: %s", WiFi.localIP().toString().c_str());
2022-04-10 20:46:54 +02:00
}
2022-04-10 14:38:03 +02:00
void setup()
{
2022-04-10 15:55:42 +02:00
setup_wifi();
2022-04-22 08:46:37 +02:00
firewall_api = new firewall::API(api_username, api_password);
2022-04-10 14:38:03 +02:00
}
void loop()
{
firewall_api->handle_clients();
2022-04-10 14:38:03 +02:00
}