mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-01-03 19:33:47 +01:00
Renamed WifiSettings to NetworkSettings and implemented first ethernet initialization
This commit is contained in:
35
include/NetworkSettings.h
Normal file
35
include/NetworkSettings.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#include <DNSServer.h>
|
||||
#include <WiFi.h>
|
||||
#include <memory>
|
||||
|
||||
class NetworkSettingsClass {
|
||||
public:
|
||||
NetworkSettingsClass();
|
||||
void init();
|
||||
void loop();
|
||||
void applyConfig();
|
||||
void enableAdminMode();
|
||||
String getApName();
|
||||
|
||||
private:
|
||||
void setHostname();
|
||||
void setStaticIp();
|
||||
void setupMode();
|
||||
void NetworkEvent(WiFiEvent_t event);
|
||||
bool adminEnabled = true;
|
||||
bool forceDisconnection = false;
|
||||
int adminTimeoutCounter = 0;
|
||||
int connectTimeoutTimer = 0;
|
||||
int connectRedoTimer = 0;
|
||||
unsigned long lastTimerCall = 0;
|
||||
const byte DNS_PORT = 53;
|
||||
IPAddress apIp;
|
||||
IPAddress apNetmask;
|
||||
std::unique_ptr<DNSServer> dnsServer;
|
||||
bool dnsServerStatus = false;
|
||||
};
|
||||
|
||||
extern NetworkSettingsClass NetworkSettings;
|
||||
Reference in New Issue
Block a user