cpu/esp8266: simplified error handling in esp_wifi
wifi_station_connect and wifi_stattion_disconnect never produce errors. Thus, error handling can be removed.
This commit is contained in:
parent
3225aaa387
commit
c5a9058ab9
@ -207,18 +207,14 @@ static void _esp_wifi_handle_event_cb(System_Event_t *evt)
|
|||||||
_esp_wifi_dev.state = ESP_WIFI_DISCONNECTED;
|
_esp_wifi_dev.state = ESP_WIFI_DISCONNECTED;
|
||||||
|
|
||||||
/* call disconnect to reset internal state */
|
/* call disconnect to reset internal state */
|
||||||
if (!wifi_station_disconnect()) {
|
if (evt->event_info.disconnected.reason != REASON_ASSOC_LEAVE) {
|
||||||
ESP_WIFI_LOG_ERROR("could not disconnect from to AP %s",
|
wifi_station_disconnect();
|
||||||
ESP_WIFI_SSID);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to reconnect */
|
/* try to reconnect */
|
||||||
if (!wifi_station_connect()) {
|
wifi_station_connect();
|
||||||
ESP_WIFI_LOG_ERROR("could not start connection to AP %s",
|
_esp_wifi_dev.state = ESP_WIFI_CONNECTING;
|
||||||
ESP_WIFI_SSID);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -574,10 +570,8 @@ static void _esp_wifi_setup(void)
|
|||||||
wifi_set_event_handler_cb(_esp_wifi_handle_event_cb);
|
wifi_set_event_handler_cb(_esp_wifi_handle_event_cb);
|
||||||
|
|
||||||
/* connect */
|
/* connect */
|
||||||
if (!wifi_station_connect()) {
|
wifi_station_connect();
|
||||||
ESP_WIFI_LOG_ERROR("could not start connection to AP %s", ESP_WIFI_SSID);
|
_esp_wifi_dev.state = ESP_WIFI_CONNECTING;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user