use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
Diff: source/ConnectorEndpoint.cpp
- Revision:
- 77:cee832ba6dd0
- Parent:
- 76:7f55e1c0635d
- Child:
- 81:a2441163a06e
diff -r 7f55e1c0635d -r cee832ba6dd0 source/ConnectorEndpoint.cpp --- a/source/ConnectorEndpoint.cpp Fri Nov 04 22:28:13 2016 +0000 +++ b/source/ConnectorEndpoint.cpp Fri Nov 04 22:32:30 2016 +0000 @@ -348,72 +348,19 @@ } } +// register the endpoint +void Endpoint::register_endpoint(M2MSecurity *endpoint_security, M2MObjectList endpoint_objects) { #ifdef ENABLE_MBED_CLOUD_SUPPORT -// register the endpoint -void Endpoint::register_endpoint(M2MObjectList endpoint_objects) { if (this->m_endpoint_interface != NULL) { this->m_endpoint_interface->add_objects(endpoint_objects); } -} - -// object registered -void Endpoint::object_registered() { - this->logger()->log("Connector::Endpoint: endpoint registered."); - this->m_connected = true; - this->m_registered = true; - if (this->m_csi != NULL) { - this->m_csi->object_registered((void *)this); - } -} - -// registration updated -void Endpoint::registration_updated() { - this->logger()->log("Connector::Endpoint: endpoint re-registered."); - this->m_connected = true; - this->m_registered = true; - if (this->m_csi != NULL) { - this->m_csi->registration_updated((void *)this); - } -} - -// object unregistered -void Endpoint::object_unregistered() { - // DEBUG - this->logger()->log("Connector::Endpoint: endpoint de-registered."); - - // no longer connected/registered - this->m_registered = false; - this->m_connected = false; - - // stop all observers... - this->stopObservations(); - - // invoke ConnectionHandler if we have one... - if (this->m_csi != NULL) { - this->m_csi->object_unregistered((void *)this); - } - - // halt the main event loop... we are done. - net_shutdown_endpoint(); -} - -// bootstrap done -void Endpoint::bootstrap_done() { - this->logger()->log("Connector::Endpoint: endpoint bootstrapped."); - if (this->m_csi != NULL) { - this->m_csi->bootstrapped((void *)this); - } -} - #else - -// register the endpoint -void Endpoint::register_endpoint(M2MSecurity *endpoint_security, M2MObjectList endpoint_objects) { if (this->m_endpoint_interface != NULL && endpoint_security != NULL && endpoint_objects.size() > 0) { // register endpoint this->logger()->log("Connector::Endpoint: registering endpoint..."); this->m_endpoint_interface->register_object(endpoint_security, endpoint_objects); } +#endif } // object registered @@ -464,7 +411,6 @@ this->m_csi->bootstrapped((void *)this,(void *)server); } } -#endif // resource value updated void Endpoint::value_updated(M2MBase *base, M2MBase::BaseType type) {