23#if defined(ARDUINO_ARCH_ESP8266)
24# include <ESP8266WiFi.h>
25# include <ESPAsyncTCP.h>
26# include <ESPAsyncUDP.h>
27#elif defined(ARDUINO_ARCH_ESP32)
32# error "Unsupported CPU type"
35#define ARDUINOJSON_USE_LONG_LONG 1
36#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 15
39#include <ArduinoJson.h>
46#define REBOOT_DELAY 100
47#define LOG_PORT Serial
48#define CLIENT_TIMEOUT 15
51#define MilliSecondsInASecond 1000
52#define MicroSecondsInAmilliSecond 1000
53#define MicroSecondsInASecond (MicroSecondsInAmilliSecond * MilliSecondsInASecond)
54#define NanoSecondsInAMicroSecond 1000
55#define NanoSecondsInASecond (MicroSecondsInASecond * NanoSecondsInAMicroSecond)
56#define NanoSecondsInAMilliSecond (NanoSecondsInAMicroSecond * MicroSecondsInAmilliSecond)
58#define CPU_ClockTimeNS ((1.0 / float(F_CPU)) * float(NanoSecondsInASecond))
61#define STRINGIFY(X) #X
62#define STRING(X) STRINGIFY(X)
64extern void RequestReboot(uint32_t LoopDelay,
bool SkipDisable =
false);
87extern void PrettyPrint (JsonObject& jsonStuff, String Name);
88extern void PrettyPrint (JsonArray& jsonStuff, String Name);
89extern void PrettyPrint(JsonDocument &jsonStuff, String Name);
91template <
typename T,
typename N>
94 bool HasBeenModified =
false;
96 if (Json[(
char*)Name].
template is<T>())
98 T temp = Json[(
char*)Name];
102 HasBeenModified =
true;
107 DEBUG_V(String(
"Could not find field '") + Name +
"' in the json record");
111 return HasBeenModified;
114template <
typename T,
typename N>
117 bool HasBeenModified =
false;
119 if (Json[(
char*)Name].
template is<T>())
121 T temp = Json[(
char*)Name];
122 if (temp != OutValue)
125 HasBeenModified =
true;
130 DEBUG_V(String(
"Could not find field '") + Name +
"' in the json record");
134 return HasBeenModified;
137#if defined(ARDUINO_ARCH_ESP8266)
138# define JsonWrite(j, n, v) (j)[String(n)] = (v)
139void inline ResetGpio(
const gpio_num_t pinId)
141 if(gpio_num_t(33) > pinId)
143 pinMode(pinId, INPUT);
147# define JsonWrite(j, n, v) (j)[(char*)(n)] = (v)
150 if(GPIO_IS_VALID_OUTPUT_GPIO(pinId))
152 gpio_reset_pin(pinId);
153 pinMode(pinId, INPUT);
162 GetDriverName (DN); \
163 extern void _logcon (String & DriverName, String Message); \
171#define LOAD_CONFIG_DELAY 4
bool deserializeCore(JsonObject &json)
Definition main.cpp:301
bool dsNetwork(JsonObject &json)
void deserializeCoreHandler(JsonDocument &jsonDoc)
Definition main.cpp:382
config_t config
Definition main.cpp:93
void RequestReboot(uint32_t LoopDelay, bool SkipDisable=false)
Definition main.cpp:573
void PrettyPrint(JsonObject &jsonStuff, String Name)
Definition WebMgr.cpp:70
String serializeCore(bool pretty=false)
Definition main.cpp:466
uint32_t DiscardedRxData
Definition main.cpp:102
bool ResetWiFi
Definition main.cpp:97
const uint8_t CurrentConfigVersion
Definition main.cpp:91
bool setFromJSON(T &OutValue, JsonObject &Json, N Name)
Definition ESPixelStick.h:92
void ResetGpio(const gpio_num_t pinId)
Definition ESPixelStick.h:148
bool IsBooting
Definition main.cpp:98
void FeedWDT()
Definition main.cpp:607
bool dsDevice(JsonObject &json)
Deserialize device configuration JSON to config structure - returns true if config change detected.
Definition main.cpp:259
bool ConfigSaveNeeded
Definition main.cpp:100
bool RebootInProgress()
Definition main.cpp:568
const String ConfigFileName
Definition main.cpp:89
bool ConsoleUartIsActive
Definition main.cpp:585
#define DEBUG_V(v)
Definition memdebug.h:18
Core configuration structure.
Definition ESPixelStick.h:69
String id
Definition ESPixelStick.h:71
uint32_t BlankDelay
Definition ESPixelStick.h:72