mbedConnectorInterface back port from mbedOS v3 using mbed-client C++ call interface
Diff: source/ThreadedResourceObserver.cpp
- Revision:
- 13:9edad7677211
- Parent:
- 0:1f1f55e73248
- Child:
- 16:dffa38c3340f
--- a/source/ThreadedResourceObserver.cpp Thu Mar 10 16:02:04 2016 +0000 +++ b/source/ThreadedResourceObserver.cpp Wed Jun 08 22:32:08 2016 +0000 @@ -53,7 +53,7 @@ ThreadedResourceObserver *me = (ThreadedResourceObserver *)instance; while(true) { Thread::wait(me->getSleepTime()); - if (me->isObserving() == true && me->getResource() != NULL) { + if (me->isObserving() == true && me->getResource() != NULL && me->getResource()->isConnected() == true) { // // implementsObservation(): This switch denotes whether this threaded resource generates its own observations or relies on the heartbeat (time-based) mechanism. // -- if resource itself doesn't implement it, then we can call notify() with the get() on each heartbeat of the threaded resource (see note below)