nsp specific components for the NSP version of the impact endpoint

Dependents:   mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet mbed_nsp_endpoint_nxp

Revision:
5:94d000e6fa70
Parent:
4:7f7fe167d9c0
Child:
6:edf306673e54
--- a/MBEDEndpoint.cpp	Fri Mar 28 17:08:22 2014 +0000
+++ b/MBEDEndpoint.cpp	Fri Mar 28 17:53:14 2014 +0000
@@ -33,15 +33,14 @@
  extern void closedown(int code);
   
  // default constructor
- MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,EthernetInterface *ethernet) {
+ MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,EthernetInterface *ethernet) : BaseClass(error_handler,NULL) {
      bool success = true;
      this->m_preferences = NULL;
      this->m_instance_id = 0;
      memset(this->m_lcd_status,0,TEMP_BUFFER_LEN+1);
      memset(this->m_nsp_address,0,PREFERENCE_VALUE_LEN+1);
      for(int i=0;i<NUM_TRANSPORTS;++i) this->m_transports[i] = NULL;
-     this->m_error_handler = error_handler;
-     this->m_error_handler->setEndpoint((void *)this);
+     this->logger()->setEndpoint((void *)this);
      if (success) this->initPreferences();
      if (success) this->initEndpointName();
      if (success) this->logger()->turnLEDBlue();
@@ -179,12 +178,12 @@
       
       if (success == true) {
         // NSP Initialization
-        success = this->initializeTransport(NSP_TRANSPORT,"NSP",new NSPTransport(this->m_error_handler,this));
+        success = this->initializeTransport(NSP_TRANSPORT,"NSP",new NSPTransport(this->logger(),this));
       }
       
       if  (success == true) {
         // HTTP Initialization
-        success = this->initializeTransport(HTTP_TRANSPORT,"HTTP",new HTTPTransport(this->m_error_handler,this));
+        success = this->initializeTransport(HTTP_TRANSPORT,"HTTP",new HTTPTransport(this->logger(),this));
       }
       
       return success;
@@ -252,9 +251,6 @@
      return true;
  }
  
- // get our error handler
- ErrorHandler *MBEDEndpoint::logger() { return this->m_error_handler; }
- 
  // main running loop
  void MBEDEndpoint::run() {
      this->logger()->log("Endpoint Main Loop");