2 #include <ESP8266WiFi.h>
 
   9 extern bool isNetConnected;
 
  11 void setupNet(bool AP = false);
 
  16 extern bool isTimeSet;
 
  18 extern time_t last_sync;
 
  30 void registerTimeHandler(const char* handlerName, const char handlerType, std::function<void()> timeHandler);
 
  31 void unregisterTimeHandler(const char* handlerName);
 
  32 void registerTimeHandler(const __FlashStringHelper* handlerName, const char handlerType, std::function<void()> timeHandler);
 
  33 void unregisterTimeHandler(const __FlashStringHelper* handlerName);
 
  43 char* copystr(const char* s);
 
  44 char* copystr(const __FlashStringHelper* s);
 
  53 class ConfigParameter: public Printable {
 
  56     ConfigParameter(const char *id, const char* value);
 
  57     ConfigParameter(const char *id, int value);
 
  58     ConfigParameter(const char *id, double value);
 
  59     ConfigParameter(const char *id, bool value);
 
  60     ConfigParameter(const __FlashStringHelper* id, const char* value);
 
  61     ConfigParameter(const __FlashStringHelper* id, int value);
 
  62     ConfigParameter(const __FlashStringHelper* id, double value);
 
  63     ConfigParameter(const __FlashStringHelper* id, bool value);
 
  66     const char *getID() const;
 
  68     const bool getBoolValue() const;
 
  69     const int getIntValue() const ;
 
  70     const double getFloatValue() const;
 
  71     const char *getCharValue() const;
 
  73     void  setValue(const bool value);
 
  74     void  setValue(const int value);
 
  75     void  setValue(const double value);
 
  76     void  setValue(const char *value);
 
  78     virtual size_t printTo(Print& p) const;
 
  81     void init(const char *id, char type);
 
  82     void init(const __FlashStringHelper *id, char type);
 
  86     char  _type; // _B_oolean, _I_nt, double _F_loat, _S_tring
 
  90 class Config: public Printable {
 
  96     ConfigParameter* getParameter(int i);
 
  97     int   getParametersCount() const;
 
  99     void   setValue(const char *id, const char *value);
 
 100     void   setValue(const char *id, int value);
 
 101     void   setValue(const char *id, double value);
 
 102     void   setValue(const char *id, bool value);
 
 103     int    getIntValue(const char *id) const;
 
 104     double getFloatValue(const char *id) const;
 
 105     bool   getBoolValue(const char *id) const;
 
 106     const char* getCharValue(const char *id) const;
 
 108     void   setValue(const __FlashStringHelper* id, const char *value);
 
 109     void   setValue(const __FlashStringHelper* id, int value);
 
 110     void   setValue(const __FlashStringHelper* id, double value);
 
 111     void   setValue(const __FlashStringHelper* id, bool value);
 
 112     int    getIntValue(const __FlashStringHelper* id) const;
 
 113     double getFloatValue(const __FlashStringHelper* id) const ;
 
 114     bool   getBoolValue(const __FlashStringHelper* id) const;
 
 115     const char* getCharValue(const __FlashStringHelper* id) const;
 
 117     ConfigParameter* getParam(const char *id) const;
 
 118     ConfigParameter* getParam(const __FlashStringHelper* id) const;
 
 120     virtual size_t printTo(Print& p) const;
 
 122     void readFrom(Stream& s);
 
 123     void dumpJson(Stream& s) const;
 
 127     unsigned long getTimestamp();
 
 128     void resetTimestamp();
 
 132     void addParameter(ConfigParameter* p);
 
 137     unsigned long _timestamp;
 
 138     ConfigParameter** _params;
 
 144 void saveConfig(bool force = false);
 
 150 extern bool isRTCEnabled;
 
 151 extern RTC_DS3231 RTC;
 
 153 void setupHardware();
 
 156 void beep(int tone, int length, int beep_ms = 60000, int silent_ms = 0);
 
 168 extern int screenMode;
 
 169 extern int screenModeRequested;
 
 174 void utf8rus(const char* source, char* target, int maxLen = 255);
 
 176 void message(const char* str, int priority=10);
 
 177 void message(const __FlashStringHelper*  str, int priority=10);
 
 178 void messageModal(const char* str);
 
 179 void messageModal(const __FlashStringHelper*  str);
 
 180 void scroll(const char* str, bool force = false);
 
 181 void setPanelBrightness();
 
 189 extern char weatherData[256];
 
 191 void setupWeatherRequest();
 
 195 extern bool isApEnabled;
 
 199 void reportChange(const __FlashStringHelper* name);