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:
101:dbcd3bc51758
Parent:
100:47ea098f8a47
Child:
108:f1ee3e1eb126
--- a/config/ConfigSync.h	Thu May 07 13:56:19 2015 +0000
+++ b/config/ConfigSync.h	Fri May 08 12:19:57 2015 +0000
@@ -1,33 +1,29 @@
-#ifndef CONFIGURATIONSYNCHRONIZATION_H
-#define CONFIGURATIONSYNCHRONIZATION_H
+#ifndef CONFIGSYNC_H
+#define CONFIGSYNC_H
+#include "AbstractReporter.h"
+#include "ConfigParser.h"
 
-#include "AbstractSmartRest.h"
-#include "SmartRestTemplate.h"
-#include "ConfigurationProperties.h"
-
-class ConfigSync
+class ConfigSync : public AbstractReporter
 {
 public:
-    ConfigSync(AbstractSmartRest&, SmartRestTemplate&);
-    
-    bool init();
-    bool integrate();
-    bool run();
-    
-    bool updateConfiguration(const char*);
-
+        ConfigSync(): dict(), cp(), changed(true) {}
+        virtual ~ConfigSync() {}
+        virtual bool init() {
+                resetConfiguration();
+                loadConfiguration();
+                return true;
+        }
+        virtual const char* name() const { return "Conf"; }
+        virtual size_t read(char*, size_t, char*, size_t);
+        bool updateConfiguration(const char*);
 protected:
-    bool updateDeviceObject();
-    bool loadConfiguration();
-    bool saveConfiguration();
-
+        void resetConfiguration();
+        void loadConfiguration();
+        void saveConfiguration() const;
 private:
-    bool _init;
-    bool _changed;
-    SmartRestTemplate& _tpl;
-    AbstractSmartRest& _client;
-    DeviceConfiguration _deviceConfiguration;
-    ConfigurationProperties _configurationProperties;
+        Dict dict;
+        ConfigParser cp;
+        bool changed;
 };
 
-#endif
\ No newline at end of file
+#endif /* CONFIGSYNC_H */
\ No newline at end of file