Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: Resource.cpp
- Revision:
- 9:90fadae5489a
- Parent:
- 6:9a4085eeac52
- Child:
- 10:62107616fc6c
diff -r d7ea38b0e131 -r 90fadae5489a Resource.cpp --- a/Resource.cpp Mon Feb 24 22:25:18 2014 +0000 +++ b/Resource.cpp Tue Feb 25 05:27:29 2014 +0000 @@ -19,13 +19,13 @@ #include "Resource.h" // default constructor - Resource::Resource(ErrorHandler *error_handler,char *endpoint_name,char *name,char *value,void *internals) { + Resource::Resource(ErrorHandler *error_handler,char *endpoint_name,char *name,char *value,void *cb) { this->m_error_handler = error_handler; memset(this->m_name,0,RESOURCE_NAME_LEN+1); memset(this->m_value,0,RESOURCE_VALUE_LEN+1); this->setName(name); this->setValue(value); - this->setInternals(internals); + this->setCallbackPointer(cb); this->plumb(endpoint_name,name); } @@ -34,7 +34,7 @@ this->m_error_handler = resource.m_error_handler; memset(this->m_name,0,RESOURCE_NAME_LEN+1); memset(this->m_value,0,RESOURCE_VALUE_LEN+1); - this->setInternals(resource.m_internals); + this->setCallbackPointer(resource.m_cb); this->setName((char *)resource.m_name); this->setValue((char *)resource.m_value); } @@ -65,8 +65,8 @@ char *Resource::endpoint() { return this->m_endpoint_name; } // set the internal resource linkage - void Resource::setInternals(void *internals) { this->m_internals = internals; } - void *Resource::getInternals() { return this->m_internals; } + void Resource::setCallbackPointer(void *cb) { this->m_cb = cb; } + void *Resource::getCallbackPointer() { return this->m_cb; } // min function int Resource::min(int value1,int value2) {