An application to log WiFi SSIDs for position lookup testing

Dependencies:   C027_Support SWO mbed-rtos mbed picojson

Fork of lpc4088_ebb_ublox_Cellular_PubNubDemo_rtos by EmbeddedArtists AB

Revision:
1:cac9b2960637
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ConfigurationProperties.cpp	Sun Feb 15 22:04:12 2015 +0000
@@ -0,0 +1,33 @@
+#include "ConfigurationProperties.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+ConfigurationProperties::ConfigurationProperties(DeviceConfiguration& deviceConfiguration) :
+    _deviceConfiguration(deviceConfiguration)
+{
+}
+
+bool ConfigurationProperties::resetConfiguration()
+{
+    return (_deviceConfiguration.clear(), _deviceConfiguration.set("interval", CONFIGURATION_PROPERTY_INTERVAL));
+}
+
+bool ConfigurationProperties::validateProperties()
+{
+    return (readInterval() > 0);
+}
+
+int ConfigurationProperties::readInterval()
+{
+    const char *prop; int res, ln;
+    
+    if ((prop = _deviceConfiguration.get("interval")) == NULL)
+        prop = CONFIGURATION_PROPERTY_INTERVAL;
+    
+    ln = -1;
+    if ((sscanf(prop, "%d%n", &res, &ln) != 1) || (ln != strlen(prop)))
+        return 0;
+
+    return res;
+}