mbed Connector Interface simplification API on top of mbed-client
Fork of mbedConnectorInterfaceV3 by
NOTE:
This repo has been replaced with https://github.com/ARMmbed/mbedConnectorInterface. No further updates will occur with this repo. Please use the github repo instead. Thanks!
Diff: source/OptionsBuilder.cpp
- Revision:
- 125:4bf229bf14a3
- Parent:
- 108:df7102357164
--- a/source/OptionsBuilder.cpp Mon Jun 05 21:28:42 2017 +0000 +++ b/source/OptionsBuilder.cpp Thu Jul 13 19:21:28 2017 +0000 @@ -24,6 +24,7 @@ #include "mbed-connector-interface/OptionsBuilder.h" // ResourceObserver support +#include "mbed-connector-interface/EventQueueResourceObserver.h" #include "mbed-connector-interface/ThreadedResourceObserver.h" #include "mbed-connector-interface/TickerResourceObserver.h" #include "mbed-connector-interface/MinarResourceObserver.h" @@ -187,20 +188,29 @@ ((DynamicResource *)resource)->setOptions(this); ((DynamicResource *)resource)->setEndpoint((const void *)this->getEndpoint()); if (((DynamicResource *)resource)->isObservable() == true && use_observer == true) { + // // Establish the appropriate ResourceObserver + // #if defined (MCI_MINAR_SCHEDULER) - // Minar-based Scheduler ResourceObserver + // mbedOS3 RTOS Minar-based Scheduler ResourceObserver MinarResourceObserver *observer = new MinarResourceObserver((DynamicResource *)resource,(int)sleep_time); -#else - #ifdef CONNECTOR_USING_THREADS +#endif + +#ifdef CONNECTOR_USING_THREADS // mbedOS RTOS Thread ResourceObserver ThreadedResourceObserver *observer = new ThreadedResourceObserver((DynamicResource *)resource,(int)sleep_time); - #endif - #ifdef CONNECTOR_USING_TICKER - // mbed Ticker ResourceObserver +#endif + +#ifdef CONNECTOR_USING_TICKER + // mbedOS RTOS Ticker ResourceObserver TickerResourceObserver *observer = new TickerResourceObserver((DynamicResource *)resource,(int)sleep_time); - #endif #endif + +#ifdef CONNECTOR_USING_EVENT_QUEUES + // mbedOS RTOS EventQueue ResourceObserver + EventQueueResourceObserver *observer = new EventQueueResourceObserver((DynamicResource *)resource,(int)sleep_time); +#endif + // If no observer type is set in mbed-connector-interface/configuration.h (EndpointNetwork lib), then "observer" will be unresolved this->m_resource_observers.push_back(observer);