Skip to content

Fix ESP8266 "Link Type" errors after reset #9130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions components/wifi/esp8266-driver/ESP8266Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ int ESP8266Interface::connect()
return NSAPI_ERROR_IS_CONNECTED;
}

status = _startup(ESP8266::WIFIMODE_STATION);
if (status != NSAPI_ERROR_OK) {
return status;
}

if (!_esp.dhcp(true, 1)) {
return NSAPI_ERROR_DHCP_FAILURE;
}
Expand Down Expand Up @@ -315,11 +310,6 @@ int ESP8266Interface::scan(WiFiAccessPoint *res, unsigned count)
return status;
}

status = _startup(ESP8266::WIFIMODE_STATION);
if (status != NSAPI_ERROR_OK) {
return status;
}

return _esp.scan(res, count);
}

Expand Down Expand Up @@ -370,6 +360,9 @@ nsapi_error_t ESP8266Interface::_init(void)
if (!_esp.cond_enable_tcp_passive_mode()) {
return NSAPI_ERROR_DEVICE_ERROR;
}
if (!_esp.startup(ESP8266::WIFIMODE_STATION)) {
return NSAPI_ERROR_DEVICE_ERROR;
}

_initialized = true;
}
Expand All @@ -385,16 +378,6 @@ void ESP8266Interface::_hw_reset()
_rst_pin.rst_deassert();
}

nsapi_error_t ESP8266Interface::_startup(const int8_t wifi_mode)
{
if (_conn_stat == NSAPI_STATUS_DISCONNECTED) {
if (!_esp.startup(wifi_mode)) {
return NSAPI_ERROR_DEVICE_ERROR;
}
}
return NSAPI_ERROR_OK;
}

struct esp8266_socket {
int id;
nsapi_protocol_t proto;
Expand Down
1 change: 0 additions & 1 deletion components/wifi/esp8266-driver/ESP8266Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface {
bool _get_firmware_ok();
nsapi_error_t _init(void);
void _hw_reset();
nsapi_error_t _startup(const int8_t wifi_mode);

//sigio
struct {
Expand Down