Skip to content

Commit

Permalink
removed waitForConnectRewsult()
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenradball committed Nov 11, 2023
1 parent 494c0f7 commit b67974a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
19 changes: 2 additions & 17 deletions src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int WiFiClass::begin(const char* ssid)
int WiFiClass::connect(const char* ssid) {
uint8_t status = WL_CONNECT_FAILED;
if (WiFiDrv::wifiSetNetwork(ssid, strlen(ssid)) != WL_FAILURE) {
status = WiFiDrv::getConnectionStatus();
status = WiFiDrv::getConnectionStatus();
}
return status;
}
Expand All @@ -87,7 +87,7 @@ int WiFiClass::begin(const char* ssid, uint8_t key_idx, const char *key)
break;
}
}
}else{
} else {
status = WL_CONNECT_FAILED;
}
return status;
Expand Down Expand Up @@ -124,7 +124,6 @@ int WiFiClass::begin(const char* ssid, const char *passphrase)
return status;
}


int WiFiClass::connect(const char* ssid, const char *passphrase) {
uint8_t status = WL_CONNECT_FAILED;
if (WiFiDrv::wifiSetPassphrase(ssid, strlen(ssid), passphrase, strlen(passphrase))!= WL_FAILURE) {
Expand All @@ -134,20 +133,6 @@ int WiFiClass::connect(const char* ssid, const char *passphrase) {
return status;
}

int8_t WiFiClass::waitForConnectResult(unsigned long timeout) {
unsigned long _start {millis()};
while( (millis() - _start) <= timeout) {
WiFi.feedWatchdog();
uint8_t _status = WiFiDrv::getConnectionStatus();
if((_status != WL_IDLE_STATUS) && (_status != WL_NO_SSID_AVAIL) && (_status != WL_SCAN_COMPLETED)) {
return _status;
}
delay(WL_DELAY_START_CONNECTION);
}
// -1 indicates timeout
return -1;
}

uint8_t WiFiClass::beginAP(const char *ssid)
{
return beginAP(ssid, 1);
Expand Down
8 changes: 0 additions & 8 deletions src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@ class WiFiClass
int connect(const char* ssid, uint8_t key_idx, const char* key);
int connect(const char* ssid, const char *passphrase);

/**
* @brief function to check connection status for given time
*
* @param timeout timeout value for checking connect status
* @return int8_t return connect status (-1 for timeout)
*/
int8_t waitForConnectResult(unsigned long timeout = 60000UL);

uint8_t beginAP(const char *ssid);
uint8_t beginAP(const char *ssid, uint8_t channel);
uint8_t beginAP(const char *ssid, const char* passphrase);
Expand Down

0 comments on commit b67974a

Please sign in to comment.