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:
- 14:717372430717
- Parent:
- 13:66f6cf705184
- Child:
- 15:363a3299e41a
--- a/MBEDEndpoint.cpp Mon Mar 31 18:14:23 2014 +0000 +++ b/MBEDEndpoint.cpp Mon Mar 31 18:47:19 2014 +0000 @@ -37,7 +37,7 @@ extern void closedown(int code); // default constructor - MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,EthernetInterface *ethernet) : BaseClass(error_handler,new IOCEndpoint(error_handler,NULL)) { + MBEDEndpoint::MBEDEndpoint(ErrorHandler *error_handler,void *ethernet) : BaseClass(error_handler,NULL) { bool success = true; this->m_instance_id = 0; this->m_preferences = NULL; @@ -58,7 +58,9 @@ if (success) this->initGWAddress(); if (success) this->logger()->log("IOC GW IP: %s",GW_IPADDRESS); if (PL_ENABLE && success) this->logger()->log("Philips Light ID: %d Philips Gateway IP: %s",PL_LIGHT_ID,PL_GW_ADDRESS); +#ifndef CELLULAR_NETWORK if (success) success = this->initializeEthernet(ethernet); +#endif if (success) this->logger()->turnLEDYellow(); if (success)this->m_map = new MBEDToIOCResourceMap(error_handler); if (success) success = this->initializeTransports(); @@ -74,7 +76,9 @@ if (success) this->logger()->turnLEDYellow(); if (success) success = this->closePersonalities(); if (success) success = this->closeTransports(); +#ifndef CELLULAR_NETWORK if (success) success = this->closeEthernet(); +#endif if (success) this->logger()->turnLEDBlue(); if (this->m_map != NULL) delete this->m_map; if (this->getEndpoint() != NULL) delete (IOCEndpoint *)this->getEndpoint(); @@ -213,6 +217,7 @@ return success; } + #ifndef CELLULAR_NETWORK // initialize our Ethernet bool MBEDEndpoint::initializeEthernet(EthernetInterface *ethernet) { bool success = false; @@ -241,6 +246,7 @@ } return success; } + #endif // load up all personality instances into the IOC bool MBEDEndpoint::loadPersonalities() { @@ -377,12 +383,14 @@ return success; } + #ifndef CELLULAR_NETWORK // close down our Ethernet bool MBEDEndpoint::closeEthernet() { this->logger()->log("Closing down Ethernet..."); if (this->m_ethernet != NULL) this->m_ethernet->disconnect(); return true; } + #endif // main running loop void MBEDEndpoint::run() {