use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
Diff: source/ConnectorEndpoint.cpp
- Revision:
- 73:f12a767bc300
- Parent:
- 72:6b1d37b5420a
- Child:
- 74:6abfb2a03020
--- a/source/ConnectorEndpoint.cpp Fri Nov 04 16:32:41 2016 +0000 +++ b/source/ConnectorEndpoint.cpp Fri Nov 04 16:54:32 2016 +0000 @@ -107,7 +107,9 @@ this->m_logger = ep.m_logger; this->m_options = ep.m_options; this->m_endpoint_interface = ep.m_endpoint_interface; +#ifndef ENABLE_MBED_CLOUD_SUPPORT this->m_endpoint_security = ep.m_endpoint_security; +#endif this->m_endpoint_object_list = ep.m_endpoint_object_list; this->m_device_manager = ep.m_device_manager; this->m_connected = ep.m_connected; @@ -120,8 +122,11 @@ Endpoint::~Endpoint() { if (this->m_endpoint_interface != NULL) delete this->m_endpoint_interface; + +#ifndef ENABLE_MBED_CLOUD_SUPPORT if (this->m_endpoint_security != NULL) delete this->m_endpoint_security; +#endif } // set the device manager @@ -149,20 +154,29 @@ return this->m_options; } +#ifndef ENABLE_MBED_CLOUD_SUPPORT // get our Server M2MSecurity *Endpoint::getEndpointSecurity() { return this->m_endpoint_security; } +#endif // get our ObjectList M2MObjectList Endpoint::getEndpointObjectList() { return this->m_endpoint_object_list; } +#ifdef ENABLE_MBED_CLOUD_SUPPORT +// get our endpoint interface +MbedCloudClient *Endpoint::getEndpointInterface() { + return this->m_endpoint_interface; +} +#else // get our endpoint interface M2MInterface *Endpoint::getEndpointInterface() { return this->m_endpoint_interface; } +#endif // Connector::Endpoint: create our interface void Endpoint::createEndpointInterface() { @@ -186,6 +200,7 @@ } #endif +#ifndef ENABLE_MBED_CLOUD_SUPPORT // mbed-client: create our interface void Endpoint::createConnectorEndpointInterface() { // get the CoAP listening port @@ -243,7 +258,6 @@ } } -#ifndef ENABLE_MBED_CLOUD_SUPPORT // mbed-client: createEndpointInstance() M2MSecurity *Endpoint::createEndpointInstance() { // Creates register server object with mbed device server address and other parameters