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
ConfigurationProperties.cpp
00001 #include "ConfigurationProperties.h" 00002 #include <stdlib.h> 00003 #include <stdio.h> 00004 #include <string.h> 00005 00006 ConfigurationProperties::ConfigurationProperties(DeviceConfiguration& deviceConfiguration) : 00007 _deviceConfiguration(deviceConfiguration) 00008 { 00009 } 00010 00011 bool ConfigurationProperties::resetConfiguration() 00012 { 00013 return (_deviceConfiguration.clear(), _deviceConfiguration.set("interval", CONFIGURATION_PROPERTY_INTERVAL)); 00014 } 00015 00016 bool ConfigurationProperties::validateProperties() 00017 { 00018 return (readInterval() > 0); 00019 } 00020 00021 int ConfigurationProperties::readInterval() 00022 { 00023 const char *prop; int res, ln; 00024 00025 if ((prop = _deviceConfiguration.get("interval")) == NULL) 00026 prop = CONFIGURATION_PROPERTY_INTERVAL; 00027 00028 ln = -1; 00029 if ((sscanf(prop, "%d%n", &res, &ln) != 1) || (ln != strlen(prop))) 00030 return 0; 00031 00032 return res; 00033 }
Generated on Sun Jul 17 2022 02:39:36 by
1.7.2
Richard Osterloh
