Rename func to network_get_statusupdate

This commit is contained in:
fvanroie 2020-12-21 22:26:17 +01:00
parent 8ffd0ae23c
commit faf0e3874d
6 changed files with 11 additions and 3 deletions

View File

@ -633,7 +633,7 @@ void dispatch_output_statusupdate(const char *, const char *)
long(millis() / 1000)); long(millis() / 1000));
#if HASP_USE_WIFI > 0 #if HASP_USE_WIFI > 0
network_get_status(buffer, sizeof(buffer)); network_get_statusupdate(buffer, sizeof(buffer));
strcat(data, buffer); strcat(data, buffer);
#endif #endif
snprintf_P(buffer, sizeof(buffer), PSTR("\"heapFree\":%u,\"heapFrag\":%u,\"espCore\":\"%s\","), snprintf_P(buffer, sizeof(buffer), PSTR("\"heapFree\":%u,\"heapFrag\":%u,\"espCore\":\"%s\","),

View File

@ -5,6 +5,7 @@
#define HASP_DISPATCH_H #define HASP_DISPATCH_H
#include "ArduinoJson.h" #include "ArduinoJson.h"
#include "lvgl.h"
enum hasp_event_t { // even = released, odd = pressed enum hasp_event_t { // even = released, odd = pressed
HASP_EVENT_OFF = 0, HASP_EVENT_OFF = 0,

View File

@ -63,4 +63,10 @@ bool ethernetEvery5Seconds()
return eth_connected; 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 #endif

View File

@ -10,5 +10,6 @@ void ethernetSetup();
void IRAM_ATTR ethernetLoop(void); void IRAM_ATTR ethernetLoop(void);
bool ethernetEvery5Seconds(); bool ethernetEvery5Seconds();
void ethernet_get_statusupdate(char * buffer, size_t len);
#endif #endif

View File

@ -492,7 +492,7 @@ void wifiStop()
Log.warning(TAG_WIFI, F("Stopped")); 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) #if defined(STM32F4xx)
IPAddress ip; IPAddress ip;

View File

@ -13,7 +13,7 @@ bool wifiEvery5Seconds(void);
void wifiStop(void); void wifiStop(void);
bool wifiValidateSsid(const char * ssid, const char * pass); 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 wifiGetConfig(const JsonObject & settings);
bool wifiSetConfig(const JsonObject & settings); bool wifiSetConfig(const JsonObject & settings);