From 20c1d9da14fda91d9c4a412eb4cb94100bc26d69 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Sun, 10 Feb 2019 03:38:35 +0900 Subject: [PATCH] Updated a response waiting sequence of connection attempts --- src/AutoConnect.cpp | 4 ++-- src/AutoConnectDefs.h | 10 +++++----- src/AutoConnectPage.cpp | 16 ++++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/AutoConnect.cpp b/src/AutoConnect.cpp index 06bca6f..2a3719a 100644 --- a/src/AutoConnect.cpp +++ b/src/AutoConnect.cpp @@ -601,7 +601,7 @@ bool AutoConnect::_captivePortal() { if (!_isIP(hostHeader) && (hostHeader != WiFi.localIP().toString())) { String location = String(F("http://")) + _webServer->client().localIP().toString() + String(AUTOCONNECT_URI); _webServer->sendHeader(String(F("Location")), location, true); - _webServer->send(302, String(F("text/plain")), ""); + _webServer->send(302, String(F("text/plain")), _emptyString); _webServer->client().flush(); _webServer->client().stop(); return true; @@ -767,7 +767,7 @@ String AutoConnect::_invokeResult(PageArgument& args) { #endif redirect += _redirectURI; _webServer->sendHeader(String(F("Location")), redirect, true); - _webServer->send(302, String(F("text/plain")), ""); + _webServer->send(302, String(F("text/plain")), _emptyString); _webServer->client().flush(); _webServer->client().stop(); _waitForEndTransmission(); // Wait for response transmission complete diff --git a/src/AutoConnectDefs.h b/src/AutoConnectDefs.h index 3a0bc33..87da573 100644 --- a/src/AutoConnectDefs.h +++ b/src/AutoConnectDefs.h @@ -53,7 +53,7 @@ #define AUTOCONNECT_AP_NM 0x00FFFFFF //*< 255.255.255.0 */ #endif // !AUTOCONNECT_AP_NM #ifndef AUTOCONNECT_AP_CH -#define AUTOCONNECT_AP_CH 11 +#define AUTOCONNECT_AP_CH 1 #endif // !AUTOCONNECT_AP_CH // AutoConnect menu root path @@ -101,10 +101,10 @@ #define AUTOCONNECT_STARTUPTIME (AUTOCONNECT_TIMEOUT/1000) #endif // !AUTOCONNECT_STARTUPTIME -// Response wait time until requesting a result of connection attempt [s] as String -#ifndef AUTOCONNECT_RESPONSEREQUEST_TIMEOUT -#define AUTOCONNECT_RESPONSEREQUEST_TIMEOUT "7" -#endif // !AUTOCONNECT_RESPONSEREQUEST_TIMEOUT +// Response wait time until requesting a result of connection attempt, uint:[s] as String +#ifndef AUTOCONNECT_RESPONSE_WAITTIME +#define AUTOCONNECT_RESPONSE_WAITTIME "2" +#endif // !AUTOCONNECT_RESPONSE_WAITTIME // Default HTTP port #ifndef AUTOCONNECT_HTTPPORT diff --git a/src/AutoConnectPage.cpp b/src/AutoConnectPage.cpp index 2257da1..3340e53 100644 --- a/src/AutoConnectPage.cpp +++ b/src/AutoConnectPage.cpp @@ -288,7 +288,7 @@ const char AutoConnect::_CSS_SPINNER[] PROGMEM = { "width:100%;" "height:100%;" "border-radius:50%;" - "background-color:#a2d9cd;" + "background-color:#a3cccc;" "opacity:0.6;" "position:absolute;" "top:0;" @@ -717,17 +717,12 @@ const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = { const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = { "{{REQ}}" "{{HEAD}}" - "" "AutoConnect connecting" "" - "" "" "" "
" @@ -736,9 +731,13 @@ const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = { "
" "
" "
" - "
{{CUR_SSID}}
" + "
{{CUR_SSID}}
" "
" "
" + "" "" "" }; @@ -1176,7 +1175,8 @@ String AutoConnect::_token_BOOTURI(PageArgument& args) { String AutoConnect::_token_CURRENT_SSID(PageArgument& args) { AC_UNUSED(args); - return String(reinterpret_cast(_credential.ssid)); + String ssid = reinterpret_cast(_credential.ssid); + return ssid; } /**