mqtt specific components for the impact mbed endpoint library

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp

Revision:
33:7e7f39fad51a
Parent:
0:a3fc1c6ef150
Child:
36:23a1b2dde4d9
--- a/IOCHTTPTransport.cpp	Thu Apr 10 03:16:57 2014 +0000
+++ b/IOCHTTPTransport.cpp	Fri Apr 11 03:06:13 2014 +0000
@@ -17,6 +17,7 @@
  */
  
  #include "IOCHTTPTransport.h"
+ #include "MBEDEndpoint.h"
    
  // default constructor
  IOCHTTPTransport::IOCHTTPTransport(ErrorHandler *error_handler,void *endpoint) : HTTPTransport(error_handler,endpoint) {
@@ -72,9 +73,12 @@
          sprintf(this->m_url_buffer,IOC_REST_URL,IOC_HOST_NAME,IOC_DATASOURCE_ID,ioc_id_str);
      }
      else {
+         // get our endpoint
+         MBEDEndpoint *endpoint = (MBEDEndpoint *)this->getEndpoint();
+         
          // use the GW HTTP redirector
          memset(this->m_url_buffer,0,IOC_REST_URL_LEN+1);
-         sprintf(this->m_url_buffer,GW_REDIRECT_URL,GW_IPADDRESS);
+         sprintf(this->m_url_buffer,GW_REDIRECT_URL,endpoint->getGWAddress());
      }
      return this->m_url_buffer;
  }