wifi reconnects renaming

This commit is contained in:
proddy
2024-11-16 14:48:01 +01:00
parent c3ee1991a9
commit a82b32ce97
9 changed files with 25 additions and 21 deletions

View File

@@ -66,8 +66,8 @@ class ESP8266React {
return _apSettingsService.getAPNetworkStatus() == APNetworkStatus::ACTIVE;
}
uint16_t getWifiConnects() {
return _networkSettingsService.getWifiConnects();
uint16_t getWifiReconnects() {
return _networkSettingsService.getWifiReconnects();
}
private:

View File

@@ -304,7 +304,7 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
break;
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
connectcount_++; // count the number of reconnects
connectcount_++; // count the number of WiFi reconnects
emsesp::EMSESP::logger().warning("WiFi disconnected (#%d). Reason: %s (%d)",
connectcount_,
disconnectReason(info.wifi_sta_disconnected.reason),

View File

@@ -94,7 +94,7 @@ class NetworkSettingsService : public StatefulService<NetworkSettings> {
void begin();
void loop();
uint16_t getWifiConnects() const {
uint16_t getWifiReconnects() const {
return connectcount_;
}

View File

@@ -60,13 +60,13 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
#else
root["local_ipv6"] = WiFi.linkLocalIPv6().toString();
#endif
root["mac_address"] = WiFi.macAddress();
root["rssi"] = WiFi.RSSI();
root["ssid"] = WiFi.SSID();
root["bssid"] = WiFi.BSSIDstr();
root["channel"] = WiFi.channel();
root["connect_count"] = emsesp::EMSESP::esp8266React.getWifiConnects();
root["subnet_mask"] = WiFi.subnetMask().toString();
root["mac_address"] = WiFi.macAddress();
root["rssi"] = WiFi.RSSI();
root["ssid"] = WiFi.SSID();
root["bssid"] = WiFi.BSSIDstr();
root["channel"] = WiFi.channel();
root["reconnect_count"] = emsesp::EMSESP::esp8266React.getWifiReconnects();
root["subnet_mask"] = WiFi.subnetMask().toString();
if (WiFi.gatewayIP() != INADDR_NONE) {
root["gateway_ip"] = WiFi.gatewayIP().toString();