Implemented mDNS

This commit is contained in:
CommanderRedYT
2023-10-30 20:53:45 +01:00
parent 2991af79f2
commit 7c875187a8
11 changed files with 68 additions and 9 deletions

View File

@@ -66,6 +66,8 @@ struct CONFIG_T {
char WiFi_Hostname[WIFI_MAX_HOSTNAME_STRLEN + 1];
uint32_t WiFi_ApTimeout;
bool Mdns_Enabled;
char Ntp_Server[NTP_MAX_SERVER_STRLEN + 1];
char Ntp_Timezone[NTP_MAX_TIMEZONE_STRLEN + 1];
char Ntp_TimezoneDescr[NTP_MAX_TIMEZONEDESCR_STRLEN + 1];

View File

@@ -59,6 +59,7 @@ public:
private:
void setHostname();
void setStaticIp();
void handleMDNS();
void setupMode();
void NetworkEvent(WiFiEvent_t event);
bool adminEnabled = true;
@@ -76,6 +77,7 @@ private:
network_mode _networkMode = network_mode::Undefined;
bool _ethConnected = false;
std::vector<NetworkEventCbList_t> _cbEventList;
bool lastMdnsEnabled = false;
};
extern NetworkSettingsClass NetworkSettings;

View File

@@ -20,6 +20,8 @@
#define WIFI_PASSWORD ""
#define WIFI_DHCP true
#define MDNS_ENABLED false
#define NTP_SERVER "pool.ntp.org"
#define NTP_TIMEZONE "CET-1CEST,M3.5.0,M10.5.0/3"
#define NTP_TIMEZONEDESCR "Europe/Berlin"
@@ -96,4 +98,4 @@
#define DISPLAY_CONTRAST 60U
#define DISPLAY_LANGUAGE 0U
#define REACHABLE_THRESHOLD 2U
#define REACHABLE_THRESHOLD 2U