/*
* Sending XML status files to client
*/
void XML_response()
{
String resp;
resp = resp + "";
resp = resp + "";
resp = resp + "";
if (nightlightActive && nightlightFade)
{
resp = resp + bri_t;
} else
{
resp = resp + bri;
}
resp = resp + "";
for (int i = 0; i < 3; i++)
{
resp = resp + "";
resp = resp + col[i];
resp = resp + "";
}
resp = resp + "";
resp = resp + notifyMaster;
resp = resp + "";
resp = resp + "";
resp = resp + receiveNotifications;
resp = resp + "";
resp = resp + "";
resp = resp + nightlightActive;
resp = resp + "";
resp = resp + "";
resp = resp + effectCurrent;
resp = resp + "";
resp = resp + "";
resp = resp + effectSpeed;
resp = resp + "";
resp = resp + "";
resp = resp + serverDescription;
resp = resp + "";
//enable toolbar here
resp = resp + "";
server.send(200, "text/xml", resp);
}
void XML_response_settings()
{
DEBUG_PRINTLN("XML settings response");
String resp;
resp = resp + "";
resp = resp + "";
resp = resp + "";
resp = resp + clientssid;
resp = resp + "";
resp = resp + "";
for (int i = 0; i < clientpass.length(); i++)
{
resp = resp + "*";
}
resp = resp + "";
for (int i = 0; i < 4; i++)
{
resp = resp + "";
resp = resp + staticip[i];
resp = resp + "";
}
for (int i = 0; i < 4; i++)
{
resp = resp + "";
resp = resp + staticgateway[i];
resp = resp + "";
}
for (int i = 0; i < 4; i++)
{
resp = resp + "";
resp = resp + staticsubnet[i];
resp = resp + "";
}
resp = resp + "";
resp = resp + cmdns;
resp = resp + "";
resp = resp + "";
resp = resp + apssid;
resp = resp + "";
resp = resp + "";
resp = resp + aphide;
resp = resp + "";
resp = resp + "";
for (int i = 0; i < appass.length(); i++)
{
resp = resp + "*";
}
resp = resp + "";
resp = resp + "";
resp = resp + apchannel;
resp = resp + "";
resp = resp + "";
resp = resp + serverDescription;
resp = resp + "";
for (int i = 0; i < 3; i++)
{
resp = resp + "";
resp = resp + col_s[i];
resp = resp + "";
}
resp = resp + "";
resp = resp + bri_s;
resp = resp + "";
resp = resp + "";
resp = resp + effectDefault;
resp = resp + "";
resp = resp + "";
resp = resp + effectSpeedDefault;
resp = resp + "";
resp = resp + "";
resp = resp + bool2int(useGammaCorrectionBri);
resp = resp + "";
resp = resp + bool2int(useGammaCorrectionRGB);
resp = resp + "";
resp = resp + "";
resp = resp + bool2int(buttonEnabled);
resp = resp + "";
resp = resp + bool2int(fadeTransition);
resp = resp + "";
resp = resp + transitionDelay;
resp = resp + "";
resp = resp + "";
resp = resp + bri_nl;
resp = resp + "";
resp = resp + "";
resp = resp + nightlightDelayMins;
resp = resp + "";
resp = resp + "";
resp = resp + bool2int(nightlightFade);
resp = resp + "";
resp = resp + "";
resp = resp + udpPort;
resp = resp + "";
resp = resp + "";
resp = resp + bool2int(receiveNotificationsDefault);
resp = resp + "";
resp = resp + bri_n;
resp = resp + "";
resp = resp + bool2int(notifyDirect);
resp = resp + "";
resp = resp + bool2int(notifyButton);
resp = resp + "";
resp = resp + bool2int(notifyNightlight);
resp = resp + "";
resp = resp + "";
resp = resp + bool2int(ntpEnabled);
resp = resp + "";
DEBUG_PRINTLN("pretime");
resp = resp + "";
resp = resp + getTimeString();
resp = resp + "";
DEBUG_PRINTLN("posttime");
resp = resp + "";
resp = resp + bool2int(ota_lock);
resp = resp +"";
resp = resp + "0"; //NI
resp = resp + "";
if (!WiFi.localIP()[0] == 0)
{
resp = resp + WiFi.localIP()[0];
resp = resp + ".";
resp = resp + WiFi.localIP()[1];
resp = resp + ".";
resp = resp + WiFi.localIP()[2];
resp = resp + ".";
resp = resp + WiFi.localIP()[3];
} else
{
resp = resp + "Not connected";
}
resp = resp + "";
if (!WiFi.softAPIP()[0] == 0)
{
resp = resp + WiFi.softAPIP()[0];
resp = resp + ".";
resp = resp + WiFi.softAPIP()[1];
resp = resp + ".";
resp = resp + WiFi.softAPIP()[2];
resp = resp + ".";
resp = resp + WiFi.softAPIP()[3];
} else
{
resp = resp + "Not active";
}
resp = resp + "";
resp = resp + "WLED 0.3pd OK";
resp = resp + "";
DEBUG_PRINTLN(resp);
server.send(200, "text/xml", resp);
}