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:
- 25:8e960728d50a
- Parent:
- 24:7b3a5c927a53
- Child:
- 30:5c670ec5d203
--- a/MBEDEndpoint.cpp Fri Feb 28 03:11:02 2014 +0000
+++ b/MBEDEndpoint.cpp Fri Feb 28 03:18:29 2014 +0000
@@ -271,8 +271,10 @@
}
// Handle /dev/addldata
- if (strcmp(name,this->getMap()->endpointNameToIOCName("/dev/addldata")) == 0 && light->getIOCID() > 0) {
- str_json += "\"" + std::string(name) + "\":\"id:" + std::string("" + light->getIOCID()) + "\",";
+ char *dev_addldata = this->getMap()->endpointNameToIOCName("/dev/addldata");
+ if (dev_addldata != NULL && strcmp(name,dev_addldata) == 0 && light != NULL && light->getIOCID() > 0) {
+ char buf[10]; memset(buf,0,10); sprintf(buf,"%d",light->getIOCID());
+ str_json += "\"" + std::string(name) + "\":\"id:" + std::string(buf) + "\",";
}
}