mqtt specific components for the impact mbed endpoint library
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp
Diff: MBEDEndpoint.cpp
- Revision:
- 39:fec38d630383
- Parent:
- 38:bf10a01eb123
- Child:
- 41:3f494366fc76
diff -r bf10a01eb123 -r fec38d630383 MBEDEndpoint.cpp --- a/MBEDEndpoint.cpp Sun Apr 13 17:27:23 2014 +0000 +++ b/MBEDEndpoint.cpp Mon Jun 30 22:17:40 2014 +0000 @@ -37,7 +37,7 @@ extern void closedown(int code); // default constructor - MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,void *transport,void *pinouts) : BaseClass(error_handler,NULL) { + MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,void *transport,void *extra) : BaseClass(error_handler,NULL) { bool success = true; this->m_instance_id = 0; this->m_preferences = NULL; @@ -46,10 +46,6 @@ 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)); -#ifdef CELLULAR_NETWORK - extern int getUbloxConnectStatus(); - if (getUbloxConnectStatus() != 0) success = false; -#endif if (success) this->initPreferences(); if (success) this->initEndpointName(); if (success) this->logger()->turnLEDBlue(); @@ -66,9 +62,9 @@ this->m_cellular_modem = NULL; this->m_gps = NULL; this->logger()->log("initializing Cellular Modem..."); - if (success) success = this->initializeCellularModem(transport,pinouts); - this->logger()->log("initializing GPS Receiver..."); - if (success) success = this->initializeGPSReceiver(pinouts); + if (success) success = this->initializeCellularModem(this->logger(),transport); + //this->logger()->log("initializing GPS Receiver..."); + //if (success) success = this->initializeGPSReceiver(this,extra); #else if (success) success = this->initializeEthernet((EthernetInterface *)transport); #endif @@ -251,22 +247,22 @@ } #ifdef CELLULAR_NETWORK - bool MBEDEndpoint::initializeCellularModem(void *transport,void *pinouts) { + bool MBEDEndpoint::initializeCellularModem(void *transport,void *modem) { bool success = false; // initialize - if (this->m_cellular_modem == NULL) this->m_cellular_modem = new MBEDUbloxCellRadio(this->logger(),(void *)this,(UBLOX_MODEM *)transport,(C027 *)pinouts); + if (this->m_cellular_modem == NULL) this->m_cellular_modem = new MBEDUbloxCellRadio(this->logger(),(void *)this,modem); if (this->m_cellular_modem != NULL) success = this->m_cellular_modem->connect(); // return our status return success; } - bool MBEDEndpoint::initializeGPSReceiver(void *pinouts) { + bool MBEDEndpoint::initializeGPSReceiver(void *gps) { bool success = false; // initialize - if (this->m_gps == NULL) this->m_gps = new MBEDUbloxGPS(this->logger(),(void *)this,(C027 *)pinouts); + if (this->m_gps == NULL) this->m_gps = new MBEDUbloxGPS(this->logger(),(void *)this,gps); if (this->m_gps != NULL) success = this->m_gps->connect(); // return our status