\hypertarget{esp-fs-webserver_8h_source}{}\doxysection{esp-\/fs-\/webserver.h}
\label{esp-fs-webserver_8h_source}\index{src/esp-\/fs-\/webserver.h@{src/esp-\/fs-\/webserver.h}}
\mbox{\hyperlink{esp-fs-webserver_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00001}00001\ \textcolor{preprocessor}{\#ifndef\ esp\_fs\_webserver\_H}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00002}00002\ \textcolor{preprocessor}{\#define\ esp\_fs\_webserver\_H}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00003}00003\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00004}00004\ \textcolor{preprocessor}{\#include\ <Arduino.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00005}00005\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00006}00006\ \textcolor{preprocessor}{\#include\ <typeinfo>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00007}00007\ \textcolor{preprocessor}{\#include\ <base64.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00008}00008\ \textcolor{preprocessor}{\#include\ <FS.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00009}00009\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00010}\mbox{\hyperlink{esp-fs-webserver_8h_ae92972bc41fce3a9583281053eb25f4c}{00010}}\ \textcolor{preprocessor}{\#define\ INCLUDE\_EDIT\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00011}00011\ \textcolor{preprocessor}{\#ifdef\ INCLUDE\_EDIT\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00012}00012\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{edit__htm_8h}{edit\_htm.h}}"{}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00013}00013\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00014}00014\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00015}\mbox{\hyperlink{esp-fs-webserver_8h_a8ac0fcedf7b71a510c4d8287f9ecdb94}{00015}}\ \textcolor{preprocessor}{\#define\ INCLUDE\_SETUP\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00016}00016\ \textcolor{preprocessor}{\#ifdef\ INCLUDE\_SETUP\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00017}\mbox{\hyperlink{esp-fs-webserver_8h_ad04364871efb11788ea94d5f5417072c}{00017}}\ \textcolor{preprocessor}{\#define\ ARDUINOJSON\_USE\_LONG\_LONG\ 1}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00018}00018\ \textcolor{preprocessor}{\#include\ <ArduinoJson.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00019}00019\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{setup__htm_8h}{setup\_htm.h}}"{}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00020}00020\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00021}00021\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00022}00022\ \textcolor{preprocessor}{\#if\ defined(ESP8266)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00023}00023\ \textcolor{preprocessor}{\#include\ <ESP8266WiFi.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00024}00024\ \textcolor{preprocessor}{\#include\ <ESP8266WebServer.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00025}00025\ \textcolor{preprocessor}{\#include\ <ESP8266mDNS.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00026}00026\ \textcolor{preprocessor}{\#include\ <ESP8266HTTPUpdateServer.h>}\ \textcolor{comment}{//\ from\ Arduino\ core,\ OTA\ update\ via\ webbrowser}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00027}00027\ \textcolor{keyword}{using\ }WebServerClass\ =\ ESP8266WebServer;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00028}00028\ \textcolor{keyword}{using\ }UpdateServerClass\ =\ ESP8266HTTPUpdateServer;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00029}00029\ \textcolor{preprocessor}{\#elif\ defined(ESP32)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00030}00030\ \textcolor{preprocessor}{\#include\ <esp\_wifi.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00031}00031\ \textcolor{preprocessor}{\#include\ <WebServer.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00032}00032\ \textcolor{preprocessor}{\#include\ <WiFi.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00033}00033\ \textcolor{preprocessor}{\#include\ <ESPmDNS.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00034}00034\ \textcolor{preprocessor}{\#include\ <HTTPUpdateServer.h>}\ \textcolor{comment}{//\ from\ Arduino\ core,\ OTA\ update\ via\ webbrowser}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00035}00035\ \textcolor{keyword}{using\ }WebServerClass\ =\ WebServer;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00036}00036\ \textcolor{keyword}{using\ }UpdateServerClass\ =\ HTTPUpdateServer;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00037}00037\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00038}00038\ \textcolor{preprocessor}{\#include\ <DNSServer.h>}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00039}00039\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00040}00040\ \textcolor{preprocessor}{\#ifndef\ DEBUG\_ESP\_PORT}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00041}\mbox{\hyperlink{esp-fs-webserver_8h_a8329fe5b96ea951b0d6342dab3c944fd}{00041}}\ \textcolor{preprocessor}{\#define\ DBG\_OUTPUT\_PORT\ Serial}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00042}\mbox{\hyperlink{esp-fs-webserver_8h_a67c45a6cec3370ceb4383b3813f22979}{00042}}\ \textcolor{preprocessor}{\#define\ DEBUG\_MODE\_WS\ false}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00043}00043\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00044}00044\ \textcolor{preprocessor}{\#define\ DBG\_OUTPUT\_PORT\ DEBUG\_ESP\_PORT}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00045}00045\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00046}00046\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00047}00047\ \textcolor{preprocessor}{\#if\ DEBUG\_MODE\_WS}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00048}00048\ \textcolor{preprocessor}{\#define\ DebugPrint(x)\ DBG\_OUTPUT\_PORT.print(x)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00049}00049\ \textcolor{preprocessor}{\#define\ DebugPrintln(x)\ DBG\_OUTPUT\_PORT.println(x)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00050}00050\ \textcolor{preprocessor}{\#define\ DebugPrintf(fmt,\ ...)\ DBG\_OUTPUT\_PORT.printf(fmt,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00051}00051\ \textcolor{preprocessor}{\#define\ DebugPrintf\_P(fmt,\ ...)\ DBG\_OUTPUT\_PORT.printf\_P(fmt,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00052}00052\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00053}\mbox{\hyperlink{esp-fs-webserver_8h_aa8e0ba3b368dd0b2329250544929c135}{00053}}\ \textcolor{preprocessor}{\#define\ DebugPrint(x)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00054}\mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{00054}}\ \textcolor{preprocessor}{\#define\ DebugPrintln(x)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00055}\mbox{\hyperlink{esp-fs-webserver_8h_af0cbd3adb9ca3a22d52dd4ea65d82bee}{00055}}\ \textcolor{preprocessor}{\#define\ DebugPrintf(x,\ ...)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00056}\mbox{\hyperlink{esp-fs-webserver_8h_a80d71f6b1a4adaaf461c57902c4155ba}{00056}}\ \textcolor{preprocessor}{\#define\ DebugPrintf\_P(x,\ ...)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00057}00057\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00058}00058\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00059}00059\ \textcolor{keyword}{enum}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00060}00060\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00061}\mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba7db209a18c6374183567534787dccc1b}{00061}}\ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba7db209a18c6374183567534787dccc1b}{MSG\_OK}},}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00062}\mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba945d6010d321d9fe75cbba7b6f37f3b5}{00062}}\ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba945d6010d321d9fe75cbba7b6f37f3b5}{CUSTOM}},}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00063}\mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55bacdaa2919bac56fe1090eb3dbb9526472}{00063}}\ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55bacdaa2919bac56fe1090eb3dbb9526472}{NOT\_FOUND}},}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00064}\mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55baef4e18cf5dacaf9d0cb90c72663a1b60}{00064}}\ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55baef4e18cf5dacaf9d0cb90c72663a1b60}{BAD\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00065}00065\ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba2fd6f336d08340583bd620a7f5694c90}{ERROR}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00066}\mbox{\hyperlink{esp-fs-webserver_8h_a06fc87d81c62e9abb8790b6e5713c55ba2fd6f336d08340583bd620a7f5694c90}{00066}}\ \};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00067}\mbox{\hyperlink{esp-fs-webserver_8h_aa7e166aadcdb04b319d121550669a24f}{00067}}\ \textcolor{preprocessor}{\#define\ TEXT\_PLAIN\ "{}text/plain"{}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00068}\mbox{\hyperlink{esp-fs-webserver_8h_a53cebbc0731fee09f9592a2721834cf5}{00068}}\ \textcolor{preprocessor}{\#define\ FS\_INIT\_ERROR\ "{}FS\ INIT\ ERROR"{}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00069}\mbox{\hyperlink{esp-fs-webserver_8h_a775241e32b7ccb12e344ae23aa2db6b1}{00069}}\ \textcolor{preprocessor}{\#define\ FILE\_NOT\_FOUND\ "{}FileNotFound"{}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00070}00070\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00071}\mbox{\hyperlink{class_f_s_web_server}{00071}}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_f_s_web_server}{FSWebServer}}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00072}00072\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00073}00073\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00074}00074\ \ \ \ \ \textcolor{comment}{//\ using\ CallbackF\ =\ std::function<void(void)>;}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00075}00075\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00076}00076\ \textcolor{keyword}{public}:}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00077}\mbox{\hyperlink{class_f_s_web_server_a2e6a2d103fc2b5e53f98746b5841caef}{00077}}\ \ \ \ \ WebServerClass\ *\mbox{\hyperlink{class_f_s_web_server_a2e6a2d103fc2b5e53f98746b5841caef}{webserver}};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00078}00078\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00079}00079\ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server}{FSWebServer}}(fs::FS\ \&fs,\ WebServerClass\ \&server);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00080}00080\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00081}00081\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_f_s_web_server_acddb94f1439465aff5fea34f822f9cb4}{begin}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *path\ =\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00082}00082\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00083}00083\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a29c9d209cf8943bb5c9cee597a1019cc}{run}}();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00084}00084\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00085}00085\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_ab221d6302b2710fd3702bf6b293eb814}{addHandler}}(\textcolor{keyword}{const}\ Uri\ \&uri,\ HTTPMethod\ method,\ WebServerClass::THandlerFunction\ fn);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00086}00086\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00087}00087\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_ab221d6302b2710fd3702bf6b293eb814}{addHandler}}(\textcolor{keyword}{const}\ Uri\ \&uri,\ WebServerClass::THandlerFunction\ handler);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00088}00088\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00089}00089\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_aca526a0eef6c176720326d7244553352}{setCaptiveWebage}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *url);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00090}00090\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00091}00091\ \ \ \ \ IPAddress\ \mbox{\hyperlink{class_f_s_web_server_a570fcf86522cac2371933240fcecc821}{setAPmode}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *ssid,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *psk);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00092}00092\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00093}00093\ \ \ \ \ IPAddress\ \mbox{\hyperlink{class_f_s_web_server_a19c8683db5bcc169702eba2fc88000e3}{startWiFi}}(uint32\_t\ timeout,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *apSSID,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *apPsw);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00094}00094\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00095}00095\ \ \ \ \ WebServerClass\ *\mbox{\hyperlink{class_f_s_web_server_ac79a26ff8eb0f7789200b49d3d3e4d87}{getRequest}}();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00096}00096\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00097}00097\ \textcolor{preprocessor}{\#ifdef\ INCLUDE\_SETUP\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00098}00098\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00099}\mbox{\hyperlink{esp-fs-webserver_8h_ac1def8be266a4c2e2b4561b6d6af3c36}{00099}}\ \textcolor{preprocessor}{\#define\ MIN\_F\ -\/3.4028235E+38}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00100}\mbox{\hyperlink{esp-fs-webserver_8h_a4cbdbe9b7f8e2757f49434127d9f1cb3}{00100}}\ \textcolor{preprocessor}{\#define\ MAX\_F\ 3.4028235E+38}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00101}00101\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00102}\mbox{\hyperlink{class_f_s_web_server_a2f0ab5fb6dd6429128972345343f3aca}{00102}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_f_s_web_server_a2f0ab5fb6dd6429128972345343f3aca}{clearOptions}}()\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00103}00103\ \ \ \ \ \ \ \ \ File\ file\ =\ m\_filesystem-\/>open(\textcolor{stringliteral}{"{}/config.json"{}},\ \textcolor{stringliteral}{"{}r"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00104}00104\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (file)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00105}00105\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00106}00106\ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00107}00107\ \ \ \ \ \ \ \ \ \ \ \ \ m\_filesystem-\/>remove(\textcolor{stringliteral}{"{}/config.json"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00108}00108\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00109}00109\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00110}00110\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00111}00111\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00112}00112\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00113}\mbox{\hyperlink{class_f_s_web_server_a3693142a82729e0b49d7ed2c098b031d}{00113}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a3693142a82729e0b49d7ed2c098b031d}{addOptionBox}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ boxTitle)\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00114}00114\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(\textcolor{stringliteral}{"{}param-\/box"{}},\ boxTitle,\ \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00115}00115\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00116}00116\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00117}\mbox{\hyperlink{class_f_s_web_server_aac06573f458d72e060634b14c9660c78}{00117}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_aac06573f458d72e060634b14c9660c78}{addHTML}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ html,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \textcolor{keywordtype}{id})\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00118}00118\ \ \ \ \ \ \ \ \ String\ elementId\ =\ \textcolor{stringliteral}{"{}raw-\/html-\/"{}};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00119}00119\ \ \ \ \ \ \ \ \ elementId\ +=\ id;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00120}00120\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00121}00121\ \ \ \ \ \ \ \ \ String\ trimmed\ =\ html;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00122}00122\ \ \ \ \ \ \ \ \ removeWhiteSpaces(trimmed);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00123}00123\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(elementId.c\_str(),\ trimmed,\ \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00124}00124\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00125}00125\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00126}\mbox{\hyperlink{class_f_s_web_server_a6d57635e9e86a0a05625b925205096ad}{00126}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a6d57635e9e86a0a05625b925205096ad}{addCSS}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ css)\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00127}00127\ \ \ \ \ \ \ \ \ String\ trimmed\ =\ css;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00128}00128\ \ \ \ \ \ \ \ \ removeWhiteSpaces(trimmed);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00129}00129\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(\textcolor{stringliteral}{"{}raw-\/css"{}},\ trimmed,\ \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00130}00130\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00131}00131\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00132}\mbox{\hyperlink{class_f_s_web_server_a6594d341d985d1f37314a19684d1e1ec}{00132}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a6594d341d985d1f37314a19684d1e1ec}{addJavascript}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ script)\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00133}00133\ \ \ \ \ \ \ \ \ String\ trimmed\ =\ script;\ \ \ \ \ \ \ \ \textcolor{comment}{//\ TO-\/DO:\ ESP8266\ don't\ handle\ properly\ PROGMEM\ strings}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00134}00134\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(\textcolor{stringliteral}{"{}raw-\/javascript"{}},\ trimmed,\ \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00135}00135\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00137}00137\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a2e447054d17ee0c785e8f86ae00b69f0}{addDropdownList}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}**\ array,\ \textcolor{keywordtype}{size\_t}\ size);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00138}00138\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00139}00139\ \ \ \ \ \textcolor{comment}{//\ Only\ for\ backward-\/compatibility}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00140}00140\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00141}\mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{00141}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(fs::FS\ \&fs,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ T\ val,\ \textcolor{keywordtype}{bool}\ hidden\ =\ \textcolor{keyword}{false})}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00142}00142\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00143}00143\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(label,\ val,\ hidden);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00144}00144\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00145}00145\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00146}00146\ \ \ \ \ \textcolor{comment}{//\ Add\ custom\ option\ to\ config\ webpage\ (float\ values)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00147}00147\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00148}\mbox{\hyperlink{class_f_s_web_server_a21791adcbd8ac1657476b24c799e920a}{00148}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a21791adcbd8ac1657476b24c799e920a}{addOption}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ T\ val,\ \textcolor{keywordtype}{double}\ d\_min,\ \textcolor{keywordtype}{double}\ d\_max,\ \textcolor{keywordtype}{double}\ step)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00149}00149\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00150}00150\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_f_s_web_server_a89b5332de11db06663137c07568d2b15}{addOption}}(label,\ val,\ \textcolor{keyword}{false},\ d\_min,\ d\_max,\ step);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00151}00151\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00152}00152\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00153}00153\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00154}00154\ \ \ \ \ \textcolor{comment}{//\ Add\ custom\ option\ to\ config\ webpage\ (type\ of\ parameter\ will\ be\ deduced\ from\ variable\ itself)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00155}00155\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00156}\mbox{\hyperlink{class_f_s_web_server_a564f6b406b6ee0196124a9e9e7b271b9}{00156}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_f_s_web_server_a564f6b406b6ee0196124a9e9e7b271b9}{addOption}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ T\ val,\ \textcolor{keywordtype}{bool}\ hidden\ =\ \textcolor{keyword}{false},}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00157}00157\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ d\_min\ =\ \mbox{\hyperlink{esp-fs-webserver_8h_ac1def8be266a4c2e2b4561b6d6af3c36}{MIN\_F}},\ \textcolor{keywordtype}{double}\ d\_max\ =\ \mbox{\hyperlink{esp-fs-webserver_8h_a4cbdbe9b7f8e2757f49434127d9f1cb3}{MAX\_F}},\ \textcolor{keywordtype}{double}\ step\ =\ 1.0)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00158}00158\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00159}00159\ \ \ \ \ \ \ \ \ File\ file\ =\ m\_filesystem-\/>open(\textcolor{stringliteral}{"{}/config.json"{}},\ \textcolor{stringliteral}{"{}r"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00160}00160\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ sz\ =\ file.size()\ *\ 1.33;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00161}00161\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ docSize\ =\ max(sz,\ 2048);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00162}00162\ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc((\textcolor{keywordtype}{size\_t})docSize);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00163}00163\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (file)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00164}00164\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00165}00165\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ file\ is\ present,\ load\ actual\ configuration}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00166}00166\ \ \ \ \ \ \ \ \ \ \ \ \ DeserializationError\ error\ =\ deserializeJson(doc,\ file);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00167}00167\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (error)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00168}00168\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00169}00169\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(F(\textcolor{stringliteral}{"{}Failed\ to\ deserialize\ file,\ may\ be\ corrupted"{}}));}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00170}00170\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(error.c\_str());}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00171}00171\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00172}00172\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00173}00173\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00174}00174\ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00175}00175\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00176}00176\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00177}00177\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00178}00178\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(F(\textcolor{stringliteral}{"{}File\ not\ found,\ will\ be\ created\ new\ configuration\ file"{}}));}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00179}00179\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00180}00180\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00181}00181\ \ \ \ \ \ \ \ \ numOptions++\ ;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00182}00182\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00183}00183\ \ \ \ \ \ \ \ \ String\ key\ =\ label;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00184}00184\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (hidden)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00185}00185\ \ \ \ \ \ \ \ \ \ \ \ \ key\ +=\ \textcolor{stringliteral}{"{}-\/hidden"{}};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00186}00186\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00187}00187\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Univoque\ key\ name}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00188}00188\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (key.equals(\textcolor{stringliteral}{"{}param-\/box"{}}))\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00189}00189\ \ \ \ \ \ \ \ \ \ \ \ \ key\ +=\ numOptions\ ;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00190}00190\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00191}00191\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (key.equals(\textcolor{stringliteral}{"{}raw-\/javascript"{}}))\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00192}00192\ \ \ \ \ \ \ \ \ \ \ \ \ key\ +=\ numOptions\ ;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00193}00193\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00194}00194\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00195}00195\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00196}00196\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00197}00197\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ key\ is\ present\ in\ json,\ we\ don't\ need\ to\ create\ it.}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00198}00198\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (doc.containsKey(key.c\_str()))}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00199}00199\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00200}00200\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00201}00201\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ if\ min,\ max,\ step\ !=\ from\ default,\ treat\ this\ as\ object\ in\ order\ to\ set\ other\ properties}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00202}00202\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (d\_min\ !=\ \mbox{\hyperlink{esp-fs-webserver_8h_ac1def8be266a4c2e2b4561b6d6af3c36}{MIN\_F}}\ ||\ d\_max\ !=\ \mbox{\hyperlink{esp-fs-webserver_8h_a4cbdbe9b7f8e2757f49434127d9f1cb3}{MAX\_F}}\ ||\ step\ !=\ 1.0)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00203}00203\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00204}00204\ \ \ \ \ \ \ \ \ \ \ \ \ JsonObject\ obj\ =\ doc.createNestedObject(key);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00205}00205\ \ \ \ \ \ \ \ \ \ \ \ \ obj[\textcolor{stringliteral}{"{}value"{}}]\ =\ \textcolor{keyword}{static\_cast<}T\textcolor{keyword}{>}(val);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00206}00206\ \ \ \ \ \ \ \ \ \ \ \ \ obj[\textcolor{stringliteral}{"{}min"{}}]\ =\ d\_min;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00207}00207\ \ \ \ \ \ \ \ \ \ \ \ \ obj[\textcolor{stringliteral}{"{}max"{}}]\ =\ d\_max;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00208}00208\ \ \ \ \ \ \ \ \ \ \ \ \ obj[\textcolor{stringliteral}{"{}step"{}}]\ =\ step;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00209}00209\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00210}00210\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00211}00211\ \ \ \ \ \ \ \ \ \ \ \ \ doc[key]\ =\ \textcolor{keyword}{static\_cast<}T\textcolor{keyword}{>}(val);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00212}00212\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00213}00213\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00214}00214\ \ \ \ \ \ \ \ \ file\ =\ m\_filesystem-\/>open(\textcolor{stringliteral}{"{}/config.json"{}},\ \textcolor{stringliteral}{"{}w"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00215}00215\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (serializeJsonPretty(doc,\ file)\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00216}00216\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00217}00217\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(F(\textcolor{stringliteral}{"{}Failed\ to\ write\ to\ file"{}}));}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00218}00218\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00219}00219\ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00220}00220\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00221}00221\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00222}00222\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00223}00223\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00224}00224\ \ \ \ \ \textcolor{comment}{//\ Get\ current\ value\ for\ a\ specific\ custom\ option\ (true\ on\ success)}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00225}00225\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00226}\mbox{\hyperlink{class_f_s_web_server_a1fccb194dcd5d9ea19479fe0e44d6011}{00226}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_f_s_web_server_a1fccb194dcd5d9ea19479fe0e44d6011}{getOptionValue}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ T\ \&var)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00227}00227\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00228}00228\ \ \ \ \ \ \ \ \ File\ file\ =\ m\_filesystem-\/>open(\textcolor{stringliteral}{"{}/config.json"{}},\ \textcolor{stringliteral}{"{}r"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00229}00229\ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc(file.size()\ *\ 1.33);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00230}00230\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (file)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00231}00231\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00232}00232\ \ \ \ \ \ \ \ \ \ \ \ \ DeserializationError\ error\ =\ deserializeJson(doc,\ file);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00233}00233\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (error)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00234}00234\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00235}00235\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(F(\textcolor{stringliteral}{"{}Failed\ to\ deserialize\ file,\ may\ be\ corrupted"{}}));}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00236}00236\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(error.c\_str());}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00237}00237\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00238}00238\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00239}00239\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00240}00240\ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00241}00241\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00242}00242\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00243}00243\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00244}00244\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00245}00245\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (doc[label][\textcolor{stringliteral}{"{}value"{}}])}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00246}00246\ \ \ \ \ \ \ \ \ \ \ \ \ var\ =\ doc[label][\textcolor{stringliteral}{"{}value"{}}].as<T>();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00247}00247\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (doc[label][\textcolor{stringliteral}{"{}selected"{}}])}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00248}00248\ \ \ \ \ \ \ \ \ \ \ \ \ var\ =\ doc[label][\textcolor{stringliteral}{"{}selected"{}}].as<T>();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00249}00249\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00250}00250\ \ \ \ \ \ \ \ \ \ \ \ \ var\ =\ doc[label].as<T>();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00251}00251\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00252}00252\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00253}00253\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00254}00254\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00255}\mbox{\hyperlink{class_f_s_web_server_ad7b59fada3a0ae2752d4742a38fe7f19}{00255}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_f_s_web_server_ad7b59fada3a0ae2752d4742a38fe7f19}{saveOptionValue}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label,\ T\ val)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00256}00256\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00257}00257\ \ \ \ \ \ \ \ \ File\ file\ =\ m\_filesystem-\/>open(\textcolor{stringliteral}{"{}/config.json"{}},\ \textcolor{stringliteral}{"{}w"{}});}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00258}00258\ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc(file.size()\ *\ 1.33);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00259}00259\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00260}00260\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (file)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00261}00261\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00262}00262\ \ \ \ \ \ \ \ \ \ \ \ \ DeserializationError\ error\ =\ deserializeJson(doc,\ file);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00263}00263\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (error)}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00264}00264\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00265}00265\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(F(\textcolor{stringliteral}{"{}Failed\ to\ deserialize\ file,\ may\ be\ corrupted"{}}));}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00266}00266\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{esp-fs-webserver_8h_a72641a738b7438a623b30b2bed3f0865}{DebugPrintln}}(error.c\_str());}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00267}00267\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00268}00268\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00269}00269\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00270}00270\ \ \ \ \ \ \ \ \ \ \ \ \ file.close();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00271}00271\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00272}00272\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00273}00273\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00274}00274\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00275}00275\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (doc[label][\textcolor{stringliteral}{"{}value"{}}])}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00276}00276\ \ \ \ \ \ \ \ \ \ \ \ \ doc[label][\textcolor{stringliteral}{"{}value"{}}]\ =\ val;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00277}00277\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (doc[label][\textcolor{stringliteral}{"{}selected"{}}])}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00278}00278\ \ \ \ \ \ \ \ \ \ \ \ \ doc[label][\textcolor{stringliteral}{"{}selected"{}}]\ =\ val;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00279}00279\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00280}00280\ \ \ \ \ \ \ \ \ \ \ \ \ doc[label]\ =\ val;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00281}00281\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00282}00282\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00283}00283\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00284}00284\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00285}00285\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00286}00286\ \textcolor{keyword}{private}:}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00287}00287\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00288}00288\ \ \ \ \ \textcolor{keywordtype}{char}\ m\_basePath[16];}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00289}00289\ \ \ \ \ UpdateServerClass\ m\_httpUpdater;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00290}00290\ \ \ \ \ DNSServer\ m\_dnsServer;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00291}00291\ \ \ \ \ fs::FS\ *m\_filesystem;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00292}00292\ \ \ \ \ File\ m\_uploadFile;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00293}00293\ \ \ \ \ \textcolor{keywordtype}{bool}\ m\_fsOK\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00294}00294\ \ \ \ \ \textcolor{keywordtype}{bool}\ m\_apmode\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00295}00295\ \ \ \ \ \textcolor{keywordtype}{char}\ *m\_apWebpage\ =\ (\textcolor{keywordtype}{char}\ *)\textcolor{stringliteral}{"{}/setup"{}};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00296}00296\ \ \ \ \ uint32\_t\ m\_timeout\ =\ 10000;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00297}00297\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00298}00298\ \ \ \ \ \textcolor{comment}{//\ Default\ handler\ for\ all\ URIs\ not\ defined\ above,\ use\ it\ to\ read\ files\ from\ filesystem}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00299}00299\ \ \ \ \ \textcolor{keywordtype}{bool}\ checkDir(\textcolor{keywordtype}{char}\ *dirname,\ uint8\_t\ levels);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00300}00300\ \ \ \ \ \textcolor{keywordtype}{void}\ doWifiConnection();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00301}00301\ \ \ \ \ \textcolor{keywordtype}{void}\ doRestart();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00302}00302\ \ \ \ \ \textcolor{keywordtype}{void}\ replyOK();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00303}00303\ \ \ \ \ \textcolor{keywordtype}{void}\ getIpAddress();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00304}00304\ \ \ \ \ \textcolor{keywordtype}{void}\ handleRequest();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00305}00305\ \textcolor{preprocessor}{\#ifdef\ INCLUDE\_SETUP\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00306}00306\ \ \ \ \ \textcolor{keywordtype}{void}\ removeWhiteSpaces(String\&\ str);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00307}00307\ \ \ \ \ \textcolor{keywordtype}{void}\ handleSetup();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00308}00308\ \ \ \ \ uint8\_t\ numOptions\ =\ 0;}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00309}00309\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00310}00310\ \ \ \ \ \textcolor{keywordtype}{void}\ handleIndex();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00311}00311\ \ \ \ \ \textcolor{keywordtype}{bool}\ handleFileRead(\textcolor{keyword}{const}\ String\ \&path);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00312}00312\ \ \ \ \ \textcolor{keywordtype}{void}\ handleFileUpload();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00313}00313\ \ \ \ \ \textcolor{keywordtype}{void}\ replyToCLient(\textcolor{keywordtype}{int}\ msg\_type,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *msg);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00314}00314\ \ \ \ \ \textcolor{keywordtype}{void}\ checkForUnsupportedPath(String\ \&filename,\ String\ \&error);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00315}00315\ \ \ \ \ \textcolor{keywordtype}{void}\ setCrossOrigin();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00316}00316\ \ \ \ \ \textcolor{keywordtype}{void}\ handleScanNetworks();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00317}00317\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *getContentType(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename);}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00318}00318\ \ \ \ \ \textcolor{keywordtype}{bool}\ captivePortal();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00319}00319\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00320}00320\ \ \ \ \ \textcolor{comment}{//\ edit\ page,\ in\ usefull\ in\ some\ situation,\ but\ if\ you\ need\ to\ provide\ only\ a\ web\ interface,\ you\ can\ disable}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00321}00321\ \textcolor{preprocessor}{\#ifdef\ INCLUDE\_EDIT\_HTM}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00322}00322\ \ \ \ \ \textcolor{keywordtype}{void}\ handleGetEdit();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00323}00323\ \ \ \ \ \textcolor{keywordtype}{void}\ handleFileCreate();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00324}00324\ \ \ \ \ \textcolor{keywordtype}{void}\ handleFileDelete();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00325}00325\ \ \ \ \ \textcolor{keywordtype}{void}\ handleStatus();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00326}00326\ \ \ \ \ \textcolor{keywordtype}{void}\ handleFileList();}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00327}00327\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00328}00328\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00329}00329\ \};}
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00330}00330\ }
\DoxyCodeLine{\Hypertarget{esp-fs-webserver_8h_source_l00331}00331\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
