Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed
Diff: MBEDEndpoint.cpp
- Revision:
- 12:952dce085876
- Parent:
- 11:59ee476fda24
- Child:
- 13:25448d92c205
--- 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