From 43c04a7adf293b0527362ecccf3bc344ae03ef96 Mon Sep 17 00:00:00 2001 From: Gregg Date: Mon, 12 Oct 2020 18:48:25 -0500 Subject: [PATCH] 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. --- src/Network.cpp | 6 +++--- src/Settings.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Network.cpp b/src/Network.cpp index 6225161..ab70a59 100644 --- a/src/Network.cpp +++ b/src/Network.cpp @@ -311,8 +311,6 @@ void Network::processRequest(char *body, char *formData){ landingPage=true; - homeSpan.statusLED.start(LED_AP_CONNECTED); - responseBody+="

Welcome to HomeSpan! This page allows you to configure the above HomeSpan device to connect to your WiFi network.

" "

The LED on this device should be double-blinking during this configuration.

" "
" @@ -335,8 +333,10 @@ void Network::processRequest(char *body, char *formData){ } else - if(!landingPage) + if(!landingPage){ 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 responseBody+=""; // close out body and html tags diff --git a/src/Settings.h b/src/Settings.h index 213b649..be85fe6 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -40,7 +40,7 @@ #define LED_ALERT 100 // rapid flashing #define LED_WIFI_CONNECTING 2000 // slow flashing #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 //