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

Revision:
94:61d44636f020
Parent:
93:0acd11870c6a
Child:
99:e369fc75c000
--- a/operation/OperationSupport.h	Mon Apr 13 14:24:58 2015 +0000
+++ b/operation/OperationSupport.h	Mon Apr 20 15:04:23 2015 +0000
@@ -1,53 +1,32 @@
 #ifndef OPERATIONSUPPORT_H
 #define OPERATIONSUPPORT_H
 
-#include "rtos.h"
-#include "ConfigurationSynchronization.h"
-#include "OperationExecutor.h"
-//#include "AbstractSmartRest.h"
-#include "RtosSmartRest.h"
+#include "Operation.h"
+#include "SmartRest.h"
 #include "SmartRestTemplate.h"
-#include "ComposedRecord.h"
-#include "CharValue.h"
-#include "Operation.h"
-#include "ParsedRecord.h"
-#include "IntegerValue.h"
-
-#define POOL_SIZE 64
 
 class OperationSupport
 {
 public:
-    OperationSupport(RtosSmartRest&, SmartRestTemplate&, long&, ConfigurationSynchronization&, LCDDisplay&);
-
+    OperationSupport(SmartRest& client, SmartRestTemplate& tpl,
+    long& deviceId, OperationPool& pool):
+    _init(false), _firstRun(true), _deviceId(deviceId), _tpl(tpl),
+    _client(client), opool(pool) {}
     bool init();
     bool run();
 
 protected:
     bool requestPendingOperations();
-    bool operationFromRecord(ParsedRecord&, Operation&);
     bool executePendingOperation(Operation&);
-//    CharValue& operationStateValue(OperationState state) const;
-    const char * getOperationStateChar(OperationState) const;
-
-    void thread2();
-    void thread3();
-
-    static void thread2_func(void const*);
-    static void thread3_func(void const*);
+    bool operationFromRecord(ParsedRecord& record, Operation& op);
 
 private:
-    bool _init, _firstRun;
+    bool _init;
+    bool _firstRun;
     long& _deviceId;
     SmartRestTemplate& _tpl;
-    RtosSmartRest& _client;
-    Mail<Operation, POOL_SIZE> opool;
-    OperationExecutor _executor;
-    TCPSocketConnection sock;
-    char buf[300];
-    char buf2[50];
-    Thread _thread2;
-    Thread _thread3;
+    SmartRest& _client;
+    OperationPool& opool;
 };
 
 #endif
\ No newline at end of file