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>
This commit is contained in:
parent
a9a72d1fdc
commit
3fa2807aad
3 changed files with 3 additions and 2 deletions
|
|
@ -1049,7 +1049,7 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
|
|||
log_e("esp_wifi_set_ps failed");
|
||||
}
|
||||
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_STOP) {
|
||||
WiFiSTAClass::_setStatus(WL_NO_SHIELD);
|
||||
WiFiSTAClass::_setStatus(WL_STOPPED);
|
||||
clearStatusBits(STA_STARTED_BIT | STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT);
|
||||
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_CONNECTED) {
|
||||
WiFiSTAClass::_setStatus(WL_IDLE_STATUS);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ wifi_auth_mode_t WiFiSTAClass::_minSecurity = WIFI_AUTH_WPA2_PSK;
|
|||
wifi_scan_method_t WiFiSTAClass::_scanMethod = WIFI_FAST_SCAN;
|
||||
wifi_sort_method_t WiFiSTAClass::_sortMethod = WIFI_CONNECT_AP_BY_SIGNAL;
|
||||
|
||||
static wl_status_t _sta_status = WL_NO_SHIELD;
|
||||
static wl_status_t _sta_status = WL_STOPPED;
|
||||
static EventGroupHandle_t _sta_status_group = NULL;
|
||||
|
||||
void WiFiSTAClass::_setStatus(wl_status_t status)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
typedef enum {
|
||||
WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library
|
||||
WL_STOPPED = 254,
|
||||
WL_IDLE_STATUS = 0,
|
||||
WL_NO_SSID_AVAIL = 1,
|
||||
WL_SCAN_COMPLETED = 2,
|
||||
|
|
|
|||
Loading…
Reference in a new issue