31
31
// Select binding mode: UDP or TCP
32
32
M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP;
33
33
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
37
36
38
37
struct MbedClientDevice {
39
38
const char * Manufacturer;
@@ -44,7 +43,7 @@ struct MbedClientDevice {
44
43
45
44
/*
46
45
* 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.
48
47
*
49
48
* The end user should only have to care about configuring the parameters at the
50
49
* top of this file and making sure they add the security.h file correctly.
@@ -88,7 +87,7 @@ class MbedClient: public M2MInterfaceObserver {
88
87
* setup its name, resource type, life time, connection mode,
89
88
* Currently only LwIPv4 is supported.
90
89
*/
91
- void create_interface (const String & server_address,
90
+ void create_interface (const char * server_address,
92
91
void *handler=NULL ) {
93
92
// Randomizing listening port for Certificate mode connectivity
94
93
_server_address = server_address;
@@ -97,18 +96,17 @@ class MbedClient: public M2MInterfaceObserver {
97
96
98
97
// create mDS interface object, this is the base object everything else attaches to
99
98
_interface = M2MInterfaceFactory::create_interface (*this ,
100
- ENDPOINT_NAME, // endpoint name string
99
+ MBED_ENDPOINT_NAME, // endpoint name string
101
100
" test" , // endpoint type string
102
101
100 , // lifetime
103
102
port, // listen port
104
- MBED_USER_NAME_DOMAIN, // domain string
103
+ MBED_DOMAIN, // domain string
105
104
SOCKET_MODE, // binding mode
106
105
M2MInterface::LwIP_IPv4, // network stack
107
106
" " ); // 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);
112
110
113
111
if (_interface) {
114
112
_interface->set_platform_network_handler (handler);
0 commit comments