mbed Connector Endpoint interface. This interface permits a mbed endpoint to easily setup MDS resources and emit those resources to an MDS server.

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Revision:
12:c068a2d3e8fe
Parent:
9:d094cfc650c3
Child:
13:b0b2f1ae4c30
--- a/api/ConnectorEndpoint.cpp	Mon Feb 02 06:12:17 2015 +0000
+++ b/api/ConnectorEndpoint.cpp	Mon Feb 02 06:36:58 2015 +0000
@@ -56,6 +56,9 @@
 // initialize the endpoint
 void Endpoint::initialize()
 {
+    // initialize NSDL
+    nsdl_init();
+    
     // Create the NSDL Resource Pointer...
     this->logger()->log("Endpoint::initialize(): initializing NSP resource pointer...");
     sn_nsdl_resource_info_s *resource_ptr = (sn_nsdl_resource_info_s*)nsdl_alloc(sizeof(sn_nsdl_resource_info_s));
@@ -85,23 +88,14 @@
         dynamic_resources->at(i)->bind(resource_ptr);
     }
 
-    // initialize the Network
-    this->initNetwork();
+    // register the endpoint
+    net_stubs_register_endpoint();
 
     // clean up
     nsdl_free(resource_ptr->resource_parameters_ptr);
     nsdl_free(resource_ptr);
 }
 
-// initialize the NSDL Network
-void Endpoint::initNetwork()
-{
-    // register with NSP through our lower network stubs...
-    this->logger()->log("initNetwork: calling NSP registration...");
-    net_stubs_register_endpoint();
-    this->logger()->log("initNetwork: NSP registration completed");
-}
-
 // Finalize the endpoint's configuration and begin the endpoint's main even loop (static, not tied into Logger)
 void Endpoint::start()
 {