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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ConfigSync.h Source File

ConfigSync.h

00001 #ifndef CONFIGSYNC_H
00002 #define CONFIGSYNC_H
00003 #include "AbstractReporter.h"
00004 #include "ConfigParser.h"
00005 
00006 class ConfigSync : public AbstractReporter
00007 {
00008 private:
00009         ConfigSync(): dict(), cp(), changed(true) {}
00010 public:
00011         virtual ~ConfigSync() {}
00012         virtual bool init() {
00013                 loadConfiguration();
00014                 return true;
00015         }
00016         static ConfigSync& inst() {
00017                 static ConfigSync _ref;
00018                 return _ref;
00019         }
00020         virtual const char* name() const { return "Conf"; }
00021         virtual int read(char*, size_t, char*, size_t);
00022         bool updateConfiguration(const char*);
00023 protected:
00024         void resetConfiguration();
00025         void loadConfiguration();
00026         void saveConfiguration() const;
00027 private:
00028         Dict dict;
00029         ConfigParser cp;
00030         bool changed;
00031 };
00032 
00033 #endif /* CONFIGSYNC_H */