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:
60:0d9e607dd678
Parent:
59:dd395412bd19
Child:
61:d02cd5e2bb26
--- a/source/ConnectorEndpoint.cpp	Tue Aug 09 23:29:30 2016 +0000
+++ b/source/ConnectorEndpoint.cpp	Tue Aug 09 23:46:16 2016 +0000
@@ -36,7 +36,7 @@
 static Connector::Endpoint *__endpoint = NULL;
 
 // LWIP Network interface instance
-void *__network_interface = NULL;
+NetworkInterface *__network_interface = NULL;
 
 // Connector namespace
 namespace Connector {
@@ -176,6 +176,9 @@
 		listening_port = rand() % 65535 + 12345;
 	}
 	
+	// DEBUG
+	this->logger()->log("Connector::Endpoint: listening port: %d",listening_port);
+	
 	// Binding Mode - TCP or UDP
 	M2MInterface::BindingMode network_protocol = M2MInterface::UDP;
 	if (this->m_options->getCoAPConnectionType() == COAP_TCP)  network_protocol = M2MInterface::TCP;
@@ -207,11 +210,13 @@
                                               listening_port,									// listening port
                                               (char *)this->m_options->getDomain().c_str(),
                                               network_protocol,									// CoAP over UDP or TCP...
-                                              ip_address_type);									// IPv4 addressing or IPv6 addressing
+                                              ip_address_type,									// IPv4 addressing or IPv6 addressing
+                                              CONTEXT_ADDRESS_STRING							// context address string
+                                              );									
                                               
 	if (__network_interface != NULL && this->m_endpoint_interface != NULL) {
 		this->logger()->log("Connector::Endpoint: binding LWIP network instance...");
-		this->m_endpoint_interface->set_platform_network_handler(__network_interface);
+		this->m_endpoint_interface->set_platform_network_handler((void *)__network_interface);
 	}
 }