Sarah Marsh
/
U_Blox_DeviceConnector
Example of C027 with connector
Fork of U_Blox_DeviceConnector by
Diff: simpleclient.h
- Revision:
- 32:7b3841243d70
- Parent:
- 31:218ca6b6fe19
- Child:
- 37:9a9428fc4b26
--- a/simpleclient.h Wed Nov 23 13:45:10 2016 +0000 +++ b/simpleclient.h Wed Nov 23 14:00:11 2016 +0000 @@ -103,10 +103,16 @@ */ void create_interface(const char *server_address, void *handler=NULL) { - // Set port to zero, network stack randomizes it then. + // Randomizing listening port for Certificate mode connectivity _server_address = server_address; - uint16_t port = 0; + uint16_t port = rand() % 65535 + 12345; + // In case of Mesh or Thread use M2MInterface::Nanostack_IPv6 +#if MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND + NETWORK_STACK = M2MInterface::Nanostack_IPv6; +#elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD + NETWORK_STACK = M2MInterface::Nanostack_IPv6; +#endif // create mDS interface object, this is the base object everything else attaches to _interface = M2MInterfaceFactory::create_interface(*this,