mbed Connector Interface simplification API on top of mbed-client

Fork of mbedConnectorInterfaceV3 by Doug Anson

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!

Revision:
54:dfee8691c83a
Parent:
34:a10d65907549
Child:
65:57ad7b72108f
--- a/source/ThreadedResourceObserver.cpp	Mon Aug 08 19:02:00 2016 +0000
+++ b/source/ThreadedResourceObserver.cpp	Tue Aug 09 17:18:49 2016 +0000
@@ -31,8 +31,14 @@
                                                             ,m_observation_thread(&ThreadedResourceObserver::_observation_notifier,this) 
                                                             {
         this->setObserving(false);
+        
         // DEBUG
-        std::printf("ThreadedResourceObserver being used for %s (sleep_time=%d)\r\n",resource->getFullName().c_str(),sleep_time);
+        if (sleep_time > 0) {
+            this->logger()->log("ThreadedResourceObserver being used for %s (sleep_time: %d ms)",resource->getFullName().c_str(),sleep_time);
+        }
+        else {
+            this->logger()->log("ThreadedResourceObserver being used for %s",resource->getFullName().c_str());
+        }
  }
  
  // destructor
@@ -62,4 +68,9 @@
      this->setObserving(false);
  }
  
+ // halt the underlying observer mechanism
+ void ThreadedResourceObserver::halt() {
+     m_observation_thread.terminate();
+ }
+ 
  #endif // CONNECTOR_USING_THREADS
\ No newline at end of file