![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork with SeeedStudio Xadow GPS v2 enabled
Dependencies: FXOS8700CQ MODSERIAL XadowGPS mbed
Fork of Avnet_ATT_Cellular_IOT by
Diff: wnc_control.cpp
- Revision:
- 44:c95a85b5cf92
- Parent:
- 43:6821a9c78c4b
- Child:
- 45:a836eecd5d12
--- a/wnc_control.cpp Sun Jul 24 16:58:17 2016 +0000 +++ b/wnc_control.cpp Sun Jul 24 17:45:30 2016 +0000 @@ -135,9 +135,6 @@ { unsigned n = 0; - // Clean slate: - sockData->erase(); - if (socketOpen == 1) { do @@ -156,7 +153,10 @@ } while (WNC_MDM_ERR == WNC_NO_RESPONSE); } else + { puts("Socket is closed for read\r\n"); + sockData->erase(); + } return (n); } @@ -269,11 +269,13 @@ { if (check_wnc_ready() < 0) { + static string noRespStr(""); string truncStr(s, 50); pc.puts("FAIL send cmd: "); pc.puts(truncStr.c_str()); pc.puts("\r\n"); WNC_MDM_ERR = WNC_NO_RESPONSE; + *r = &noRespStr; return (-2); } @@ -477,6 +479,9 @@ string * pRespStr; string cmd_str("AT@SOCKREAD=1,"); + // Clean slate + pS->erase(); + if (n <= 1500) { char num2str[6];