Skip to content
Merged
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
2 changes: 1 addition & 1 deletion components/wifi/esp8266-driver/ESP8266Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int ESP8266Interface::disconnect()
{
_initialized = false;

if (_conn_stat == NSAPI_STATUS_DISCONNECTED)
if (_conn_stat == NSAPI_STATUS_DISCONNECTED || !get_ip_address())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it happenned that get_ip_address() was false, even though _conn_stat was not DISCONNECTED.
But is the reverse situation possible? Can get_ip_address() return true when _conn_stat is DISCONNECTED?
Perhaps there is no point checking the _conn_stat here?

Copy link
Contributor Author

@VeijoPesonen VeijoPesonen Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the modem isn't powered on this prevent's the situation that AT parser's recv function sits there for the length of ESP8266_RECV_TIMEOUT waiting for an answer to the request. Adding a comment about this would probably have been a good idea

{
return NSAPI_ERROR_NO_CONNECTION;
}
Expand Down