Ethernet-based network support for mbedConnectorInterface.

Dependencies:   libnsdl EthernetInterface mbed-rtos

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Revision:
3:3e1ad8ab5071
Parent:
2:c7a1aad25a18
Child:
6:c8ac3efd53cf
diff -r c7a1aad25a18 -r 3e1ad8ab5071 network_stubs/network_stubs.cpp
--- a/network_stubs/network_stubs.cpp	Mon Feb 02 06:37:09 2015 +0000
+++ b/network_stubs/network_stubs.cpp	Mon Feb 02 07:02:04 2015 +0000
@@ -33,6 +33,10 @@
      
      // our IP address
      DBG("Ethernet Address: %s\r\n",ethernet.getIPAddress());
+     
+     // initialize NSDL
+     DBG("initNetwork: initializing NSP..\r\n.");
+     nsdl_init();
 }
 
 // create a suitable main event loop for this specific network
@@ -40,20 +44,19 @@
 {
     // we simply configure the endpoint
     DBG("initNetwork: configuring endpoint...\r\n");
-    configure_endpoint();
+    configure_endpoint();    
 }
 
 // register the endpoint
 void net_stubs_register_endpoint(void)
 {
-    // initialize NSDL
-    DBG("initNetwork: initializing NSP..\r\n.");
-    nsdl_init();
+    // rewrite the NSP address info
+    nsdl_set_nsp_address();
 
     // NSP registration
-    DBG("initNetwork: calling NSP registration...\r\n");
+    DBG("net_stubs_register_endpoint: calling NSP registration...\r\n");
     register_endpoint(true);
-    DBG("initNetwork: NSP registration completed\r\n");
+    DBG("net_stubs_register_endpoint: NSP registration completed\r\n");
 }
 
 // begin the main loop for processing network events