Minor tweaks to LED timings and placement of statusLED.start() in apConfig()

Ensures statusLED indicates a client is connected as soon as it received its first GET, even if the re-direction to /landing-page is yet to be accessed.  This was needed to trigger LED_AP_CONNECTED when connecting with QR code.
This commit is contained in:
Gregg 2020-10-12 18:48:25 -05:00
parent f3b1de2f6b
commit 43c04a7adf
2 changed files with 4 additions and 4 deletions

View File

@ -311,8 +311,6 @@ void Network::processRequest(char *body, char *formData){
landingPage=true; landingPage=true;
homeSpan.statusLED.start(LED_AP_CONNECTED);
responseBody+="<p>Welcome to HomeSpan! This page allows you to configure the above HomeSpan device to connect to your WiFi network.</p>" responseBody+="<p>Welcome to HomeSpan! This page allows you to configure the above HomeSpan device to connect to your WiFi network.</p>"
"<p>The LED on this device should be <em>double-blinking</em> during this configuration.</p>" "<p>The LED on this device should be <em>double-blinking</em> during this configuration.</p>"
"<form action=\"/configure\" method=\"post\">" "<form action=\"/configure\" method=\"post\">"
@ -335,8 +333,10 @@ void Network::processRequest(char *body, char *formData){
} else } else
if(!landingPage) if(!landingPage){
responseHead="HTTP/1.1 307 Temporary Redirect\r\nLocation: /landing-page\r\n"; responseHead="HTTP/1.1 307 Temporary Redirect\r\nLocation: /landing-page\r\n";
homeSpan.statusLED.start(LED_AP_CONNECTED);
}
responseHead+="\r\n"; // add blank line between reponse header and body responseHead+="\r\n"; // add blank line between reponse header and body
responseBody+="</body></html>"; // close out body and html tags responseBody+="</body></html>"; // close out body and html tags

View File

@ -40,7 +40,7 @@
#define LED_ALERT 100 // rapid flashing #define LED_ALERT 100 // rapid flashing
#define LED_WIFI_CONNECTING 2000 // slow flashing #define LED_WIFI_CONNECTING 2000 // slow flashing
#define LED_AP_STARTED 100,0.5,2,300 // rapid double-blink #define LED_AP_STARTED 100,0.5,2,300 // rapid double-blink
#define LED_AP_CONNECTED 500,0.3,2,1000 // medium double-blink #define LED_AP_CONNECTED 300,0.5,2,400 // medium double-blink
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// Message Log Level Control Macros // // Message Log Level Control Macros //