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/ThreadedResourceObserver.cpp
- Revision:
- 16:dffa38c3340f
- Parent:
- 13:9edad7677211
- Child:
- 31:2507e64fcc42
diff -r c11dbe4d354c -r dffa38c3340f source/ThreadedResourceObserver.cpp --- a/source/ThreadedResourceObserver.cpp Fri Jun 10 17:09:56 2016 +0000 +++ b/source/ThreadedResourceObserver.cpp Fri Jun 10 18:53:01 2016 +0000 @@ -22,11 +22,6 @@ #include "ThreadedResourceObserver.h" - #ifdef CONNECTOR_USING_THREADS - // DEBUG - //DigitalOut __threaded_led(LED2); - #endif - // constructor ThreadedResourceObserver::ThreadedResourceObserver(DynamicResource *resource,int sleep_time) : ResourceObserver(resource,sleep_time) @@ -53,18 +48,8 @@ ThreadedResourceObserver *me = (ThreadedResourceObserver *)instance; while(true) { Thread::wait(me->getSleepTime()); - 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) - // -- otherwise, we let the resource itself call observe() as part of its observation implementation - // - // note: this is independent of whether the resource, when declared, is defined as an observable resource or not. If not, then notify() wont be called - // as there will be no observations for this resource regardless of this switch value. - // - bool do_notify = !(me->getResource()->implementsObservation()); + if (me->isObserving() == true && me->getResource() != NULL && me->getResource()->isRegistered() == true) { me->getResource()->observe(); - //__threaded_led = !__threaded_led; } } #endif