Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit fb1e5d9

Browse files
committed
Bring in the latest NSAPI changes
Pull up on mbed-os to bring in NSAPI changes. Add the esp8266 library since this is no longer in mbed-os. Update main.cpp to use new NetworkInterface rather than NetworkStack.
1 parent e77ee4c commit fb1e5d9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Diff for: esp8266-driver.lib

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/ARMmbed/esp8266-driver/#636af254ddfee68e83cd550e5184e253efa469a0

Diff for: main.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
#include "ESP8266Interface.h"
3636
ESP8266Interface esp(D1, D0);
3737
#elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET
38-
#include "LWIPInterface.h"
39-
LWIPInterface lwip;
38+
#include "EthernetInterface.h"
39+
EthernetInterface eth;
4040
#elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND
4141
#define MESH
4242
#include "NanostackInterface.h"
@@ -252,31 +252,31 @@ int main() {
252252
mbed_trace_init();
253253
mbed_trace_print_function_set(trace_printer);
254254

255-
NetworkStack *network_stack = 0;
255+
NetworkInterface *network_interface = 0;
256256
int connect_success = -1;
257257
#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI
258258
output.printf("\n\rUsing WiFi \r\n");
259259
output.printf("\n\rConnecting to WiFi..\r\n");
260260
connect_success = esp.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD);
261-
network_stack = &esp;
261+
network_interface = &esp;
262262
#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 = ð
266266
#endif
267267
#ifdef MESH
268268
output.printf("Using Mesh\r\n");
269269
output.printf("\n\rConnecting to Mesh..\r\n");
270270
connect_success = mesh.connect();
271-
network_stack = &mesh;
271+
network_interface = &mesh;
272272
#endif
273273
if(connect_success == 0) {
274274
output.printf("\n\rConnected to Network successfully\r\n");
275275
} else {
276276
output.printf("\n\rConnection to Network Failed %d! Exiting application....\r\n", connect_success);
277277
return 0;
278278
}
279-
const char *ip_addr = network_stack->get_ip_address();
279+
const char *ip_addr = network_interface->get_ip_address();
280280
if (ip_addr) {
281281
output.printf("IP address %s\r\n", ip_addr);
282282
} else {
@@ -296,7 +296,7 @@ int main() {
296296
obs_button.fall(&button_clicked);
297297

298298
// 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);
300300

301301
// Create Objects of varying types, see simpleclient.h for more details on implementation.
302302
M2MSecurity* register_object = mbed_client.create_register_object(); // server object specifying connector info

Diff for: mbed-os.lib

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#bd4bfce7a2c8fec8325dbe768ddc43bec2f09c88
1+
https://github.com/ARMmbed/mbed-os/#c55c09ab21d243279f2370fc0483cc479b9d1262

0 commit comments

Comments
 (0)