
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
operation/OperationSupport.h
- Committer:
- xinlei
- Date:
- 2015-03-20
- Revision:
- 90:423177e8a401
- Parent:
- 82:ca7430f50b2b
- Child:
- 92:0acd11870c6a
File content as of revision 90:423177e8a401:
#ifndef OPERATIONSUPPORT_H #define OPERATIONSUPPORT_H #include "rtos.h" #include "ConfigurationSynchronization.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&, ConfigurationSynchronization&, DeviceIO&, DisplayInfo&); bool init(); bool run(); protected: bool requestPendingOperations(); bool operationFromRecord(ParsedRecord&, OperationStore::Operation&); bool updateOperation(OperationStore::Operation&); CharValue& operationStateValue(OperationStore::Operation&); void thread1(); void thread2(); void thread3(); static void thread1_func(void const*); static void thread2_func(void const*); static void thread3_func(void const*); private: bool _init, _firstRun; long& _deviceId; SmartRestTemplate& _tpl; AbstractSmartRest& _client; OperationStore _store; OperationExecutor _executor; Thread _thread1; Thread _thread2; Thread _thread3; }; extern CharValue aOperationStatePending; extern CharValue aOperationStateExecuting; extern CharValue aOperationStateSuccessful; extern CharValue aOperationStateFailed; #endif