DeviceInfoLedger
|
Wrapper to simplify calling the config methods. More...
#include <DeviceInfoLedger.h>
Public Member Functions | |
bool | getConfigBool (const char *key, bool defaultValue=false) const |
Get a bool (boolean) configuration setting from local settings or cloud configuration (default or device override) | |
bool | setLocalConfigBool (const char *key, bool value) |
Set a local config setting using a bool. | |
int | getConfigInt (const char *key, int defaultValue=0) const |
Get an int (32-bit signed integer) configuration setting from local settings or cloud configuration (default or device override) | |
bool | setLocalConfigInt (const char *key, int value) |
Set a local config setting using an int (signed 32-bit integer) | |
double | getConfigDouble (const char *key, double defaultValue=0.0) const |
Get a double (64-bit floating point) configuration setting from local settings or cloud configuration (default or device override) | |
bool | setLocalConfigDouble (const char *key, double value) |
Set a local config setting using a double (64-bit floating point) | |
String | getConfigString (const char *key, const char *defaultValue="") const |
Get a String configuration setting from local settings or cloud configuration (default or device override) | |
bool | setLocalConfigString (const char *key, const char *value) |
Set a local config setting using a c-string (null-terminated UTF-8, const char *) | |
Variant | getConfigVariant (const char *key, Variant defaultValue={}) const |
Get a configuration setting from local settings or cloud configuration (default or device override) | |
bool | setLocalConfigVariant (const char *key, Variant value) |
Set a local config setting using a Variant. | |
Wrapper to simplify calling the config methods.
Since the config class is a singleton, the syntax for using the method is a little awkward, such as:
DeviceInfoConfig::instance().getConfigString("test")
You make this wrapper a parent class of your class, which makes it possible to just call:
getConfigString("test")
|
inline |
Get a bool (boolean) configuration setting from local settings or cloud configuration (default or device override)
key | Key to read in the top level of the configuration object |
defaultValue | Value to be returned if the key does not exist |
|
inline |
Get a double (64-bit floating point) configuration setting from local settings or cloud configuration (default or device override)
key | Key to read in the top level of the configuration object |
defaultValue | Value to be returned if the key does not exist |
|
inline |
Get an int (32-bit signed integer) configuration setting from local settings or cloud configuration (default or device override)
key | Key to read in the top level of the configuration object |
defaultValue | Value to be returned if the key does not exist |
|
inline |
Get a String configuration setting from local settings or cloud configuration (default or device override)
key | Key to read in the top level of the configuration object |
defaultValue | Value to be returned if the key does not exist |
|
inline |
Get a configuration setting from local settings or cloud configuration (default or device override)
key | Top level key in the ledger |
defaultValue | Value to be returned if the key does not exist |
|
inline |
Set a local config setting using a bool.
key | Key to set |
value | Value to set to |
|
inline |
Set a local config setting using a double (64-bit floating point)
key | Key to set |
value | Value to set to |
|
inline |
Set a local config setting using an int (signed 32-bit integer)
key | Key to set |
value | Value to set to |
|
inline |
Set a local config setting using a c-string (null-terminated UTF-8, const char *)
key | Key to set |
value | Value to set to |
|
inline |
Set a local config setting using a Variant.
key | Key to set |
value | Value to set to |
See also overloads for specific types such as setLocalConfigBool, setLocalConfigInt, etc.