Doug Anson / mbedConnectorInterface

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Sun Apr 12 04:00:53 2015 +0000
Parent:
46:cc6076ac5026
Child:
48:4b9ee3e32f93
Commit message:
another fix for options builder

Changed in this revision

api/OptionsBuilder.cpp Show annotated file Show diff for this revision Revisions of this file
api/OptionsBuilder.h Show annotated file Show diff for this revision Revisions of this file
--- a/api/OptionsBuilder.cpp	Sun Apr 12 03:48:37 2015 +0000
+++ b/api/OptionsBuilder.cpp	Sun Apr 12 04:00:53 2015 +0000
@@ -153,6 +153,13 @@
 }
 
 // add dynamic resource
+OptionsBuilder &OptionsBuilder::addResource(const DynamicResource *resource,const int sleep_time)
+{
+    // ensure that the boolean isn't mistaken by the compiler for the obs period...
+    return this->addResource(resource,sleep_time,!(((DynamicResource *)resource)->implementsObservation()));
+}
+
+// add dynamic resource
 OptionsBuilder &OptionsBuilder::addResource(const DynamicResource *resource,const bool use_observer)
 {
     // ensure that the boolean isn't mistaken by the compiler for the obs period...
--- a/api/OptionsBuilder.h	Sun Apr 12 03:48:37 2015 +0000
+++ b/api/OptionsBuilder.h	Sun Apr 12 04:00:53 2015 +0000
@@ -140,6 +140,14 @@
     Add a NSDL endpoint resource (dynamic)
     @param dynamic_resource input the NSDL dynamic resource
     @param sleep_time input the observation sleep time in milliseconds (for observable resource only)
+    @return instance to ourself
+    */
+    OptionsBuilder &addResource(const DynamicResource *dynamic_resource,const int sleep_time);
+    
+    /**
+    Add a NSDL endpoint resource (dynamic)
+    @param dynamic_resource input the NSDL dynamic resource
+    @param sleep_time input the observation sleep time in milliseconds (for observable resource only)
     @param use_observer input if true, use an appropriate ResourceObserver to observer. if false, the underlying resource will handle it 
     @return instance to ourself
     */