Skip to content

Commit 3fa2807

Browse files
JAndrassySuGlider
andauthored
WiFiSTA - new status constant WL_STOPPED (#8849)
to change initial WiFi.status() because WL_NO_SHIELD is checked in any generic Arduino WiFi example Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
1 parent a9a72d1 commit 3fa2807

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
10491049
log_e("esp_wifi_set_ps failed");
10501050
}
10511051
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_STOP) {
1052-
WiFiSTAClass::_setStatus(WL_NO_SHIELD);
1052+
WiFiSTAClass::_setStatus(WL_STOPPED);
10531053
clearStatusBits(STA_STARTED_BIT | STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT);
10541054
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_CONNECTED) {
10551055
WiFiSTAClass::_setStatus(WL_IDLE_STATUS);

Diff for: libraries/WiFi/src/WiFiSTA.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ wifi_auth_mode_t WiFiSTAClass::_minSecurity = WIFI_AUTH_WPA2_PSK;
123123
wifi_scan_method_t WiFiSTAClass::_scanMethod = WIFI_FAST_SCAN;
124124
wifi_sort_method_t WiFiSTAClass::_sortMethod = WIFI_CONNECT_AP_BY_SIGNAL;
125125

126-
static wl_status_t _sta_status = WL_NO_SHIELD;
126+
static wl_status_t _sta_status = WL_STOPPED;
127127
static EventGroupHandle_t _sta_status_group = NULL;
128128

129129
void WiFiSTAClass::_setStatus(wl_status_t status)

Diff for: libraries/WiFi/src/WiFiType.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
typedef enum {
4343
WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library
44+
WL_STOPPED = 254,
4445
WL_IDLE_STATUS = 0,
4546
WL_NO_SSID_AVAIL = 1,
4647
WL_SCAN_COMPLETED = 2,

0 commit comments

Comments
 (0)