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
Diff: api/DynamicResource.cpp
- Revision:
- 60:167e8f021e30
- Parent:
- 57:8335946f2c67
--- a/api/DynamicResource.cpp Sat Jul 25 06:04:40 2015 +0000 +++ b/api/DynamicResource.cpp Sat Sep 05 20:14:22 2015 +0000 @@ -404,8 +404,20 @@ // default observe behavior void DynamicResource::observe() { + this->observe(true); +} + +// behavior controlled observe behavior +void DynamicResource::observe(bool do_notify) { if (this->m_observable == true) { - this->notify(this->get()); + if (do_notify) { + // get() and notify() --> time-based observationing + this->notify(this->get()); + } + else { + // get() only (resource controls whether each iteration results in an observation or not...) + this->get(); + } } }