feature/ipChange #6

Merged
pablo2048 merged 2 commits from feature/ipChange into master 2019-08-28 12:55:46 +02:00
Showing only changes of commit 557d06a557 - Show all commits

View File

@ -1,4 +1,7 @@
/*
* V6.3 - 12.8.2019 - IP adresa Captive portalu je zmenena na 172.217.28.1 kvuli funkcnosti na Android zarizenich (viz. zmena zde https://github.com/esp8266/Arduino/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino)
* ladici vypis pri zachyceni presmerovani v Captive portalu.
*
* V6.2 - 12.12.2018- Nastaveni jmena zarizeni nadale NENI soucasti WiFiConfig a je treba ho pridat jako uzivatelsky parametr. Je to proto, protoze
* se ukazalo, ze neni dobre z externiho kodu sahat do vnitrni struktury WiFiConfig (napr. pri ukladani noveho jmena).
*
@ -313,7 +316,13 @@ void WiFiConfig::_handleNotFound(void)
}
else
{
server->sendHeader(F("Location"), String(F("http://")) + server->client().localIP().toString() + String(F("/index.htm")), true);
String redirect;
redirect.reserve(256);
redirect = F("http://");
redirect.concat(server->client().localIP().toString());
redirect.concat(F("/index.htm"));
DEBUG_MSG("Redirection to: %s\r\n", redirect.c_str());
server->sendHeader(F("Location"), redirect, true);
server->send_P(302, TEXTPLAIN, PSTR("Redirect"));
}
}
@ -697,7 +706,7 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb)
#endif
/* Soft AP network parameters */
IPAddress apIP(192, 168, 4, 1);
IPAddress apIP(172, 217, 28, 1);
IPAddress netMsk(255, 255, 255, 0);
WiFi.disconnect(); // pro jistotu se odpojime