Improved ethernet connection

This commit is contained in:
Gunnar Skjold
2023-12-10 16:56:13 +01:00
parent ee462ec468
commit 0f22fd561e
11 changed files with 112 additions and 38 deletions

View File

@@ -154,6 +154,10 @@ void AmsWebServer::setMqttHandler(AmsMqttHandler* mqttHandler) {
this->mqttHandler = mqttHandler;
}
void AmsWebServer::setConnectionHandler(ConnectionHandler* ch) {
this->ch = ch;
}
void AmsWebServer::setPriceService(PriceService* ps) {
this->ps = ps;
}
@@ -249,11 +253,11 @@ void AmsWebServer::sysinfoJson() {
hostname = "ams-"+chipIdStr;
}
IPAddress localIp = WiFi.localIP();
IPAddress subnet = WiFi.subnetMask();
IPAddress gateway = WiFi.gatewayIP();
IPAddress dns1 = WiFi.dnsIP(0);
IPAddress dns2 = WiFi.dnsIP(1);
IPAddress localIp = ch->getIP();
IPAddress subnet = ch->getSubnetMask();
IPAddress gateway = ch->getGateway();
IPAddress dns1 = ch->getDns(0);
IPAddress dns2 = ch->getDns(1);
char macStr[18] = { 0 };
char apMacStr[18] = { 0 };