mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 09:39:11 +03:00
Track number of WiFi reconnects #2207
This commit is contained in:
@@ -87,7 +87,6 @@ class NetworkSettings {
|
||||
static StateUpdateResult update(JsonObject root, NetworkSettings & settings);
|
||||
};
|
||||
|
||||
|
||||
class NetworkSettingsService : public StatefulService<NetworkSettings> {
|
||||
public:
|
||||
NetworkSettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager);
|
||||
@@ -95,6 +94,10 @@ class NetworkSettingsService : public StatefulService<NetworkSettings> {
|
||||
void begin();
|
||||
void loop();
|
||||
|
||||
uint16_t getWifiConnects() const {
|
||||
return connectcount_;
|
||||
}
|
||||
|
||||
private:
|
||||
HttpEndpoint<NetworkSettings> _httpEndpoint;
|
||||
FSPersistence<NetworkSettings> _fsPersistence;
|
||||
@@ -102,6 +105,8 @@ class NetworkSettingsService : public StatefulService<NetworkSettings> {
|
||||
unsigned long _lastConnectionAttempt;
|
||||
bool _stopping;
|
||||
|
||||
uint16_t connectcount_ = 0; // number of wifi reconnects
|
||||
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void mDNS_start() const;
|
||||
const char * disconnectReason(uint8_t code);
|
||||
|
||||
Reference in New Issue
Block a user