Skip to content

ESP8266: Fixes AT-layer socket_open-functions #9284

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 9, 2019
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
14 changes: 4 additions & 10 deletions components/wifi/esp8266-driver/ESP8266/ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,7 @@ nsapi_error_t ESP8266::open_udp(int id, const char *addr, int port, int local_po
_sock_already = false; // To be raised again by OOB msg
done = close(id);
if (!done) {
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CLOSE_FAILED), \
"ESP8266::_open_udp: device refused to close socket");
break;
}
}
if (_error) {
Expand All @@ -491,9 +490,7 @@ nsapi_error_t ESP8266::open_udp(int id, const char *addr, int port, int local_po

_smutex.unlock();

if (done) {
tr_debug("UDP socket %d opened", id);
}
tr_debug("UDP socket %d opened: %s", id, (_sock_i[id].open ? "true" : "false"));

return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
}
Expand Down Expand Up @@ -526,8 +523,7 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv
_sock_already = false; // To be raised again by OOB msg
done = close(id);
if (!done) {
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CLOSE_FAILED), \
"ESP8266::_open_tcp: device refused to close socket");
break;
}
}
if (_error) {
Expand All @@ -545,9 +541,7 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv

_smutex.unlock();

if (done) {
tr_debug("TCP socket %d opened", id);
}
tr_debug("TCP socket %d opened: %s", id, (_sock_i[id].open ? "true" : "false"));

return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
}
Expand Down