mbed Connector Interface simplification API on top of mbed-client
Fork of mbedConnectorInterfaceV3 by
NOTE:
This repo has been replaced with https://github.com/ARMmbed/mbedConnectorInterface. No further updates will occur with this repo. Please use the github repo instead. Thanks!
Diff: source/ConnectorEndpoint.cpp
- Revision:
- 15:c11dbe4d354c
- Parent:
- 13:9edad7677211
- Child:
- 23:5852c0884714
--- a/source/ConnectorEndpoint.cpp Thu Jun 09 19:05:18 2016 +0000 +++ b/source/ConnectorEndpoint.cpp Fri Jun 10 17:09:56 2016 +0000 @@ -89,6 +89,7 @@ this->m_options = (Options *)options; this->m_device_manager = NULL; this->m_connected = false; + this->m_registered = false; } // Copy Constructor @@ -102,6 +103,7 @@ this->m_device_object = ep.m_device_object; this->m_device_manager = ep.m_device_manager; this->m_connected = ep.m_connected; + this->m_registered = ep.m_registered; } // Destructor @@ -266,17 +268,22 @@ // object registered void Endpoint::object_registered(M2MSecurity */*security_object */, const M2MServer &/*server_object*/) { this->logger()->log("Endpoint registered"); + this->m_connected = true; + this->m_registered = true; } // registration updated void Endpoint::registration_updated(M2MSecurity */*security_object*/, const M2MServer &/*server_object*/) { this->logger()->log("Endpoint re-registered."); + this->m_connected = true; + this->m_registered = true; } // object unregistered void Endpoint::object_unregistered(M2MSecurity */*server_object*/) { // ready to exit this->logger()->log("Endpoint de-registered... Ready to exit..."); + this->m_registered = false; // stop exit(0); @@ -354,6 +361,11 @@ return this->m_connected; } +// Registered with mDC/mDS +bool Endpoint::isRegistered() { + return this->m_registered; +} + // our logger Logger *Endpoint::logger() {