Skip to content

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

Merged
merged 1 commit into from
Jan 15, 2019
Merged

ESP8266 - fixes disconnect to check the state from modem #9356

merged 1 commit into from
Jan 15, 2019

Conversation

VeijoPesonen
Copy link
Contributor

Description

Additionally to internal bookkeeping lets check from the modem
that what is connection state in disconnect. There might be
inconsistencies.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@ARMmbed/mbed-os-ipcore

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())
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

@ciarmcom ciarmcom requested review from a team January 11, 2019 16:00
@ciarmcom
Copy link
Member

@VeijoPesonen, thank you for your changes.
@ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 14, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 14, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit a180d69 into ARMmbed:master Jan 15, 2019
@VeijoPesonen VeijoPesonen deleted the bugfix-esp8266_disconnect_return_code branch January 22, 2019 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants