This library controls the WNC. There is a derived class for usage from the K64F board.

Fork of WncControllerLibrary by Fred Kellerman

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)