mqtt specific components for the impact mbed endpoint library

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Fri Sep 26 05:16:26 2014 +0000
Parent:
55:7992e9582e2e
Commit message:
updates for new logger name

Changed in this revision

EmulatedLightDimmerAction.cpp Show annotated file Show diff for this revision Revisions of this file
EmulatedLightDimmerAction.h Show annotated file Show diff for this revision Revisions of this file
EmulatedLightResourceFactory.cpp Show annotated file Show diff for this revision Revisions of this file
EmulatedLightResourceFactory.h Show annotated file Show diff for this revision Revisions of this file
EmulatedLightSwitchAction.cpp Show annotated file Show diff for this revision Revisions of this file
EmulatedLightSwitchAction.h Show annotated file Show diff for this revision Revisions of this file
EmulatedResourceFactory.cpp Show annotated file Show diff for this revision Revisions of this file
EmulatedResourceFactory.h Show annotated file Show diff for this revision Revisions of this file
IOCEndpoint.cpp Show annotated file Show diff for this revision Revisions of this file
IOCEndpoint.h Show annotated file Show diff for this revision Revisions of this file
IOCHTTPTransport.cpp Show annotated file Show diff for this revision Revisions of this file
IOCHTTPTransport.h Show annotated file Show diff for this revision Revisions of this file
MBEDEndpoint.cpp Show annotated file Show diff for this revision Revisions of this file
MBEDEndpoint.h Show annotated file Show diff for this revision Revisions of this file
MQTTTransport.cpp Show annotated file Show diff for this revision Revisions of this file
MQTTTransport.h Show annotated file Show diff for this revision Revisions of this file
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightDimmerAction.cpp
--- a/EmulatedLightDimmerAction.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightDimmerAction.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -27,7 +27,7 @@
  }
  
  // default constructor
