Ethernet-based network support for mbedConnectorInterface.
Dependencies: libnsdl EthernetInterface mbed-rtos
Dependents: IoT_LED_demo ServoTest uWater_Project hackathon ... more
Diff: network_stubs/network_stubs.cpp
- Revision:
- 6:c8ac3efd53cf
- Parent:
- 3:3e1ad8ab5071
--- a/network_stubs/network_stubs.cpp Tue Feb 03 15:31:44 2015 +0000 +++ b/network_stubs/network_stubs.cpp Fri Feb 06 04:18:08 2015 +0000 @@ -25,34 +25,33 @@ extern "C" { // plumb out the network -void net_stubs_plumb_network(bool canActAsRouterNode) +void net_stubs_pre_plumb_network(bool canActAsRouterNode) +{ + // we have to defer all Ethernet until we are configured.. + ; +} + +// called after the endpoint is configured... +void net_stubs_post_plumb_network(void) { // ethernet initialize ethernet.init(); // DHCP ethernet.connect(); // connect // our IP address - DBG("Ethernet Address: %s\r\n",ethernet.getIPAddress()); - - // initialize NSDL - DBG("initNetwork: initializing NSP..\r\n."); - nsdl_init(); + DBG("net_stubs_post_plumb_network: Ethernet Address: %s\r\n",ethernet.getIPAddress()); } // create a suitable main event loop for this specific network void net_stubs_create_main_loop(void) { - // we simply configure the endpoint - DBG("initNetwork: configuring endpoint...\r\n"); - configure_endpoint(); + // nothing to do for Ethernet endpoints - we are using the Threaded loop in nsdl_support.cpp + ; } // register the endpoint void net_stubs_register_endpoint(void) { - // rewrite the NSP address info - nsdl_set_nsp_address(); - // NSP registration DBG("net_stubs_register_endpoint: calling NSP registration...\r\n"); register_endpoint(true);