config.h
Go to the documentation of this file.
#pragma once
#if defined(ESP8266) || defined(ESP32)
#include "FS.h"
#endif
#include <Arduino.h>
#include "flashstream.h"
#include <IPAddress.h>
#include "systemconfigdata.h"
class systemConfig {
private:
flashStream * stream;
String currentConfigETAG;
int openStream(char mode = '\0');
public:
macAddress mac;
systemConfig():currentConfigETAG() {stream=NULL;};
systemConfig(flashStream * fs):currentConfigETAG() {stream=fs;};
bool isValidSysConf();
bool getMAC();
String getMACString();
bool setMAC(macAddress& mac);
char * getMQTTpwd(char * buffer, uint16_t bufLen);
bool setMQTTpwd(char * pwd = NULL);
char * getOTApwd(char * buffer, uint16_t bufLen);
bool setOTApwd(char * pwd = NULL);
bool setServer(char* url);
char * getServer(char * buffer, uint16_t bufLen);
bool getIP(IPAddress& ip);
bool getMask(IPAddress& mask);
bool getDNS(IPAddress& dns);
bool getGW(IPAddress& gw);
bool setIP(IPAddress& ip);
bool setMask(IPAddress& mask);
bool setDNS(IPAddress& dns);
bool setGW(IPAddress& gw);
bool setSerialDebuglevel(short);
bool setUdpDebuglevel(short);
uint8_t getSerialDebuglevel();
uint8_t getUdpDebuglevel();
bool clear();
bool getSaveSuccedConfig();
bool setSaveSuccedConfig(bool);
bool getLoadHTTPConfig();
bool setLoadHTTPConfig(bool);
String getETAG();
bool setETAG(String etag);
bool saveETAG();
bool loadETAG();
systemConfigFlags getConfigFlags();
bool setConfigFlags(systemConfigFlags flags);
//bool Save();
};
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