- EmulatedLightDimmerAction::EmulatedLightDimmerAction(ErrorHandler *error_handler,Light *light) : LightDimmerAction(error_handler,light) {
+ EmulatedLightDimmerAction::EmulatedLightDimmerAction(Logger *logger,Light *light) : LightDimmerAction(logger,light) {
      _dimmerAction = this;
  }
  
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightDimmerAction.h
--- a/EmulatedLightDimmerAction.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightDimmerAction.h	Fri Sep 26 05:16:26 2014 +0000
@@ -24,7 +24,7 @@
 
 class EmulatedLightDimmerAction : public LightDimmerAction {        
     public:
-        EmulatedLightDimmerAction(ErrorHandler *error_handler,Light *light);
+        EmulatedLightDimmerAction(Logger *logger,Light *light);
         virtual ~EmulatedLightDimmerAction(); 
         
         void dim(int value);       
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightResourceFactory.cpp
--- a/EmulatedLightResourceFactory.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightResourceFactory.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -65,7 +65,7 @@
  #endif
  
  // default constructor
- EmulatedLightResourceFactory::EmulatedLightResourceFactory(ErrorHandler *error_handler,void *endpoint) : EmulatedResourceFactory(error_handler,endpoint) { 
+ EmulatedLightResourceFactory::EmulatedLightResourceFactory(Logger *logger,void *endpoint) : EmulatedResourceFactory(logger,endpoint) { 
     this->initGPSCoords(); 
  }
  
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightResourceFactory.h
--- a/EmulatedLightResourceFactory.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightResourceFactory.h	Fri Sep 26 05:16:26 2014 +0000
@@ -27,7 +27,7 @@
         char m_gps_coords[PREFERENCE_VALUE_LEN+1];
         
     public:
-        EmulatedLightResourceFactory(ErrorHandler *error_handler,void *endpoint);
+        EmulatedLightResourceFactory(Logger *logger,void *endpoint);
         virtual ~EmulatedLightResourceFactory();
                       
         virtual void createResources(char *endpoint_name);
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightSwitchAction.cpp
--- a/EmulatedLightSwitchAction.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightSwitchAction.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -27,7 +27,7 @@
  }
  
  // default constructor
- EmulatedLightSwitchAction::EmulatedLightSwitchAction(ErrorHandler *error_handler,Light *light) : LightSwitchAction(error_handler,light) {
+ EmulatedLightSwitchAction::EmulatedLightSwitchAction(Logger *logger,Light *light) : LightSwitchAction(logger,light) {
     _switchAction = this;
  }
  
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedLightSwitchAction.h
--- a/EmulatedLightSwitchAction.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedLightSwitchAction.h	Fri Sep 26 05:16:26 2014 +0000
@@ -24,7 +24,7 @@
 
 class EmulatedLightSwitchAction : public LightSwitchAction {        
     public:
-        EmulatedLightSwitchAction(ErrorHandler *error_handler,Light *light);
+        EmulatedLightSwitchAction(Logger *logger,Light *light);
         virtual ~EmulatedLightSwitchAction(); 
         
         void on();
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedResourceFactory.cpp
--- a/EmulatedResourceFactory.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedResourceFactory.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -23,7 +23,7 @@
  #include "MBEDEndpoint.h"
   
  // default constructor
- EmulatedResourceFactory::EmulatedResourceFactory(ErrorHandler *error_handler,void *endpoint) : ResourceFactory(error_handler,endpoint) {  
+ EmulatedResourceFactory::EmulatedResourceFactory(Logger *logger,void *endpoint) : ResourceFactory(logger,endpoint) {  
  }
  
  // default destructor
diff -r 7992e9582e2e -r 789a1a8c5ebe EmulatedResourceFactory.h
--- a/EmulatedResourceFactory.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/EmulatedResourceFactory.h	Fri Sep 26 05:16:26 2014 +0000
@@ -25,15 +25,15 @@
 // Emulated callback structure
 typedef void (*EmulatedCallbackPointer)();
 
-// ErrorHandler support
-#include "ErrorHandler.h"
+// Logger support
+#include "Logger.h"
 
 // Resource Initializer callback structure
 typedef void (*resourceInitializer)(Resource *);
 
 class EmulatedResourceFactory : public ResourceFactory {        
     public:
-        EmulatedResourceFactory(ErrorHandler *error_handler,void *endpoint);
+        EmulatedResourceFactory(Logger *logger,void *endpoint);
         virtual ~EmulatedResourceFactory();
                       
         virtual void createResources(char *endpoint_name) = 0;
diff -r 7992e9582e2e -r 789a1a8c5ebe IOCEndpoint.cpp
--- a/IOCEndpoint.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/IOCEndpoint.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -23,7 +23,7 @@
  #include "MBEDEndpoint.h"
   
  // default constructor
- IOCEndpoint::IOCEndpoint(ErrorHandler *error_handler,void *endpoint) : BaseClass(error_handler,endpoint) {
+ IOCEndpoint::IOCEndpoint(Logger *logger,void *endpoint) : BaseClass(logger,endpoint) {
  }
  
  // default destructor
diff -r 7992e9582e2e -r 789a1a8c5ebe IOCEndpoint.h
--- a/IOCEndpoint.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/IOCEndpoint.h	Fri Sep 26 05:16:26 2014 +0000
@@ -27,7 +27,7 @@
 
 class IOCEndpoint : public BaseClass {        
     public:
-        IOCEndpoint(ErrorHandler *error_handler,void *endpoint);
+        IOCEndpoint(Logger *logger,void *endpoint);
         virtual ~IOCEndpoint();
        
        char *buildLightPayload(char *data,int data_length,Light *light);
diff -r 7992e9582e2e -r 789a1a8c5ebe IOCHTTPTransport.cpp
--- a/IOCHTTPTransport.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/IOCHTTPTransport.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -20,7 +20,7 @@
  #include "MBEDEndpoint.h"
    
  // default constructor
- IOCHTTPTransport::IOCHTTPTransport(ErrorHandler *error_handler,void *endpoint) : HTTPTransport(error_handler,endpoint) {
+ IOCHTTPTransport::IOCHTTPTransport(Logger *logger,void *endpoint) : HTTPTransport(logger,endpoint) {
      memset(this->m_url_buffer,0,IOC_REST_URL_LEN+1);
  }
  
diff -r 7992e9582e2e -r 789a1a8c5ebe IOCHTTPTransport.h
--- a/IOCHTTPTransport.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/IOCHTTPTransport.h	Fri Sep 26 05:16:26 2014 +0000
@@ -27,7 +27,7 @@
         char        m_url_buffer[IOC_REST_URL_LEN+1];
 
     public:
-        IOCHTTPTransport(ErrorHandler *error_handler,void *endpoint);
+        IOCHTTPTransport(Logger *error_handler,void *endpoint);
         virtual ~IOCHTTPTransport();
         
         virtual bool httpGet(char *url,char *result,int result_length);
diff -r 7992e9582e2e -r 789a1a8c5ebe MBEDEndpoint.cpp
--- a/MBEDEndpoint.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/MBEDEndpoint.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -42,7 +42,7 @@
  extern void closedown(int code);
   
  // default constructor
- MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,void *transport,void *status_reporter,void *extra) : BaseClass(error_handler,NULL) {
+ MBEDEndpoint::MBEDEndpoint(Logger *logger,void *transport,void *status_reporter,void *extra) : BaseClass(logger,NULL) {
      bool success = true;
      this->m_instance_id = 0;
      this->m_preferences = NULL;
@@ -51,7 +51,7 @@
      memset(this->m_gw_address,0,PREFERENCE_VALUE_LEN+1);
      for(int i=0;i<NUM_TRANSPORTS;++i) this->m_transports[i] = NULL;
      this->logger()->setEndpoint((void *)this);
-     this->setEndpoint(new IOCEndpoint(error_handler,(void *)this));
+     this->setEndpoint(new IOCEndpoint(logger,(void *)this));
      if (success) this->initPreferences();
      if (success) this->initEndpointName();
      if (success) this->logger()->turnLEDBlue();
@@ -76,7 +76,7 @@
 #endif
      if (success) this->logger()->turnLEDYellow();
      this->logger()->log("initializing resource map...");
-     if (success)this->m_map = new MBEDToIOCResourceMap(error_handler); 
+     if (success)this->m_map = new MBEDToIOCResourceMap(logger); 
      this->logger()->log("initializing transports...");
      if (success) success = this->initializeTransports();
      this->logger()->log("initializing personalities...");
diff -r 7992e9582e2e -r 789a1a8c5ebe MBEDEndpoint.h
--- a/MBEDEndpoint.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/MBEDEndpoint.h	Fri Sep 26 05:16:26 2014 +0000
@@ -71,7 +71,7 @@
         void                 *m_status_reporter;                           // status reporter (optional)
          
     public:
-        MBEDEndpoint(ErrorHandler *error_handler,void *transport,void *status_reporter,void *extra);
+        MBEDEndpoint(Logger *logger,void *transport,void *status_reporter,void *extra);
         virtual ~MBEDEndpoint();
         ResourceFactory *initResourceFactory();
         void run();
diff -r 7992e9582e2e -r 789a1a8c5ebe MQTTTransport.cpp
--- a/MQTTTransport.cpp	Fri Sep 19 18:31:14 2014 +0000
+++ b/MQTTTransport.cpp	Fri Sep 26 05:16:26 2014 +0000
@@ -62,7 +62,7 @@
  PubSubClient _mqtt(MQTT_HOSTNAME,MQTT_HOSTPORT,_mqtt_message_handler);
   
  // default constructor
- MQTTTransport::MQTTTransport(ErrorHandler *error_handler,void *endpoint,MBEDToIOCResourceMap *map) : Transport(error_handler,endpoint) {
+ MQTTTransport::MQTTTransport(Logger *logger,void *endpoint,MBEDToIOCResourceMap *map) : Transport(logger,endpoint) {
      this->m_mqtt = NULL;
      _mqtt_instance = this;
      this->m_map = map;
diff -r 7992e9582e2e -r 789a1a8c5ebe MQTTTransport.h
--- a/MQTTTransport.h	Fri Sep 19 18:31:14 2014 +0000
+++ b/MQTTTransport.h	Fri Sep 26 05:16:26 2014 +0000
@@ -38,7 +38,7 @@
         int                   m_ping_countdown;
         
     public:
-        MQTTTransport(ErrorHandler *error_handler,void *endpoint,MBEDToIOCResourceMap *map);
+        MQTTTransport(Logger *logger,void *endpoint,MBEDToIOCResourceMap *map);
         virtual ~MQTTTransport();
        
         void processMessage(char *message_name,char *payload, unsigned int payload_length);