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: MBEDio.cpp
- Revision:
- 56:604a75f111fd
- Parent:
- 43:361a61395588
- Child:
- 60:76728655fa12
diff -r 63350425d704 -r 604a75f111fd MBEDio.cpp --- a/MBEDio.cpp Sun Mar 02 18:07:26 2014 +0000 +++ b/MBEDio.cpp Sun Mar 02 21:41:27 2014 +0000 @@ -33,7 +33,7 @@ float MBEDio::floatValue() { this->update(); float floatValue = 0.0; - if (this->m_resource != NULL && this->m_resource->getValuePointer() != NULL) sscanf(this->m_resource->getValuePointer(),"%f",&floatValue); + if (this->resource() != NULL && this->resource()->getValuePointer() != NULL) sscanf(this->resource()->getValuePointer(),"%f",&floatValue); return floatValue; } @@ -41,16 +41,19 @@ int MBEDio::intValue() { this->update(); int intValue = 0; - if (this->m_resource != NULL && this->m_resource->getValuePointer() != NULL) sscanf(this->m_resource->getValuePointer(),"%d",&intValue); + if (this->resource() != NULL && this->resource()->getValuePointer() != NULL) sscanf(this->resource()->getValuePointer(),"%d",&intValue); return intValue; } // get the string value char *MBEDio::stringValue() { this->update(); - if (this->m_resource != NULL) return this->m_resource->getValuePointer(); + if (this->resource() != NULL) return this->resource()->getValuePointer(); return NULL; } // get the Error Logger - ErrorHandler *MBEDio::logger() { return this->m_error_handler; } \ No newline at end of file + ErrorHandler *MBEDio::logger() { return this->m_error_handler; } + + // get the Resource + Resource *MBEDio::resource() { return this->m_resource; } \ No newline at end of file