Skip to content

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.
_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