diff --git a/src/hasp_dispatch.cpp b/src/hasp_dispatch.cpp index acbf937b..b25101f7 100644 --- a/src/hasp_dispatch.cpp +++ b/src/hasp_dispatch.cpp @@ -633,7 +633,7 @@ void dispatch_output_statusupdate(const char *, const char *) long(millis() / 1000)); #if HASP_USE_WIFI > 0 - network_get_status(buffer, sizeof(buffer)); + network_get_statusupdate(buffer, sizeof(buffer)); strcat(data, buffer); #endif snprintf_P(buffer, sizeof(buffer), PSTR("\"heapFree\":%u,\"heapFrag\":%u,\"espCore\":\"%s\","), diff --git a/src/hasp_dispatch.h b/src/hasp_dispatch.h index 76695582..0305c35f 100644 --- a/src/hasp_dispatch.h +++ b/src/hasp_dispatch.h @@ -5,6 +5,7 @@ #define HASP_DISPATCH_H #include "ArduinoJson.h" +#include "lvgl.h" enum hasp_event_t { // even = released, odd = pressed HASP_EVENT_OFF = 0, diff --git a/src/hasp_ethernet_esp32.cpp b/src/hasp_ethernet_esp32.cpp index 6138e3a8..29167fdc 100644 --- a/src/hasp_ethernet_esp32.cpp +++ b/src/hasp_ethernet_esp32.cpp @@ -63,4 +63,10 @@ bool ethernetEvery5Seconds() return eth_connected; } +void ethernet_get_statusupdate(char * buffer, size_t len) +{ + snprintf_P(buffer, len, PSTR("\"eth\":\"%s\",\"link\":\"%d Mbps\",\"ip\":\"%s\","), eth_connected ? F("ON") : F("OFF"), ETH.linkSpeed(), + ETH.localIP().toString().c_str()); +} + #endif \ No newline at end of file diff --git a/src/hasp_ethernet_esp32.h b/src/hasp_ethernet_esp32.h index c41b79b9..4b99113a 100644 --- a/src/hasp_ethernet_esp32.h +++ b/src/hasp_ethernet_esp32.h @@ -10,5 +10,6 @@ void ethernetSetup(); void IRAM_ATTR ethernetLoop(void); bool ethernetEvery5Seconds(); +void ethernet_get_statusupdate(char * buffer, size_t len); #endif \ No newline at end of file diff --git a/src/hasp_wifi.cpp b/src/hasp_wifi.cpp index c859b008..d6f5b1aa 100644 --- a/src/hasp_wifi.cpp +++ b/src/hasp_wifi.cpp @@ -492,7 +492,7 @@ void wifiStop() Log.warning(TAG_WIFI, F("Stopped")); } -void wifi_get_status(char * buffer, size_t len) +void wifi_get_statusupdate(char * buffer, size_t len) { #if defined(STM32F4xx) IPAddress ip; diff --git a/src/hasp_wifi.h b/src/hasp_wifi.h index 258a6e6f..91c8e70a 100644 --- a/src/hasp_wifi.h +++ b/src/hasp_wifi.h @@ -13,7 +13,7 @@ bool wifiEvery5Seconds(void); void wifiStop(void); bool wifiValidateSsid(const char * ssid, const char * pass); -void wifi_get_status(char * buffer, size_t len); +void wifi_get_statusupdate(char * buffer, size_t len); bool wifiGetConfig(const JsonObject & settings); bool wifiSetConfig(const JsonObject & settings);