use TCP to connect to mbed connector

Fork of mbedConnectorInterfaceWithDM by Doug Anson

Revision:
81:a2441163a06e
Parent:
77:cee832ba6dd0
Child:
83:8d856fa24fda
--- a/mbed-connector-interface/ConnectorEndpoint.h	Fri Nov 04 22:40:30 2016 +0000
+++ b/mbed-connector-interface/ConnectorEndpoint.h	Fri Nov 04 23:18:57 2016 +0000
@@ -49,7 +49,11 @@
 
 /** Endpoint class
  */
+#ifdef ENABLE_MBED_CLOUD_SUPPORT
+class Endpoint : public MbedCloudClientCallback, public M2MInterfaceObserver  {
+#else
 class Endpoint : public M2MInterfaceObserver  {
+#endif
 
 public:
     /**
@@ -100,6 +104,20 @@
 	// mbed-client : register the endpoint
 	void register_endpoint(M2MSecurity *server_instance, M2MObjectList resources);
 	
+#ifdef ENABLE_MBED_CLOUD_SUPPORT
+	//  mbed-cloud-client : object registered
+    static void on_registered();
+
+	//  mbed-cloud-client : registration updated
+	static void on_registration_updated() ;
+
+	//  mbed-cloud-client : object unregistered
+	static void on_unregistered();
+	
+	// mbed-cloud-client: error
+	static void on_error(int error_code);
+#endif
+
 	//  mbed-client : object registered
     virtual void object_registered(M2MSecurity *server_instance, const M2MServer &server);
 
@@ -130,10 +148,10 @@
 #else	
 	// get our Endpoint Interface
 	M2MInterface *getEndpointInterface();
-	
+#endif
+
 	// get our Endpoint Security
-	M2MSecurity *getEndpointSecurity();
-#endif
+	M2MSecurity *getSecurityInstance();
 	
 	// get our Endpoint Object List
 	M2MObjectList  getEndpointObjectList();
@@ -179,12 +197,12 @@
     bool			   			 m_registered;
     
     // mbed-client support
-#ifdef ENABLE_MBED_CLOUD_SUPPORT
+#ifdef ENABLE_MBED_CLOUD_SUPPORT 
 	MbedCloudClient				*m_endpoint_interface;
 #else
-    M2MInterface      			*m_endpoint_interface;
-    M2MSecurity       			*m_endpoint_security;
+    M2MInterface				*m_endpoint_interface;
 #endif
+	M2MSecurity       			*m_endpoint_security;
     M2MObjectList      			 m_endpoint_object_list;
     
     // Device Manager
@@ -205,7 +223,7 @@
 #else
 	// mbed-client methods
     void 			 createConnectorEndpointInterface();
-    M2MSecurity 	*createEndpointInstance();
+    M2MSecurity 	*createEndpointSecurityInstance();
 #endif
     
 	// DynamicResource Lookup
@@ -213,6 +231,9 @@
 	
 	// stop underlying observers
     void stopObservations();
+    
+    // set our endpoint security instance
+    void setSecurityInstance(M2MSecurity *security);
 };
 
 } // namespace Connector