use TCP to connect to mbed connector

Fork of mbedConnectorInterfaceWithDM by Doug Anson

Revision:
38:bb6d2be4d54c
Parent:
33:1d0b855df5a5
Child:
44:7c73baf9f4c1
--- a/source/DynamicResource.cpp	Tue Jun 14 19:56:47 2016 +0000
+++ b/source/DynamicResource.cpp	Tue Jun 14 20:18:30 2016 +0000
@@ -185,7 +185,7 @@
 	// PUT() check
 	if ((op & M2MBase::PUT_ALLOWED) != 0) {
 		string value = this->coapDataToString(this->m_res->value(),this->m_res->value_length());
-	 	this->logger()->log("%s: Calling resource(PUT) with [%s]=[%s]",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str());
+	 	this->logger()->log("%s: Calling resource(PUT) with [%s]=[%s] invoked. type:%d",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str(),type);
      	this->put(value.c_str());
      	return 0;
     }
@@ -200,12 +200,12 @@
 	    	int instance_id = (int)param->get_argument_object_instance_id();
 	    	String resource_name = param->get_argument_resource_name();
 	    	value = this->coapDataToString(param->get_argument_value(),param->get_argument_value_length());
-	    	this->logger()->log("%s:  post() (resource: [%s/%d/%s] value: [%s]) invoked",this->m_res_type.c_str(),object_name.c_str(),instance_id,resource_name.c_str(),value.c_str());
+	    	this->logger()->log("%s:  post() (resource: [%s/%d/%s] value: [%s]) invoked. type: %d",this->m_res_type.c_str(),object_name.c_str(),instance_id,resource_name.c_str(),value.c_str(),type);
 	    }
 	    else {
 	    	// use the resource value itself
 			value = this->coapDataToString(this->m_res->value(),this->m_res->value_length());
-	 		this->logger()->log("%s:  post() (resource: [%s]  value: [%s] invoked",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str());
+	 		this->logger()->log("%s:  post() (resource: [%s]  value: [%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str(),type);
      	}
      	
      	// invoke
@@ -216,12 +216,12 @@
     // POST() check
 	if ((op & M2MBase::POST_ALLOWED) != 0) {
 		if (args != NULL) {
-			this->logger()->log("%s: Calling resource(POST) with [%s]=[%s]",this->m_res_type.c_str(),this->getFullName().c_str(),(char *)args);
+			this->logger()->log("%s: Calling resource(POST) with [%s]=[%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),(char *)args,type);
 	     	this->post(args);
      	}
      	else {
      		string value = this->coapDataToString(this->m_res->value(),this->m_res->value_length());
-		 	this->logger()->log("%s: Calling resource(POST) with [%s]=[%s]",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str());
+		 	this->logger()->log("%s: Calling resource(POST) with [%s]=[%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str(),type);
 	     	this->post((void *)value.c_str());
      	}
      	return 0;
@@ -237,12 +237,12 @@
 	    	int instance_id = (int)param->get_argument_object_instance_id();
 	    	String resource_name = param->get_argument_resource_name();
 	    	string value = this->coapDataToString(param->get_argument_value(),param->get_argument_value_length());
-	    	this->logger()->log("%s:  delete() (resource: [%s/%d/%s] value: [%s]) invoked",this->m_res_type.c_str(),object_name.c_str(),instance_id,resource_name.c_str(),value.c_str());
+	    	this->logger()->log("%s:  delete() (resource: [%s/%d/%s] value: [%s]) invoked. type: %d",this->m_res_type.c_str(),object_name.c_str(),instance_id,resource_name.c_str(),value.c_str(),type);
 	    }
 	    else {
 	    	// use the resource value itself
 			string value = this->coapDataToString(this->m_res->value(),this->m_res->value_length());
-	 		this->logger()->log("%s:  delete() (resource: [%s]  value: [%s] invoked",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str());
+	 		this->logger()->log("%s:  delete() (resource: [%s]  value: [%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str(),type);
      	}
      	
      	// invoke
@@ -253,12 +253,12 @@
     // DELETE() check
 	if ((op & M2MBase::DELETE_ALLOWED) != 0) {
 		if (args != NULL) {
-			this->logger()->log("%s: Calling resource(DELETE) with [%s]=[%s]",this->m_res_type.c_str(),this->getFullName().c_str(),(char *)args);
+			this->logger()->log("%s: Calling resource(DELETE) with [%s]=[%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),(char *)args,type);
 	     	this->del(args);
      	}
      	else {
      		string value = this->coapDataToString(this->m_res->value(),this->m_res->value_length());
-		 	this->logger()->log("%s: Calling resource(DELETE) with [%s]=[%s]",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str());
+		 	this->logger()->log("%s: Calling resource(DELETE) with [%s]=[%s] invoked. type: %d",this->m_res_type.c_str(),this->getFullName().c_str(),value.c_str(),type);
 	     	this->del((void *)value.c_str());
      	}
      }
@@ -317,21 +317,21 @@
 }
 
 // default PUT (does nothing)
-void DynamicResource::put(const string value)
+void DynamicResource::put(const string /* value */)
 {
     // not used by default
     this->logger()->log("DynamicResource::put() invoked (NOOP)");
 }
 
 // default POST (does nothing)
-void DynamicResource::post(void *args)
+void DynamicResource::post(void * /* args */)
 {
     // not used by default
     this->logger()->log("DynamicResource::post() invoked (NOOP)");
 }
 
 // default DELETE (does nothing)
-void DynamicResource::del(void *args)
+void DynamicResource::del(void * /* args */)
 {
     // not used by default
     this->logger()->log("DynamicResource::del() invoked (NOOP)");