added max-age and content-format

Fork of mbedConnectorInterface by Doug Anson

Revision:
43:769d491a48c1
Parent:
36:1c6c45584c13
--- 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