| LightHub v4.0.0 Smarthome controller firmware

config.h
Go to the documentation of this file.
1 #pragma once
2 #if defined(ESP8266) || defined(ESP32)
3 #include "FS.h"
4 #endif
5
6 #include <Arduino.h>
7 #include "flashstream.h"
8 #include <IPAddress.h>
9 #include "systemconfigdata.h"
10
11
12 class systemConfig {
13 private:
14 flashStream * stream;
15 String currentConfigETAG;
16 int openStream(char mode = '\0');
17
18 public:
19 macAddress mac;
20
21 systemConfig():currentConfigETAG() {stream=NULL;};
22 systemConfig(flashStream * fs):currentConfigETAG() {stream=fs;};
23
24 bool isValidSysConf();
25
26 bool getMAC();
27 String getMACString();
28 bool setMAC(macAddress& mac);
29
30 char * getMQTTpwd(char * buffer, uint16_t bufLen);
31 bool setMQTTpwd(char * pwd = NULL);
32
33 char * getOTApwd(char * buffer, uint16_t bufLen);
34 bool setOTApwd(char * pwd = NULL);
35
36 bool setServer(char* url);
37 char * getServer(char * buffer, uint16_t bufLen);
38
39 bool getIP(IPAddress& ip);
40 bool getMask(IPAddress& mask);
41 bool getDNS(IPAddress& dns);
42 bool getGW(IPAddress& gw);
43
44 bool setIP(IPAddress& ip);
45 bool setMask(IPAddress& mask);
46 bool setDNS(IPAddress& dns);
47 bool setGW(IPAddress& gw);
48
49 bool setSerialDebuglevel(short);
50 bool setUdpDebuglevel(short);
51 uint8_t getSerialDebuglevel();
52 uint8_t getUdpDebuglevel();
53
54 bool clear();
55 bool getSaveSuccedConfig();
56 bool setSaveSuccedConfig(bool);
57 bool getLoadHTTPConfig();
58 bool setLoadHTTPConfig(bool);
59 String getETAG();
60 bool setETAG(String etag);
61 bool saveETAG();
62 bool loadETAG();
63
64 systemConfigFlags getConfigFlags();
65 bool setConfigFlags(systemConfigFlags flags);
66
67 //bool Save();
68 };
systemConfig::getDNS
bool getDNS(IPAddress &dns)
Definition: config.cpp:170
systemConfig::setSerialDebuglevel
bool setSerialDebuglevel(short)
Definition: config.cpp:310
systemConfigFlags
Definition: systemconfigdata.h:22
systemConfig::getMQTTpwd
char * getMQTTpwd(char *buffer, uint16_t bufLen)
Definition: config.cpp:64
systemConfig::saveETAG
bool saveETAG()
Definition: config.cpp:354
flashstream.h
systemconfigdata.h
systemConfig::setOTApwd
bool setOTApwd(char *pwd=NULL)
Definition: config.cpp:107
systemConfig::setIP
bool setIP(IPAddress &ip)
Definition: config.cpp:193
flashStream
Definition: flashstream.h:52
systemConfig::setGW
bool setGW(IPAddress &gw)
Definition: config.cpp:224
systemConfig::getMAC
bool getMAC()
Definition: config.cpp:38
systemConfig::clear
bool clear()
Definition: config.cpp:235
systemConfig::getGW
bool getGW(IPAddress &gw)
Definition: config.cpp:181
systemConfig::getServer
char * getServer(char *buffer, uint16_t bufLen)
Definition: config.cpp:119
systemConfig::setUdpDebuglevel
bool setUdpDebuglevel(short)
Definition: config.cpp:317
systemConfig::mac
macAddress mac
Definition: config.h:19
systemConfig::getETAG
String getETAG()
Definition: config.cpp:337
systemConfig::setConfigFlags
bool setConfigFlags(systemConfigFlags flags)
Definition: config.cpp:271
systemConfig::getUdpDebuglevel
uint8_t getUdpDebuglevel()
Definition: config.cpp:331
systemConfig::getOTApwd
char * getOTApwd(char *buffer, uint16_t bufLen)
Definition: config.cpp:92
systemConfig::setServer
bool setServer(char *url)
Definition: config.cpp:134
systemConfig::getConfigFlags
systemConfigFlags getConfigFlags()
Definition: config.cpp:253
systemConfig::systemConfig
systemConfig(flashStream *fs)
Definition: config.h:22
systemConfig::getLoadHTTPConfig
bool getLoadHTTPConfig()
Definition: config.cpp:296
systemConfig
Definition: config.h:12
systemConfig::setSaveSuccedConfig
bool setSaveSuccedConfig(bool)
Definition: config.cpp:289
systemConfig::setLoadHTTPConfig
bool setLoadHTTPConfig(bool)
Definition: config.cpp:302
systemConfig::getMask
bool getMask(IPAddress &mask)
Definition: config.cpp:158
systemConfig::loadETAG
bool loadETAG()
Definition: config.cpp:366
systemConfig::setMAC
bool setMAC(macAddress &mac)
Definition: config.cpp:53
macAddress
uint8_t macAddress[6]
Definition: systemconfigdata.h:18
systemConfig::setETAG
bool setETAG(String etag)
Definition: config.cpp:343
systemConfig::setDNS
bool setDNS(IPAddress &dns)
Definition: config.cpp:213
systemConfig::getIP
bool getIP(IPAddress &ip)
Definition: config.cpp:146
systemConfig::systemConfig
systemConfig()
Definition: config.h:21
systemConfig::getSaveSuccedConfig
bool getSaveSuccedConfig()
Definition: config.cpp:283
systemConfig::getSerialDebuglevel
uint8_t getSerialDebuglevel()
Definition: config.cpp:325
systemConfig::setMask
bool setMask(IPAddress &mask)
Definition: config.cpp:203
systemConfig::getMACString
String getMACString()
Definition: config.cpp:5
systemConfig::setMQTTpwd
bool setMQTTpwd(char *pwd=NULL)
Definition: config.cpp:80
systemConfig::isValidSysConf
bool isValidSysConf()
Definition: config.cpp:22