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:
1:5d332fa199ce
Parent:
0:4c9bfcb3e759
Child:
3:8173336969c9
--- a/Light.cpp	Mon Feb 24 19:09:25 2014 +0000
+++ b/Light.cpp	Mon Feb 24 19:25:03 2014 +0000
@@ -17,10 +17,12 @@
  */
  
  #include "Light.h"
+ #include "MBEDEndpoint.h"
  
  // default constructor
  Light::Light(ErrorHandler *error_handler,Transport *transports[NUM_TRANSPORTS],int instance,void *endpoint) {
      this->m_error_handler = error_handler;
+     this->m_resources = ((MBEDEndpoint *)endpoint)->initResourceFactory();
      this->m_endpoint = endpoint;
      for(int i=0;i<NUM_TRANSPORTS;++i) { 
         this->m_transports[i] = transports[i];
@@ -43,12 +45,12 @@
  
  // get the light name
  char *Light::getName() { return this->m_name; }
- 
- // create resources (base class does nothing)
- void Light::createResources() { ; }
- 
+  
  // get the error handler
  ErrorHandler *Light::logger() { return this->m_error_handler; }
  
+ // get the resources factory
+ ResourceFactory *Light::resources() { return this->m_resources; }
+ 
  
  
\ No newline at end of file