This is an example based on mbed-os cellular APIs that demonstrates a TCP or UDP echo transaction with a public echo server.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Thu Sep 27 13:30:25 2018 +0100
Parent:
20:99e89c0a8f44
Child:
22:cf737b827270
Commit message:
Merge pull request #101 from ARMmbed/fix_tcpsocket_open_trace

Fix trace print for TCPSocket.open()
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Sep 14 12:30:21 2018 +0100
+++ b/main.cpp	Thu Sep 27 13:30:25 2018 +0100
@@ -158,7 +158,11 @@
 
     retcode = sock.open(iface);
     if (retcode != NSAPI_ERROR_OK) {
+#if MBED_CONF_APP_SOCK_TYPE == TCP
+        print_function("TCPSocket.open() fails, code: %d\n", retcode);
+#else
         print_function("UDPSocket.open() fails, code: %d\n", retcode);
+#endif
         return -1;
     }