3131// Select binding mode: UDP or TCP
3232M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP;
3333
34- // These come from the security.h file copied from connector.mbed.com
35- const String &MBED_USER_NAME_DOMAIN = MBED_DOMAIN;
36- const String &ENDPOINT_NAME = MBED_ENDPOINT_NAME;
34+ // MBED_DOMAIN and MBED_ENDPOINT_NAME come
35+ // from the security.h file copied from connector.mbed.com
3736
3837struct MbedClientDevice {
3938 const char * Manufacturer;
@@ -44,7 +43,7 @@ struct MbedClientDevice {
4443
4544/*
4645* Wrapper for mbed client stack that handles all callbacks, error handling, and
47- * other schenanigans to make the mbed client stack easier to use.
46+ * other shenanigans to make the mbed client stack easier to use.
4847*
4948* The end user should only have to care about configuring the parameters at the
5049* top of this file and making sure they add the security.h file correctly.
@@ -88,7 +87,7 @@ class MbedClient: public M2MInterfaceObserver {
8887 * setup its name, resource type, life time, connection mode,
8988 * Currently only LwIPv4 is supported.
9089 */
91- void create_interface (const String & server_address,
90+ void create_interface (const char * server_address,
9291 void *handler=NULL ) {
9392 // Randomizing listening port for Certificate mode connectivity
9493 _server_address = server_address;
@@ -97,18 +96,17 @@ class MbedClient: public M2MInterfaceObserver {
9796
9897 // create mDS interface object, this is the base object everything else attaches to
9998 _interface = M2MInterfaceFactory::create_interface (*this ,
100- ENDPOINT_NAME, // endpoint name string
99+ MBED_ENDPOINT_NAME, // endpoint name string
101100 " test" , // endpoint type string
102101 100 , // lifetime
103102 port, // listen port
104- MBED_USER_NAME_DOMAIN, // domain string
103+ MBED_DOMAIN, // domain string
105104 SOCKET_MODE, // binding mode
106105 M2MInterface::LwIP_IPv4, // network stack
107106 " " ); // context address string
108- String binding_mode;
109- (SOCKET_MODE == M2MInterface::UDP) ? binding_mode = " UDP" : binding_mode = " TCP" ;
110- printf (" \r\n SOCKET_MODE : %s\r\n " , binding_mode.c_str ());
111- printf (" Connecting to %s\r\n " , _server_address.c_str ());
107+ const char *binding_mode = (SOCKET_MODE == M2MInterface::UDP) ? " UDP" : " TCP" ;
108+ printf (" \r\n SOCKET_MODE : %s\r\n " , binding_mode);
109+ printf (" Connecting to %s\r\n " , server_address);
112110
113111 if (_interface) {
114112 _interface->set_platform_network_handler (handler);
0 commit comments