Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbedConnectorInterface by
Revision 48:f6dc5f56b810, committed 2015-04-13
- Comitter:
- michaeljkoster
- Date:
- Mon Apr 13 22:36:34 2015 +0000
- Parent:
- 47:e75750ddc413
- Commit message:
- update DynamicResource and OptionsBuilder for observe
Changed in this revision
api/DynamicResource.cpp | Show annotated file Show diff for this revision Revisions of this file |
api/OptionsBuilder.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/api/DynamicResource.cpp Sun Apr 12 04:00:53 2015 +0000 +++ b/api/DynamicResource.cpp Mon Apr 13 22:36:34 2015 +0000 @@ -29,6 +29,7 @@ #include "ResourceObserver.h" // Leaving this disabled until the CoAP draft spec is further along... +#define GET_ENABLE_DISABLE_OBS #ifdef GET_ENABLE_DISABLE_OBS // GET verb can Start/Stop Observations... #define START_OBS 0 @@ -319,6 +320,9 @@ if (status == 0) { this->logger()->log("ERROR: resource(NOTIFY) send failed..."); } + else{ + this->m_obs_number++; + } // return our status return status;
--- a/api/OptionsBuilder.cpp Sun Apr 12 04:00:53 2015 +0000 +++ b/api/OptionsBuilder.cpp Mon Apr 13 22:36:34 2015 +0000 @@ -178,7 +178,9 @@ TickerResourceObserver *observer = new TickerResourceObserver((DynamicResource *)resource,(int)sleep_time); #endif this->m_resource_observers.push_back(observer); +#ifdef ENABLE_OBS_ON_START observer->beginObservation(); +#endif } } return *this;