This commit is contained in:
Gregg 2020-09-04 19:51:12 -05:00
parent a5e0b1c0ad
commit de897557eb
2 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#include "Configure.h"
#include "Settings.h"
///////////////////////////////
@ -19,6 +18,8 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){
LOG1("In Post Configure...\n");
responseBody+="<meta http-equiv = \"refresh\" content = \"2; url = /wifi-status\" />"
"<p>Initiating WiFi Connection...</p>";
@ -51,10 +52,10 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){
responseBody+="</datalist><br><br>"
"<label for=\"pwd\">WiFi Password:</label>"
"<input type=\"password\" id=\"pwd\" name=\"pwd\">"
"<input type=\"password\" id=\"pwd\" name=\"pwd\" maxlength=" + String(MAX_PWD) + ">"
"<br><br>"
"<label for=\"code\">Setup Code:</label>"
"<input type=\"tel\" id=\"code\" name=\"code\" placeholder=\"12345678\" pattern=\"[0-9]{8}\">";
"<input type=\"tel\" id=\"code\" name=\"code\" placeholder=\"12345678\" pattern=\"[0-9]{8}\" maxlength=8>";
/*
apClient.print("<p><em>");
@ -83,3 +84,9 @@ void Configure::processRequest(WiFiClient &client, char *body, char *formData){
} // processRequest
//////////////////////////////////////
int Configure::getFormValue(char *formData, char *tag, char *value, int maxSize){
}
//////////////////////////////////////

View File

@ -1,9 +1,19 @@
#include <WiFi.h>
#include "Settings.h"
///////////////////////////////
struct Configure {
void processRequest(WiFiClient &client, char *body, char *formData);
struct {
char ssid[MAX_SSID+1];
char pwd[MAX_PWD+1];
} wifiData;
char setupCode[9];
void processRequest(WiFiClient &client, char *body, char *formData);
int getFormValue(char *formData, char *tag, char *value, int maxSize);
};