MBED_DEMOS / Mbed 2 deprecated mbed_mqtt_endpoint_nxp

Dependencies:   C12832_lcd EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed

Revision:
12:952dce085876
Parent:
11:59ee476fda24
Child:
13:25448d92c205
diff -r 59ee476fda24 -r 952dce085876 MBEDEndpoint.cpp
--- a/MBEDEndpoint.cpp	Thu Feb 27 00:14:58 2014 +0000
+++ b/MBEDEndpoint.cpp	Thu Feb 27 00:23:30 2014 +0000
@@ -170,16 +170,13 @@
      
      // initialize
      memset(result,0,IOC_RESULT_LEN+1);
-     memset(this->m_payload_buffer,0,IOC_PAYLOAD_LEN+1);
-     
-     // create the URL
-     char *url = this->createIOCLoadURL();
-     
+     memset(payload,0,IOC_PAYLOAD_LEN+1);
+          
      // build the payload
      char *data = this->buildIOCPayload(data,IOC_PAYLOAD_LEN);
      
      // issue the request
-     success = this->m_transports[LOAD_TRANSPORT]->loadEndpoint(data,strlen(data),result,IOC_RESULT_LEN);
+     success = this->m_transports[LOAD_TRANSPORT]->loadEndpoint((char *)payload,strlen(payload),(char *)result,IOC_RESULT_LEN);
      
      // update the IOC ID if found
      if (success) this->saveIOCID(result);
@@ -196,16 +193,13 @@
      
      // initialize
      memset(result,0,IOC_RESULT_LEN+1);
-     memset(this->m_payload_buffer,0,IOC_PAYLOAD_LEN+1);
-     
-     // create the URL
-     char *url = this->createIOCUpdateURL(this->getIOCID());
-     
+     memset(payload,0,IOC_PAYLOAD_LEN+1);
+          
      // build the payload
      char *data = this->buildIOCPayload(data,IOC_PAYLOAD_LEN);
      
      // issue the request   
-     success = this->m_transports[LOAD_TRANSPORT]->updateEndpoint(data,strlen(data),result,IOC_RESULT_LEN);
+     success = this->m_transports[LOAD_TRANSPORT]->updateEndpoint(this->getIOCID(),(char *)payload,strlen(payload),(char *)result,IOC_RESULT_LEN);
           
      // return our status
      return success; 
@@ -216,7 +210,7 @@
      // construct the payload for Load/Updates
      
      // return the payload
-     return buffer;
+     return data;
  }
   
  // save the IOC ID