use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
Diff: source/ConnectorEndpoint.cpp
- Revision:
- 74:6abfb2a03020
- Parent:
- 73:f12a767bc300
- Child:
- 75:9152ea6b4c59
--- a/source/ConnectorEndpoint.cpp Fri Nov 04 16:54:32 2016 +0000 +++ b/source/ConnectorEndpoint.cpp Fri Nov 04 22:06:32 2016 +0000 @@ -38,6 +38,11 @@ // LWIP Network interface instance NetworkInterface *__network_interface = NULL; +#ifdef ENABLE_MBED_CLOUD_SUPPORT +// Static mbed endpoint +static MbedCloudClient __mbed_cloud_client; +#endif + // Connector namespace namespace Connector { @@ -99,6 +104,7 @@ this->m_registered = false; this->m_csi = NULL; this->m_oim = NULL; + this->m_endpoint_interface = NULL; } // Copy Constructor @@ -190,8 +196,10 @@ #ifdef ENABLE_MBED_CLOUD_SUPPORT // mbedCloudClient: create our interface void Endpoint::createCloudEndpointInterface() { - this->m_endpoint_interface = new MbedCloudClient(); - + if (this->m_endpoint_interface == NULL) { + this->m_endpoint_interface = &__mbed_cloud_client; + } + // bind LWIP network interface pointer... if (__network_interface != NULL && this->m_endpoint_interface != NULL) { this->logger()->log("Connector::Endpoint: binding LWIP network instance (Cloud)...");