35
35
#include " ESP8266Interface.h"
36
36
ESP8266Interface esp (D1, D0);
37
37
#elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET
38
- #include " LWIPInterface .h"
39
- LWIPInterface lwip ;
38
+ #include " EthernetInterface .h"
39
+ EthernetInterface eth ;
40
40
#elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND
41
41
#define MESH
42
42
#include " NanostackInterface.h"
@@ -252,31 +252,31 @@ int main() {
252
252
mbed_trace_init ();
253
253
mbed_trace_print_function_set (trace_printer);
254
254
255
- NetworkStack *network_stack = 0 ;
255
+ NetworkInterface *network_interface = 0 ;
256
256
int connect_success = -1 ;
257
257
#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI
258
258
output.printf (" \n\r Using WiFi \r\n " );
259
259
output.printf (" \n\r Connecting to WiFi..\r\n " );
260
260
connect_success = esp.connect (MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD);
261
- network_stack = &esp;
261
+ network_interface = &esp;
262
262
#elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET
263
- output.printf (" Using Ethernet LWIP \r\n " );
264
- connect_success = lwip .connect ();
265
- network_stack = &lwip ;
263
+ output.printf (" Using Ethernet\r\n " );
264
+ connect_success = eth .connect ();
265
+ network_interface = ð ;
266
266
#endif
267
267
#ifdef MESH
268
268
output.printf (" Using Mesh\r\n " );
269
269
output.printf (" \n\r Connecting to Mesh..\r\n " );
270
270
connect_success = mesh.connect ();
271
- network_stack = &mesh;
271
+ network_interface = &mesh;
272
272
#endif
273
273
if (connect_success == 0 ) {
274
274
output.printf (" \n\r Connected to Network successfully\r\n " );
275
275
} else {
276
276
output.printf (" \n\r Connection to Network Failed %d! Exiting application....\r\n " , connect_success);
277
277
return 0 ;
278
278
}
279
- const char *ip_addr = network_stack ->get_ip_address ();
279
+ const char *ip_addr = network_interface ->get_ip_address ();
280
280
if (ip_addr) {
281
281
output.printf (" IP address %s\r\n " , ip_addr);
282
282
} else {
@@ -296,7 +296,7 @@ int main() {
296
296
obs_button.fall (&button_clicked);
297
297
298
298
// Create endpoint interface to manage register and unregister
299
- mbed_client.create_interface (MBED_SERVER_ADDRESS, network_stack );
299
+ mbed_client.create_interface (MBED_SERVER_ADDRESS, network_interface );
300
300
301
301
// Create Objects of varying types, see simpleclient.h for more details on implementation.
302
302
M2MSecurity* register_object = mbed_client.create_register_object (); // server object specifying connector info
0 commit comments