-
Notifications
You must be signed in to change notification settings - Fork 3k
ESP8266 - fixes disconnect to check the state from modem #9356
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
ESP8266 - fixes disconnect to check the state from modem #9356
Conversation
Additionally to internal bookkeeping lets check from the modem that what is connection state in disconnect. There might be inconsistencies.
@@ -246,7 +246,7 @@ int ESP8266Interface::disconnect() | |||
{ | |||
_initialized = false; | |||
|
|||
if (_conn_stat == NSAPI_STATUS_DISCONNECTED) | |||
if (_conn_stat == NSAPI_STATUS_DISCONNECTED || !get_ip_address()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@VeijoPesonen, thank you for your changes. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Additionally to internal bookkeeping lets check from the modem
that what is connection state in disconnect. There might be
inconsistencies.
Pull request type
Reviewers
@ARMmbed/mbed-os-ipcore