Implement multiple WiFi

- similar to #3705
- solves #2845, #2974, #852, #1228
This commit is contained in:
Blaz Kristan
2024-01-21 00:30:15 +01:00
parent 5dd8f0a0b7
commit bfb217c203
12 changed files with 233 additions and 137 deletions

View File

@@ -163,8 +163,8 @@ void WiFiEvent(WiFiEvent_t event)
if (!apActive) {
WiFi.disconnect(true);
}
if (staticIP != (uint32_t)0x00000000 && staticGateway != (uint32_t)0x00000000) {
ETH.config(staticIP, staticGateway, staticSubnet, IPAddress(8, 8, 8, 8));
if (multiWiFi[0].staticIP != (uint32_t)0x00000000 && multiWiFi[0].staticGW != (uint32_t)0x00000000) {
ETH.config(multiWiFi[0].staticIP, multiWiFi[0].staticGW, multiWiFi[0].staticSN, dnsAddress);
} else {
ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
}