Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: config/ConfigSync.cpp
- Revision:
 - 105:c61f0d62b625
 - Parent:
 - 104:fd3571349e5d
 - Child:
 - 110:ee9ae4a5e55c
 
--- a/config/ConfigSync.cpp	Fri May 08 14:50:43 2015 +0000
+++ b/config/ConfigSync.cpp	Mon May 11 18:10:44 2015 +0000
@@ -10,12 +10,21 @@
 
 bool validateConfiguration(Dict& d)
 {
-        return d.get(INTERVAL_KEY);
+        const Dict::Item *p = d.get(INTERVAL_KEY);
+        if (p) {
+                int v = 0, n = 0;
+                sscanf(p->value, "%d%n", &v, &n);
+                if (v > 0 && n == strlen(p->value))
+                        return true;
+                else
+                        return false;
+        } else
+                return false;
 }
 
 size_t ConfigSync::read(char *buf, size_t maxLen, char *status, size_t num)
 {
-        static const char *fmt = "130,%ld,%s,%.*s\r\n";
+        static const char *fmt = "130,%ld,\"%s\",%.*s\r\n";
         int l = 0;
         if (changed) {
                 changed = false;
    