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
config/ConfigSync.h@139:f8ab852e83e7, 2016-08-08 (annotated)
- Committer:
- xinlei
- Date:
- Mon Aug 08 11:05:57 2016 +0000
- Revision:
- 139:f8ab852e83e7
- Parent:
- 137:a52821cdb108
Etisalat and Teleena APN.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
xinlei | 101:dbcd3bc51758 | 1 | #ifndef CONFIGSYNC_H |
xinlei | 101:dbcd3bc51758 | 2 | #define CONFIGSYNC_H |
xinlei | 101:dbcd3bc51758 | 3 | #include "AbstractReporter.h" |
xinlei | 101:dbcd3bc51758 | 4 | #include "ConfigParser.h" |
xinlei | 99:e369fc75c000 | 5 | |
xinlei | 101:dbcd3bc51758 | 6 | class ConfigSync : public AbstractReporter |
xinlei | 99:e369fc75c000 | 7 | { |
xinlei | 108:f1ee3e1eb126 | 8 | private: |
xinlei | 108:f1ee3e1eb126 | 9 | ConfigSync(): dict(), cp(), changed(true) {} |
xinlei | 99:e369fc75c000 | 10 | public: |
xinlei | 101:dbcd3bc51758 | 11 | virtual ~ConfigSync() {} |
xinlei | 101:dbcd3bc51758 | 12 | virtual bool init() { |
xinlei | 101:dbcd3bc51758 | 13 | loadConfiguration(); |
xinlei | 101:dbcd3bc51758 | 14 | return true; |
xinlei | 101:dbcd3bc51758 | 15 | } |
xinlei | 108:f1ee3e1eb126 | 16 | static ConfigSync& inst() { |
xinlei | 108:f1ee3e1eb126 | 17 | static ConfigSync _ref; |
xinlei | 108:f1ee3e1eb126 | 18 | return _ref; |
xinlei | 108:f1ee3e1eb126 | 19 | } |
xinlei | 101:dbcd3bc51758 | 20 | virtual const char* name() const { return "Conf"; } |
xinlei | 137:a52821cdb108 | 21 | virtual int read(char*, size_t, char*, size_t); |
xinlei | 101:dbcd3bc51758 | 22 | bool updateConfiguration(const char*); |
xinlei | 99:e369fc75c000 | 23 | protected: |
xinlei | 101:dbcd3bc51758 | 24 | void resetConfiguration(); |
xinlei | 101:dbcd3bc51758 | 25 | void loadConfiguration(); |
xinlei | 101:dbcd3bc51758 | 26 | void saveConfiguration() const; |
xinlei | 99:e369fc75c000 | 27 | private: |
xinlei | 101:dbcd3bc51758 | 28 | Dict dict; |
xinlei | 101:dbcd3bc51758 | 29 | ConfigParser cp; |
xinlei | 101:dbcd3bc51758 | 30 | bool changed; |
xinlei | 99:e369fc75c000 | 31 | }; |
xinlei | 99:e369fc75c000 | 32 | |
xinlei | 101:dbcd3bc51758 | 33 | #endif /* CONFIGSYNC_H */ |