use TCP to connect to mbed connector

Fork of mbedConnectorInterfaceWithDM by Doug Anson

Revision:
84:e5f53e7492cb
Parent:
83:8d856fa24fda
Child:
85:ad357f0a48d2
diff -r 8d856fa24fda -r e5f53e7492cb source/ConnectorEndpoint.cpp
--- a/source/ConnectorEndpoint.cpp	Fri Nov 04 23:27:59 2016 +0000
+++ b/source/ConnectorEndpoint.cpp	Fri Nov 04 23:31:14 2016 +0000
@@ -300,76 +300,76 @@
 	char *error = "No Error";
 	switch(error_code) {
         case 0x01:
-            error = "MbedCloudClient::IdentityError";
+            error = (char *)"MbedCloudClient::IdentityError";
             break;
         case 0x02:
-            error = "MbedCloudClient::IdentityInvalidParameter";
+            error = (char *)"MbedCloudClient::IdentityInvalidParameter";
             break;
         case 0x03:
-            error = "MbedCloudClient::IdentityOutofMemory";
+            error = (char *)"MbedCloudClient::IdentityOutofMemory";
             break;
         case 0x04:
-            error = "MbedCloudClient::IdentityProvisioningError";
+            error = (char *)"MbedCloudClient::IdentityProvisioningError";
             break;
         case 0x05:
-            error = "MbedCloudClient::IdentityInvalidSessionID";
+            error = (char *)"MbedCloudClient::IdentityInvalidSessionID";
             break;
         case 0x06:
-            error = "MbedCloudClient::IdentityNetworkError";
+            error = (char *)"MbedCloudClient::IdentityNetworkError";
             break;
         case 0x07:
-            error = "MbedCloudClient::IdentityInvalidMessageType";
+            error = (char *)"MbedCloudClient::IdentityInvalidMessageType";
             break;
         case 0x08:
-            error = "MbedCloudClient::IdentityInvalidMessageSize";
+            error = (char *)"MbedCloudClient::IdentityInvalidMessageSize";
             break;
         case 0x09:
-            error = "MbedCloudClient::IdentityCertOrKeyNotFound";
+            error = (char *)"MbedCloudClient::IdentityCertOrKeyNotFound";
             break;
         case 0x0A:
-            error = "MbedCloudClient::IdentityRetransmissionError";
+            error = (char *)"MbedCloudClient::IdentityRetransmissionError";
             break;
         case 0x30:
-            error = "MbedCloudClient::ConnectErrorNone";
+            error = (char *)"MbedCloudClient::ConnectErrorNone";
             break;
         case 0x31:
-            error = "MbedCloudClient::ConnectAlreadyExists";
+            error = (char *)"MbedCloudClient::ConnectAlreadyExists";
             break;
         case 0x32:
-            error = "MbedCloudClient::ConnectBootstrapFailed";
+            error = (char *)"MbedCloudClient::ConnectBootstrapFailed";
 			break;
         case 0x33:
-            error = "MbedCloudClient::ConnectInvalidParameters";
+            error = (char *)"MbedCloudClient::ConnectInvalidParameters";
             break;
         case 0x34:
-            error = "MbedCloudClient::ConnectNotRegistered";
+            error = (char *)"MbedCloudClient::ConnectNotRegistered";
             break;
         case 0x35:
-            error = "MbedCloudClient::ConnectTimeout";
+            error = (char *)"MbedCloudClient::ConnectTimeout";
             break;
         case 0x36:
-            error = "MbedCloudClient::ConnectNetworkError";
+            error = (char *)"MbedCloudClient::ConnectNetworkError";
             break;
         case 0x37:
-            error = "MbedCloudClient::ConnectResponseParseFailed";
+            error = (char *)"MbedCloudClient::ConnectResponseParseFailed";
             break;
         case 0x38:
-            error = "MbedCloudClient::ConnectUnknownError";
+            error = (char *)"MbedCloudClient::ConnectUnknownError";
             break;
         case 0x39:
-            error = "MbedCloudClient::ConnectMemoryFail";
+            error = (char *)"MbedCloudClient::ConnectMemoryFail";
             break;
         case 0x3A:
-            error = "MbedCloudClient::ConnectNotAllowed";
+            error = (char *)"MbedCloudClient::ConnectNotAllowed";
             break;
         case 0x3B:
-            error = "MbedCloudClient::ConnectSecureConnectionFailed";
+            error = (char *)"MbedCloudClient::ConnectSecureConnectionFailed";
             break;
         case 0x3C:
-            error = "MbedCloudClient::ConnectDnsResolvingFailed";
+            error = (char *)"MbedCloudClient::ConnectDnsResolvingFailed";
             break;
         default:
-            error = "UNKNOWN";
+            error = (char *)"UNKNOWN";
     }
     this->logger()->log("Connector::Endpoint(Cloud) Error(%x): %s",error_code,error);
 }
@@ -464,22 +464,25 @@
 #ifdef ENABLE_MBED_CLOUD_SUPPORT
 // object registered
 void Endpoint::on_registered()  {
+	const M2MServer server;
 	if (__endpoint != NULL) {
-		__endpoint->object_registered(NULL,NULL);
+		__endpoint->object_registered(NULL,server);
 	}
 }
 
 // registration updated
 void Endpoint::on_registration_updated()  {
+	const M2MServer server;
 	if (__endpoint != NULL) {
-		__endpoint->registration_updated(NULL,NULL);
+		__endpoint->registration_updated(NULL,server);
 	}
 }
 
 // object unregistered
 void Endpoint::on_unregistered()  {
+	const M2MServer server;
 	if (__endpoint != NULL) {
-		__endpoint->object_unregistered(NULL,NULL);
+		__endpoint->object_unregistered(NULL,server);
 	}
 }
 #endif