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/MinarResourceObserver.cpp
- Revision:
- 54:dfee8691c83a
- Parent:
- 37:2a5d98881956
- Child:
- 122:4072e03884e4
--- a/source/MinarResourceObserver.cpp Mon Aug 08 19:02:00 2016 +0000 +++ b/source/MinarResourceObserver.cpp Tue Aug 09 17:18:49 2016 +0000 @@ -25,19 +25,17 @@ #if defined(MCI_MINAR_SCHEDULER) -// DEBUG -#ifndef NDEBUG -#define DEBUG_OUT(...) { printf(__VA_ARGS__); } -#else -#define DEBUG_OUT(...) /* nothing */ -#endif - // constructor MinarResourceObserver::MinarResourceObserver(DynamicResource *resource,int sleep_time) : ResourceObserver(resource,sleep_time) { - this->setObserving(false); + this->setObserving(false); - // DEBUG - DEBUG_OUT("MinarResourceObserver being used for %s (sleep_time=%d ms)\r\n",resource->getName().c_str(),sleep_time); + // DEBUG + if (sleep_time > 0) { + this->logger()->log("MinarResourceObserver being used for %s (sleep_time: %d ms)",resource->getFullName().c_str(),sleep_time); + } + else { + this->logger()->log("MinarResourceObserver being used for %s",resource->getFullName().c_str()); + } } // destructor @@ -63,4 +61,9 @@ this->setObserving(false); } + // halt the underlying observer mechanism + void MinarResourceObserver::halt() { + minar::Scheduler::stop(); + } + #endif // MCI_MINAR_SCHEDULER