Add a bunch of APNs
Fork of C027_Support by
Diff: MDM.cpp
- Revision:
- 121:8ce8a465de06
- Parent:
- 120:eb1902489fdd
--- a/MDM.cpp Tue Mar 03 14:05:59 2015 +0000 +++ b/MDM.cpp Thu Mar 05 15:28:44 2015 +0000 @@ -1107,16 +1107,23 @@ #endif Timer timer; timer.start(); + puts("MDM: sockRecving"); while (len) { + putchar('a'); int blk = MAX_SIZE; // still need space for headers and unsolicited commands if (len < blk) blk = len; bool ok = false; LOCK(); if (ISSOCKET(socket)) { + putchar('s'); if (_sockets[socket].connected) { - if (_sockets[socket].pending < blk) + putchar('c'); + if (_sockets[socket].pending < blk) { blk = _sockets[socket].pending; + putchar('p'); + } if (blk > 0) { + putchar('b'); sendFormated("AT+USORD=%d,%d\r\n",_sockets[socket].handle, blk); if (RESP_OK == waitFinalResp(_cbUSORD, buf)) { _sockets[socket].pending -= blk; @@ -1124,16 +1131,20 @@ cnt += blk; buf += blk; ok = true; + putchar('r'); } } else if (!TIMEOUT(timer, _sockets[socket].timeout_ms)) { ok = (WAIT == waitFinalResp(NULL,NULL,0)); // wait for URCs + putchar('w'); } else { len = 0; ok = true; + putchar('e'); } } else { len = 0; ok = true; + putchar('o'); } } UNLOCK();