mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-28 20:46:33 +03:00
WIP: ESP-IDF Core 3 migration - mbedtls SSL, module library, board configs, MQTT and network updates
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <emsesp.h>
|
||||
|
||||
#ifdef TASMOTA_SDK
|
||||
#ifdef NO_TLS_SUPPORT
|
||||
#include "lwip/dns.h"
|
||||
#endif
|
||||
|
||||
@@ -31,22 +31,13 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
||||
// for both connections show ethernet
|
||||
if (ethernet_connected) {
|
||||
// Ethernet
|
||||
root["local_ip"] = ETH.localIP().toString();
|
||||
#if ESP_IDF_VERSION_MAJOR < 5
|
||||
root["local_ipv6"] = ETH.localIPv6().toString();
|
||||
#else
|
||||
root["local_ipv6"] = ETH.linkLocalIPv6().toString();
|
||||
#endif
|
||||
root["local_ip"] = ETH.localIP().toString();
|
||||
root["local_ipv6"] = ETH.linkLocalIPv6().toString();
|
||||
root["mac_address"] = ETH.macAddress();
|
||||
root["subnet_mask"] = ETH.subnetMask().toString();
|
||||
root["gateway_ip"] = ETH.gatewayIP().toString();
|
||||
#ifdef TASMOTA_SDK
|
||||
IPAddress dnsIP1 = IPAddress(dns_getserver(0));
|
||||
IPAddress dnsIP2 = IPAddress(dns_getserver(1));
|
||||
#else
|
||||
IPAddress dnsIP1 = ETH.dnsIP(0);
|
||||
IPAddress dnsIP2 = ETH.dnsIP(1);
|
||||
#endif
|
||||
IPAddress dnsIP1 = ETH.dnsIP(0);
|
||||
IPAddress dnsIP2 = ETH.dnsIP(1);
|
||||
if (IPUtils::isSet(dnsIP1)) {
|
||||
root["dns_ip_1"] = dnsIP1.toString();
|
||||
}
|
||||
@@ -54,12 +45,8 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
||||
root["dns_ip_2"] = dnsIP2.toString();
|
||||
}
|
||||
} else if (wifi_status == WL_CONNECTED) {
|
||||
root["local_ip"] = WiFi.localIP().toString();
|
||||
#if ESP_IDF_VERSION_MAJOR < 5
|
||||
root["local_ipv6"] = WiFi.localIPv6().toString();
|
||||
#else
|
||||
root["local_ipv6"] = WiFi.linkLocalIPv6().toString();
|
||||
#endif
|
||||
root["local_ip"] = WiFi.localIP().toString();
|
||||
root["local_ipv6"] = WiFi.linkLocalIPv6().toString();
|
||||
root["mac_address"] = WiFi.macAddress();
|
||||
root["rssi"] = WiFi.RSSI();
|
||||
root["ssid"] = WiFi.SSID();
|
||||
@@ -71,14 +58,8 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
||||
if (WiFi.gatewayIP() != INADDR_NONE) {
|
||||
root["gateway_ip"] = WiFi.gatewayIP().toString();
|
||||
}
|
||||
|
||||
#ifdef TASMOTA_SDK
|
||||
IPAddress dnsIP1 = IPAddress(dns_getserver(0));
|
||||
IPAddress dnsIP2 = IPAddress(dns_getserver(1));
|
||||
#else
|
||||
IPAddress dnsIP1 = WiFi.dnsIP(0);
|
||||
IPAddress dnsIP2 = WiFi.dnsIP(1);
|
||||
#endif
|
||||
if (dnsIP1 != INADDR_NONE) {
|
||||
root["dns_ip_1"] = dnsIP1.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user