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 GPRSInterface by
Revision 8:180feb3ebe62, committed 2014-05-06
- Comitter:
- lawliet
- Date:
- Tue May 06 03:56:03 2014 +0000
- Parent:
- 7:1bdcfd6da2d0
- Child:
- 9:5afc5b4e2df8
- Commit message:
- update gprs send function
Changed in this revision
| GPRS/GPRS.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/GPRS/GPRS.cpp Tue May 06 03:50:21 2014 +0000
+++ b/GPRS/GPRS.cpp Tue May 06 03:56:03 2014 +0000
@@ -224,19 +224,15 @@
if (socket < 0 || socket > MAX_SOCK_NUM-1) {
return -1;
}
-
char cmd[32];
- char resp[16];
wait(1);
if(len > 0){
- snprintf(cmd,sizeof(cmd),"AT+CIPSEND=%d,%d\r\n",socket,len);
- if(0 != sendCmdAndWaitForResp(cmd,">",DEFAULT_TIMEOUT,CMD)) {
+ snprintf(cmd,sizeof(cmd),"AT+CIPSEND=%d\r\n",socket);
+ if(0 != sendCmdAndWaitForResp(cmd,">",2,CMD)) {
return false;
}
- snprintf(resp,sizeof(resp),"%d, SEND OK",socket);
- if(0 != sendCmdAndWaitForResp(str,resp,DEFAULT_TIMEOUT,DATA)) {
- return -1;
- }
+ sendCmd(str);
+ serialModem.putc((char)0x1a);
}
return len;
}