Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of WncControllerLibrary by
Diff: WncController.cpp
- Revision:
- 29:69ada8524b4a
- Parent:
- 28:eece2151e1e5
- Child:
- 30:98c9ff850c1b
--- a/WncController.cpp Fri Sep 23 03:14:34 2016 +0000
+++ b/WncController.cpp Fri Sep 23 05:00:00 2016 +0000
@@ -1681,8 +1681,19 @@
string cmd_str("AT@SOCKCLOSE=");
cmd_str += _to_string(numSock);
+
// Don't check the cell status to close the socket
- return (WNC_AT_CMD_OK == at_send_wnc_cmd(cmd_str.c_str(), &pRespStr, m_sCmdTimeoutMs));
+ AtCmdErr_e res = at_send_wnc_cmd(cmd_str.c_str(), &pRespStr, m_sCmdTimeoutMs);
+
+ if ((res != WNC_AT_CMD_TIMEOUT) && (res != WNC_AT_CMD_OK)) {
+ for (unsigned i = 0; i < WNC_SOCK_CLOSE_RETRY_CNT; i++) {
+ res = at_send_wnc_cmd(cmd_str.c_str(), &pRespStr, m_sCmdTimeoutMs);
+ if ((res == WNC_AT_CMD_TIMEOUT) || (res == WNC_AT_CMD_OK))
+ break;
+ }
+ }
+
+ return (res == WNC_AT_CMD_OK);
}
bool WncController::at_dnsresolve_wnc(const char * s, string * ipStr)
