
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 57:bb3eca53b307, committed 2017-01-26
- Comitter:
- mbed_official
- Date:
- Thu Jan 26 12:00:10 2017 +0000
- Parent:
- 56:785a82d75f1f
- Child:
- 58:e5468bc5bf9a
- Commit message:
- Merge pull request #166 from ARMmbed/memory_optimizations
Make example compatible with memory optimizations change
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-client
Changed in this revision
mbed-client.lib | 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/mbed-client.lib Tue Jan 17 12:15:09 2017 +0000 +++ b/mbed-client.lib Thu Jan 26 12:00:10 2017 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-client/#92bdf6a699581679fcefeb986d1008fc59d0fb03 +https://github.com/ARMmbed/mbed-client/#c767032d7ad708a6684bd7fb5ad8379966dedb49
--- a/simpleclient.h Tue Jan 17 12:15:09 2017 +0000 +++ b/simpleclient.h Thu Jan 26 12:00:10 2017 +0000 @@ -55,11 +55,11 @@ //Select binding mode: UDP or TCP -- note - Mesh networking is IPv6 UDP ONLY #ifdef MESH - M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP; + M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP; #else - // WiFi or Ethernet supports both - TCP by default to avoid - // NAT problems, but UDP will also work - IF you configure - // your network right. + // WiFi or Ethernet supports both - TCP by default to avoid + // NAT problems, but UDP will also work - IF you configure + // your network right. M2MInterface::BindingMode SOCKET_MODE = M2MInterface::TCP; #endif @@ -316,10 +316,11 @@ */ void value_updated(M2MBase *base, M2MBase::BaseType type) { printf("\r\nPUT Request Received!"); - printf("\r\nName :'%s', \r\nType : '%d' (0 for Object, 1 for Resource), \r\nType : '%s'\r\n", - base->name().c_str(), + printf("\r\nName :'%s', \r\nPath : '%s', \r\nType : '%d' (0 for Object, 1 for Resource), \r\nType : '%s'\r\n", + base->name(), + base->uri_path(), type, - base->resource_type().c_str() + base->resource_type() ); }