Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Revision:
135:7f3f963cd159
Parent:
106:e2be56eadda8
Child:
192:54b758a8eaaa
diff -r 58e7537a8c5f -r 7f3f963cd159 MBEDio.cpp
--- a/MBEDio.cpp	Fri Mar 28 16:24:12 2014 +0000
+++ b/MBEDio.cpp	Fri Mar 28 17:49:10 2014 +0000
@@ -19,9 +19,7 @@
  #include "MBEDio.h"
  
  // default constructor
- MBEDio::MBEDio(ErrorHandler *error_handler,Resource *resource) {
-    this->m_error_handler = error_handler;
-    this->m_resource = resource;
+ MBEDio::MBEDio(ErrorHandler *error_handler,Resource *resource) : BaseClass(error_handler,resource) {
     if (resource != NULL) resource->setIO(this);
  }
  
@@ -56,9 +54,6 @@
         return NULL;
     }
  }
- 
- // get the Error Logger
- ErrorHandler *MBEDio::logger() { return this->m_error_handler; }
- 
- // get the Resource
- Resource *MBEDio::resource() { return this->m_resource; }
\ No newline at end of file
+
+ // get the Resource (held in BaseClass as endpoint()...)
+ Resource *MBEDio::resource() { return (Resource *)this->getEndpoint(); }
\ No newline at end of file