Cleaning the connection process
This commit is contained in:
parent
563664931e
commit
6a035f09a1
@ -3,6 +3,8 @@
|
||||
ConnectivityManager::ConnectivityManager() : _error(0), _sdCardManager(NULL)
|
||||
{
|
||||
persistent(false);
|
||||
WiFi.disconnect();
|
||||
WiFi.softAPdisconnect();
|
||||
|
||||
if(!enableSTAAndAP(false))_error &= AP_AND_STA_ENABLED_ERR;
|
||||
if(!softAP("ESP8266SwissArmyBoard", NULL, 1, false, 8))_error &= AP_SETUP_ERR;
|
||||
@ -11,6 +13,9 @@ ConnectivityManager::ConnectivityManager() : _error(0), _sdCardManager(NULL)
|
||||
ConnectivityManager::ConnectivityManager(SDCardManager &sdCardManager) : _error(0), _sdCardManager(&sdCardManager)
|
||||
{
|
||||
persistent(false);
|
||||
WiFi.disconnect();
|
||||
WiFi.softAPdisconnect();
|
||||
|
||||
if(!enableSTAAndAP(false))_error &= AP_AND_STA_ENABLED_ERR;
|
||||
else
|
||||
{
|
||||
@ -37,8 +42,10 @@ ConnectivityManager::ConnectivityManager(SDCardManager &sdCardManager) : _error(
|
||||
{
|
||||
if((*cfgDictionary)("SSID") != NULL && (*cfgDictionary)("PASSWORD") != NULL)
|
||||
{
|
||||
if(!begin((*cfgDictionary)("SSID")->stringValue(), (*cfgDictionary)("PASSWORD")->stringValue())) _error &= AP_SETUP_ERR;
|
||||
if(!begin((*cfgDictionary)("SSID")->stringValue(), (*cfgDictionary)("PASSWORD")->stringValue()))
|
||||
_error &= AP_SETUP_ERR;
|
||||
}
|
||||
|
||||
delete cfgDictionary;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user