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: C027 C12832 EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed
Diff: MBEDEndpoint.cpp
- Revision:
- 163:392f89530162
- Parent:
- 158:dbade2c795c7
--- a/MBEDEndpoint.cpp Fri Mar 21 05:44:05 2014 +0000
+++ b/MBEDEndpoint.cpp Fri Mar 21 05:55:23 2014 +0000
@@ -39,6 +39,7 @@
// default constructor
MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,EthernetInterface *ethernet) {
bool success = true;
+ this->m_instance_id = 0;
this->m_preferences = NULL;
memset(this->m_lcd_status,0,TEMP_BUFFER_LEN+1);
memset(this->m_gw_address,0,PREFERENCE_VALUE_LEN+1);
@@ -150,14 +151,17 @@
// Initialize the Endpoint Name - will be the first Light resource name (and there must be one...)
void MBEDEndpoint::initEndpointName() {
- int index = this->preferences()->getIntPreference("endpoint_id",LIGHT_NAME_INDEX);
+ this->m_instance_id = this->preferences()->getIntPreference("endpoint_id",LIGHT_NAME_INDEX);
memset(this->m_endpoint_name,0,LIGHT_NAME_LEN+1);
- sprintf(this->m_endpoint_name,LIGHT_NAME,index);
+ sprintf(this->m_endpoint_name,LIGHT_NAME,this->m_instance_id);
}
// get our endpoint name
char *MBEDEndpoint::getEndpointName() { return this->m_endpoint_name; }
+ // get our instance id
+ int MBEDEndpoint::getInstanceID() { return this->m_instance_id; }
+
// initialize a specific transport
bool MBEDEndpoint::initializeTransport(int index,char *key,Transport *transport) {
bool success = false;