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
Diff: config/ConfigurationProperties.cpp
- Revision:
- 101:dbcd3bc51758
- Parent:
- 100:47ea098f8a47
- Child:
- 102:ef2827b2d00a
--- a/config/ConfigurationProperties.cpp Thu May 07 13:56:19 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include "ConfigurationProperties.h" - -bool ConfigurationProperties::resetConfiguration() -{ - return (_deviceConfiguration.clear(), _deviceConfiguration.set("interval", CONFIGURATION_PROPERTY_INTERVAL)); -} - -bool ConfigurationProperties::validateProperties() -{ - return (readInterval() >= 0); -} - -int ConfigurationProperties::readInterval() -{ - const char *prop = _deviceConfiguration.get("interval"); - if (prop == NULL) - prop = CONFIGURATION_PROPERTY_INTERVAL; - - int res; - int ln = -1; - if ((sscanf(prop, "%d%n", &res, &ln) != 1) || (ln != strlen(prop))) - return 0; - - return res; -}