use TCP to connect to mbed connector

Fork of mbedConnectorInterfaceWithDM by Doug Anson

Revision:
13:9edad7677211
Parent:
12:d0e61bac8c27
Child:
21:0bbe9057e7b1
--- a/source/Utils.cpp	Thu Mar 10 16:02:04 2016 +0000
+++ b/source/Utils.cpp	Wed Jun 08 22:32:08 2016 +0000
@@ -24,6 +24,7 @@
 #include "mbed-connector-interface/ConnectorEndpoint.h"
 #include "mbed-connector-interface/OptionsBuilder.h"
 #include "mbed-connector-interface/mbedEndpointNetwork.h"
+#include "mbed-connector-interface/DeviceManager.h"
 
 // Maximum CoAP URL length
 #define MAX_CONN_URL_LENGTH		128
@@ -88,6 +89,16 @@
     // Establish default CoAP GET-based observation control behavior
     config.setEnableGETObservationControl(false);    
 
+	// Device Manager installation
+    DeviceManager *device_manager = (DeviceManager *)ep->getDeviceManager();
+    if (device_manager != NULL) {
+    	logger.log("Endpoint: installing and setting up device manager and its resources...");
+    	device_manager->install((void *)ep,(void *)&config);
+    }
+    else {
+    	logger.log("Endpoint: no device manager installed...");
+    }
+    
     // main.cpp can override or change any of the above defaults...
     logger.log("Endpoint: gathering configuration overrides...");
     options = configure_endpoint(config);