Ethernet-based network support for mbedConnectorInterface.
Dependencies: libnsdl EthernetInterface mbed-rtos
Dependents: IoT_LED_demo ServoTest uWater_Project hackathon ... more
Revision 6:c8ac3efd53cf, committed 2015-02-06
- Comitter:
- ansond
- Date:
- Fri Feb 06 04:18:08 2015 +0000
- Parent:
- 5:649bf7436673
- Child:
- 7:ee88023ff81e
- Commit message:
- updates for underlying re-org
Changed in this revision
--- a/mbedEndpointNetworkStubs.h Tue Feb 03 15:31:44 2015 +0000 +++ b/mbedEndpointNetworkStubs.h Fri Feb 06 04:18:08 2015 +0000 @@ -33,9 +33,14 @@ #define DBG printf // Linkage to the lower network APIs and interfaces - extern "C" void net_stubs_plumb_network(bool canActAsRouterNode); + extern "C" void net_stubs_pre_plumb_network(bool canActAsRouterNode); // before endpoint is configured... + extern "C" void net_stubs_post_plumb_network(void); // after endpoint is configured... extern "C" void net_stubs_create_main_loop(void); extern "C" void net_stubs_register_endpoint(); extern "C" void net_stubs_begin_main_loop(void); + // Utils.cpp functions... + extern void utils_configure_endpoint(void); + extern void utils_init_and_register_endpoint(void); + #endif // __MBED_ENDPOINT_NETWORK_STUBS_H__ \ No newline at end of file
--- 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);