mbed Connector Endpoint interface. This interface permits a mbed endpoint to easily setup MDS resources and emit those resources to an MDS server.

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Revision:
43:769d491a48c1
Parent:
36:1c6c45584c13
Child:
60:167e8f021e30
--- a/api/ThreadedResourceObserver.cpp	Sat Apr 11 21:14:28 2015 +0000
+++ b/api/ThreadedResourceObserver.cpp	Sat Apr 11 21:45:27 2015 +0000
@@ -22,6 +22,11 @@
  
  #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) 
@@ -29,6 +34,9 @@
                                                             ,m_observation_thread(&ThreadedResourceObserver::_observation_notifier,this) 
  #endif 
                                                             {
+        this->setObserving(false);
+        // DEBUG
+        std::printf("ThreadedResourceObserver being used for %s (sleep_time=%d)\r\n",resource->getName().c_str(),sleep_time);
  }
  
  // destructor
@@ -47,6 +55,7 @@
          Thread::wait(me->getSleepTime());
          if (me->isObserving() == true && me->getResource() != NULL && nsdl_endpoint_is_registered() == true) {
              me->getResource()->observe();
+             //__threaded_led = !__threaded_led;
          }
      }
  #endif