Official reference client implementation for Cumulocity SmartREST on u-blox C027.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
operation/OperationSupport.h
- Committer:
- vwochnik
- Date:
- 2014-10-30
- Revision:
- 65:a62dbef2f924
- Parent:
- 63:010bbbb4732a
- Child:
- 67:c360a2b2c948
File content as of revision 65:a62dbef2f924:
#ifndef OPERATIONSUPPORT_H #define OPERATIONSUPPORT_H #include "rtos.h" #include "DeviceIO.h" #include "OperationExecutor.h" #include "AbstractSmartRest.h" #include "SmartRestTemplate.h" #include "ComposedRecord.h" #include "CharValue.h" #include "OperationStore.h" #include "ParsedRecord.h" class OperationSupport { public: OperationSupport(AbstractSmartRest&, SmartRestTemplate&, long&, DeviceIO&); bool init(); bool run(); protected: bool requestPendingOperations(); bool operationFromRecord(ParsedRecord&, OperationStore::Operation&); bool updateOperation(OperationStore::Operation&); CharValue& operationStateValue(OperationStore::Operation&); void thread1(); void thread2(); static void thread1_func(void const*); static void thread2_func(void const*); private: bool _init; long& _deviceId; SmartRestTemplate& _tpl; AbstractSmartRest& _client; OperationStore _store; OperationExecutor _executor; Thread _thread1, _thread2; }; extern CharValue aOperationStatePending; extern CharValue aOperationStateExecuting; extern CharValue aOperationStateSuccessful; extern CharValue aOperationStateFailed; #endif