Ethernet Support (#1316)

Ethernet Support
This commit is contained in:
tbnobody
2020-11-13 18:25:13 +01:00
committed by GitHub
parent 560f72a320
commit c365fd9d74
9 changed files with 191 additions and 41 deletions

View File

@@ -54,12 +54,15 @@
}
#else // ESP32
#include <WiFi.h>
#include <ETH.h>
#include "esp_wifi.h"
#include <ESPmDNS.h>
#include <AsyncTCP.h>
#include "SPIFFS.h"
#endif
#include "Network.h"
#include <ESPAsyncWebServer.h>
#include <EEPROM.h>
#include <WiFiUdp.h>
@@ -521,8 +524,11 @@ WLED_GLOBAL UsermodManager usermods _INIT(UsermodManager());
WLED_GLOBAL int loops _INIT(0);
#endif
#define WLED_CONNECTED (WiFi.status() == WL_CONNECTED)
#ifdef ARDUINO_ARCH_ESP32
#define WLED_CONNECTED (WiFi.status() == WL_CONNECTED || ETH.localIP()[0] != 0)
#else
#define WLED_CONNECTED (WiFi.status() == WL_CONNECTED)
#endif
#define WLED_WIFI_CONFIGURED (strlen(clientSSID) >= 1 && strcmp(clientSSID, DEFAULT_CLIENT_SSID) != 0)
#define WLED_MQTT_CONNECTED (mqtt != nullptr && mqtt->connected())