From 4e2c28bcf86b04b07ba0ddacaa676178fab5f7c3 Mon Sep 17 00:00:00 2001 From: Gregg Date: Thu, 3 Sep 2020 21:56:52 -0500 Subject: [PATCH] Update Configure.cpp --- src/Configure.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Configure.cpp b/src/Configure.cpp index 118727b..0881238 100644 --- a/src/Configure.cpp +++ b/src/Configure.cpp @@ -7,6 +7,10 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){ String s; + String header; + + header+=""; + header+="

HomeSpan Setup

"; if(!strncmp(body,"POST /configure ",16) && // POST CONFIGURE strstr(body,"Content-Type: application/x-www-form-urlencoded")){ // check that content is from a form @@ -16,12 +20,9 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){ LOG1("In Post Configure...\n"); - s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; -// s+="Initiating"; - s+="Initiating"; - + s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n" + header; s+=""; - s+="

Initiating WiFi Connection...

"; + s+="

Initiating WiFi Connection...

"; } else @@ -29,9 +30,8 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){ LOG1("In Get WiFi Status...\n"); - s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\nRefresh: 5\r\n\r\n"; - s+="Connection Status"; - s+="

Trying to Connect ("; + s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\nRefresh: 5\r\n\r\n" + header; + s+="

Trying to Connect ("; s+=String(millis()/1000) + "sec)...

"; } else { // LOGIN PAGE @@ -40,9 +40,7 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){ int n=WiFi.scanNetworks(); - s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; - s+="HomeSpan Configuration"; - s+="

HomeSpan_12_54_DD_E4_23_F5

"; + s+="HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n" + header; s+="

Welcome to HomeSpan! This page allows you to configure the above HomeSpan device to connect to your WiFi network, and (if needed) to create a Setup Code for pairing this device to HomeKit.

"; s+="

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

";