diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index 7657db21..db712028 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -84,6 +84,7 @@ static bool sta_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs) // ---------------------------------------------------- STA function ----------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------------- +bool WiFiSTAClass::_autoReconnect = true; bool WiFiSTAClass::_useStaticIp = false; wl_status_t WiFiSTAClass::_status = WL_NO_SHIELD; /** @@ -302,6 +303,17 @@ bool WiFiSTAClass::getAutoConnect() return autoConnect; } +bool WiFiSTAClass::setAutoReconnect(bool autoReconnect) +{ + _autoReconnect = autoReconnect; + return true; +} + +bool WiFiSTAClass::getAutoReconnect() +{ + return _autoReconnect; +} + /** * Wait for WiFi connection to reach a result * returns the status reached or disconnect if STA is off diff --git a/libraries/WiFi/src/WiFiSTA.h b/libraries/WiFi/src/WiFiSTA.h index ad02cef3..2e1a8fba 100644 --- a/libraries/WiFi/src/WiFiSTA.h +++ b/libraries/WiFi/src/WiFiSTA.h @@ -51,6 +51,7 @@ public: bool getAutoConnect(); bool setAutoReconnect(bool autoReconnect); + bool getAutoReconnect(); uint8_t waitForConnectResult(); @@ -84,6 +85,7 @@ public: protected: static wl_status_t _status; static bool _useStaticIp; + static bool _autoReconnect; public: bool beginSmartConfig();