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.
Revision 3:4041e2cc0f19, committed 2019-04-05
- Comitter:
- hkjung
- Date:
- Fri Apr 05 07:32:43 2019 +0000
- Parent:
- 2:46cc35700e0e
- Commit message:
- Added TCP loopback
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Mar 20 05:31:05 2019 +0000
+++ b/main.cpp Fri Apr 05 07:32:43 2019 +0000
@@ -203,8 +203,8 @@
myprintf("sockOpenConnect: success\r\n");
char sendbuf[] = "Hello Cat.M1\r\n";
- if(sendData_BG96(sendbuf, sizeof(sendbuf))) {
- myprintf("dataSend [%d] %s\r\n", sizeof(sendbuf), sendbuf);
+ if(sendData_BG96(sendbuf, strlen(sendbuf))) {
+ myprintf("dataSend [%d] %s\r\n", strlen(sendbuf), sendbuf);
}
} else {
@@ -227,6 +227,10 @@
if(recvData_BG96(recvbuf, &recvlen) == RET_OK) {
myprintf("dataRecv [%d] %s\r\n", recvlen, recvbuf);
+ // Loopback: Resend received data to TCP server
+ sendData_BG96(recvbuf, recvlen);
+ myprintf("dataSend [%d] %s\r\n", recvlen, recvbuf);
+
char * ptr = strstr(recvbuf, "exit");
if(ptr != 0) break;
}