A simple project for sending button input up to AT&T Flow
Dependencies: FXOS8700CQ MODSERIAL mbed
For instructions on using this program, see the AT&T Starter Kit tutorial on it.
Diff: wnc_control.cpp
- Revision:
- 44:c95a85b5cf92
- Parent:
- 43:6821a9c78c4b
- Child:
- 45:a836eecd5d12
diff -r 6821a9c78c4b -r c95a85b5cf92 wnc_control.cpp --- 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];