mbed Connector Interface simplification API on top of mbed-client

Fork of mbedConnectorInterfaceV3 by Doug Anson

NOTE:

This repo has been replaced with https://github.com/ARMmbed/mbedConnectorInterface. No further updates will occur with this repo. Please use the github repo instead. Thanks!

Revision:
105:aeaaee8fbb1d
Parent:
95:6a5c130be6c1
Child:
107:997c932c5cd4
--- a/source/OptionsBuilder.cpp	Fri Apr 21 03:57:44 2017 +0000
+++ b/source/OptionsBuilder.cpp	Mon Apr 24 20:42:24 2017 +0000
@@ -29,7 +29,11 @@
 #include "mbed-connector-interface/MinarResourceObserver.h"
 
 #ifdef ENABLE_MBED_CLOUD_SUPPORT
+// R1.2+: external references for mbed_cloud_client_credentials.c 
 extern "C" char *MBED_CLOUD_DEV_ACCOUNT_ID;
+extern "C" char *MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI;
+extern "C" char *MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME;
+extern "C" char *MBED_CLOUD_DEV_DEVICE_TYPE;
 #endif
 
 // Connector namespace
@@ -40,14 +44,22 @@
 {
     this->m_endpoint 				= NULL;
     this->m_domain           		= DEFAULT_DOMAIN;
-    this->m_endpoint_type    	 	= DEFAULT_ENDPOINT_TYPE;
 #ifdef ENABLE_MBED_CLOUD_SUPPORT
-	this->m_node_name        	 	= (char *)MBED_CLOUD_DEV_ACCOUNT_ID;
+	this->m_endpoint_type			= (char *)MBED_CLOUD_DEV_DEVICE_TYPE;
+#else
+    this->m_endpoint_type    	 	= DEFAULT_ENDPOINT_TYPE;
+#endif
+#ifdef ENABLE_MBED_CLOUD_SUPPORT
+	this->m_node_name        	 	= (char *)MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME;
 #else
     this->m_node_name        	 	= NODE_NAME;
 #endif
     this->m_lifetime  				= REG_LIFETIME_SEC;
+#ifdef ENABLE_MBED_CLOUD_SUPPORT
+	this->m_connector_url  		 	= string((char *)MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI);
+#else
     this->m_connector_url  		 	= string(CONNECTOR_URL);
+#endif
     this->m_server_cert				= NULL;
     this->m_server_cert_length		= 0;
     this->m_client_cert 			= NULL;