-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathESP_Configuration.h
More file actions
61 lines (44 loc) · 1.39 KB
/
ESP_Configuration.h
File metadata and controls
61 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
ESP Arduino Core Configuration Library
Allows storing or variables to the Flash in a convenient API
Maximum variable sizes are as follows:
Type Size (bytes)
charArray 20
boolean 1
ipAddress 15
*/
#ifndef Configuration_h
#define Configuration_h
#include <Arduino.h>
#include "ConfigurationItem.h"
//#define TOTAL_CONFIG_LENGTH 336
//#define NUM_CONFIGS 19
#define SAVE_BUFFER 10000
class Configuration {
public:
Configuration(ConfigurationItem** list, size_t num){
configList = list;
numConfigs = num;
};
void init();
void* getConfiguration(const char*);
bool setConfiguration(const char*, void*);
bool saveConfiguration();
bool loadConfiguration(); // save and load current instances of configs
bool loadForTwenty();
bool setDefaults();
bool keyExists(char*);
const char* blank = "";
static bool checkForTwenty();
private:
ConfigurationItem** configList = 0;
ConfigurationItem* findConfigWithKey(const char*);
unsigned char pointer = 0;
ConfigurationItem* currentConfig = 0;
bool resetPointer();
bool nextValue();
size_t numConfigs;
uint32_t _handle;
char stuff[100];
};
#endif