Skip to content

Commit 91a153e

Browse files
committed
WiFi._status condition expressions fix
1 parent 04f088b commit 91a153e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/WiFi.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,14 @@ uint8_t WiFiClass::begin()
381381
for (unsigned long start = millis(); millis() - start < _timeout;)
382382
{
383383
m2m_wifi_handle_events(NULL);
384-
if ((_status & WL_CONNECTED) || (_status & WL_DISCONNECTED)) {
384+
if ((_status == WL_CONNECTED) || (_status == WL_DISCONNECTED)) {
385385
break;
386386
}
387387
}
388388

389389
memset(_ssid, 0, M2M_MAX_SSID_LEN);
390390

391-
if (!(_status & WL_CONNECTED)) {
391+
if (!(_status == WL_CONNECTED)) {
392392
_mode = WL_RESET_MODE;
393393
} else {
394394
m2m_wifi_get_connection_info();
@@ -443,11 +443,11 @@ uint8_t WiFiClass::startConnect(const char *ssid, uint8_t u8SecType, const void
443443
for (unsigned long start = millis(); millis() - start < _timeout;)
444444
{
445445
m2m_wifi_handle_events(NULL);
446-
if ((_status & WL_CONNECTED) || (_status & WL_DISCONNECTED)) {
446+
if ((_status == WL_CONNECTED) || (_status == WL_DISCONNECTED)) {
447447
break;
448448
}
449449
}
450-
if (!(_status & WL_CONNECTED)) {
450+
if (_status != WL_CONNECTED) {
451451
_mode = WL_RESET_MODE;
452452
}
453453

@@ -853,7 +853,7 @@ int8_t WiFiClass::scanNetworks()
853853
// Wait for scan result or timeout:
854854
_status = WL_IDLE_STATUS;
855855
unsigned long start = millis();
856-
while (!(_status & WL_SCAN_COMPLETED) && millis() - start < 5000) {
856+
while ((_status != WL_SCAN_COMPLETED) && millis() - start < 5000) {
857857
m2m_wifi_handle_events(NULL);
858858
}
859859
_status = tmp;
@@ -873,7 +873,7 @@ char* WiFiClass::SSID(uint8_t pos)
873873
// Wait for connection or timeout:
874874
_status = WL_IDLE_STATUS;
875875
unsigned long start = millis();
876-
while (!(_status & WL_SCAN_COMPLETED) && millis() - start < 2000) {
876+
while ((_status != WL_SCAN_COMPLETED) && millis() - start < 2000) {
877877
m2m_wifi_handle_events(NULL);
878878
}
879879

@@ -895,7 +895,7 @@ int32_t WiFiClass::RSSI(uint8_t pos)
895895
// Wait for connection or timeout:
896896
_status = WL_IDLE_STATUS;
897897
unsigned long start = millis();
898-
while (!(_status & WL_SCAN_COMPLETED) && millis() - start < 2000) {
898+
while ((_status != WL_SCAN_COMPLETED) && millis() - start < 2000) {
899899
m2m_wifi_handle_events(NULL);
900900
}
901901

@@ -934,7 +934,7 @@ uint8_t WiFiClass::encryptionType(uint8_t pos)
934934
// Wait for connection or timeout:
935935
_status = WL_IDLE_STATUS;
936936
unsigned long start = millis();
937-
while (!(_status & WL_SCAN_COMPLETED) && millis() - start < 2000) {
937+
while ((_status != WL_SCAN_COMPLETED) && millis() - start < 2000) {
938938
m2m_wifi_handle_events(NULL);
939939
}
940940

@@ -958,7 +958,7 @@ uint8_t* WiFiClass::BSSID(uint8_t pos, uint8_t* bssid)
958958
// Wait for connection or timeout:
959959
_status = WL_IDLE_STATUS;
960960
unsigned long start = millis();
961-
while (!(_status & WL_SCAN_COMPLETED) && millis() - start < 2000) {
961+
while ((_status != WL_SCAN_COMPLETED) && millis() - start < 2000) {
962962
m2m_wifi_handle_events(NULL);
963963
}
964964

0 commit comments

Comments
 (0)