
This is a simple mbed client example demonstrating, registration of a device with mbed Device Connector and reading and writing values as well as deregistering on different Network Interfaces including Ethernet, WiFi, 6LoWPAN ND and Thread respectively.
Fork of mbed-os-example-client by
Revision 37:9a9428fc4b26, committed 2016-12-02
- Comitter:
- mbed_official
- Date:
- Fri Dec 02 08:45:12 2016 +0000
- Parent:
- 36:bfb6816a677c
- Child:
- 38:684673708ad1
- Commit message:
- Switch the default transport-mode to TCP
The UDP tends to be quite unreliable with IPv4 and NAT and this
can give bad experience for new users. We should default to TCP
to provide more stable platform for testing the capabilities.
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-client
Changed in this revision
README.md | Show annotated file Show diff for this revision Revisions of this file |
simpleclient.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/README.md Tue Nov 29 12:30:11 2016 +0000 +++ b/README.md Fri Dec 02 08:45:12 2016 +0000 @@ -238,12 +238,12 @@ ### Changing socket type -Your device can connect to mbed Device Connector via UDP or TCP binding mode. The default is UDP. The binding mode cannot be changed in 6LoWPAN ND or Thread mode. +Your device can connect to mbed Device Connector via UDP or TCP binding mode. The default is TCP. The binding mode cannot be changed in 6LoWPAN ND or Thread mode. To change the binding mode: -1. In the `simpleclient.h` file, find the parameter `SOCKET_MODE`. The default is `M2MInterface::UDP`. -1. To switch to TCP, change it to `M2MInterface::TCP`. +1. In the `simpleclient.h` file, find the parameter `SOCKET_MODE`. The default is `M2MInterface::TCP`. +1. To switch to UDP, change it to `M2MInterface::UDP`. 1. Rebuild and flash the application. <span class="tips">**Tip:** The instructions in this document remain the same, irrespective of the socket mode you select.</span>
--- a/simpleclient.h Tue Nov 29 12:30:11 2016 +0000 +++ b/simpleclient.h Fri Dec 02 08:45:12 2016 +0000 @@ -42,7 +42,7 @@ M2MInterface::NetworkStack NETWORK_STACK = M2MInterface::LwIP_IPv4; //Select binding mode: UDP or TCP -M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP; +M2MInterface::BindingMode SOCKET_MODE = M2MInterface::TCP; // MBED_DOMAIN and MBED_ENDPOINT_NAME come