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 Vincent Wochnik

Committer:
vwochnik
Date:
Wed Oct 29 21:09:29 2014 +0000
Revision:
62:86a04c5bda18
Parent:
60:3c822f97fc73
Child:
63:010bbbb4732a
introduced operation store

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vwochnik 57:4af5f1bec3a6 1 #ifndef OPERATIONSUPPORT_H
vwochnik 57:4af5f1bec3a6 2 #define OPERATIONSUPPORT_H
vwochnik 57:4af5f1bec3a6 3
vwochnik 60:3c822f97fc73 4 #include "rtos.h"
vwochnik 62:86a04c5bda18 5 #include "OperationExecutor.h"
vwochnik 57:4af5f1bec3a6 6 #include "AbstractSmartRest.h"
vwochnik 57:4af5f1bec3a6 7 #include "SmartRestTemplate.h"
vwochnik 59:f96be79feccd 8 #include "ComposedRecord.h"
vwochnik 59:f96be79feccd 9 #include "CharValue.h"
vwochnik 59:f96be79feccd 10 #include "OperationStore.h"
vwochnik 59:f96be79feccd 11 #include "ParsedRecord.h"
vwochnik 57:4af5f1bec3a6 12
vwochnik 57:4af5f1bec3a6 13 class OperationSupport
vwochnik 57:4af5f1bec3a6 14 {
vwochnik 57:4af5f1bec3a6 15 public:
vwochnik 57:4af5f1bec3a6 16 OperationSupport(AbstractSmartRest&, SmartRestTemplate&, long&);
vwochnik 57:4af5f1bec3a6 17
vwochnik 57:4af5f1bec3a6 18 bool init();
vwochnik 57:4af5f1bec3a6 19 bool run();
vwochnik 57:4af5f1bec3a6 20
vwochnik 59:f96be79feccd 21 protected:
vwochnik 59:f96be79feccd 22 bool operationFromRecord(ParsedRecord&, OperationStore::Operation&);
vwochnik 59:f96be79feccd 23 bool updateOperation(OperationStore::Operation&);
vwochnik 59:f96be79feccd 24 CharValue& operationStateValue(OperationStore::Operation&);
vwochnik 59:f96be79feccd 25
vwochnik 60:3c822f97fc73 26 void thread();
vwochnik 60:3c822f97fc73 27 static void thread_func(void const*);
vwochnik 60:3c822f97fc73 28
vwochnik 57:4af5f1bec3a6 29 private:
vwochnik 57:4af5f1bec3a6 30 bool _init;
vwochnik 57:4af5f1bec3a6 31 long& _deviceId;
vwochnik 57:4af5f1bec3a6 32 SmartRestTemplate& _tpl;
vwochnik 57:4af5f1bec3a6 33 AbstractSmartRest& _client;
vwochnik 62:86a04c5bda18 34 OperationStore _store;
vwochnik 62:86a04c5bda18 35 OperationExecutor _executor;
vwochnik 60:3c822f97fc73 36 Thread _thread;
vwochnik 57:4af5f1bec3a6 37 };
vwochnik 57:4af5f1bec3a6 38
vwochnik 59:f96be79feccd 39 extern CharValue aOperationStatePending;
vwochnik 59:f96be79feccd 40 extern CharValue aOperationStateExecuting;
vwochnik 59:f96be79feccd 41 extern CharValue aOperationStateSuccessful;
vwochnik 59:f96be79feccd 42 extern CharValue aOperationStateFailed;
vwochnik 59:f96be79feccd 43
vwochnik 57:4af5f1bec3a6 44 #endif