Skip to content

Commit

Permalink
Merge pull request #8 from canusorn/develop
Browse files Browse the repository at this point in the history
v0.0.6
  • Loading branch information
canusorn authored May 13, 2022
2 parents 30dc04a + 79aa6c6 commit 8e418ea
Show file tree
Hide file tree
Showing 14 changed files with 1,586 additions and 346 deletions.
26 changes: 4 additions & 22 deletions examples/01acmeter/1.3acmeter_iotwebconf/1.3acmeter_iotwebconf.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const char wifiInitialApPassword[] = "iotbundle";
#define STRING_LEN 128
#define NUMBER_LEN 32

// #define CONFIG_VERSION iot.getVersion()

// -- Method declarations.
void handleRoot();
// -- Callback methods.
Expand All @@ -59,7 +57,7 @@ char emailParamValue[STRING_LEN];
char passParamValue[STRING_LEN];
char serverParamValue[STRING_LEN];

IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, VERSION); // version defind in iotbundle.h file
IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, VERSION); // version defind in iotbundle.h file
// -- You can also use namespace formats e.g.: iotwebconf::TextParameter
IotWebConfParameterGroup login = IotWebConfParameterGroup("login", "ล็อกอิน(สมัครที่เว็บก่อนนะครับ)");

Expand Down Expand Up @@ -418,9 +416,11 @@ void handleRoot()
s += ESP.getChipId();
s += "<li>Server : ";
s += serverParamValue;
s += "<li>Version : ";
s += VERSION;
s += "</ul>";
s += "<button style='margin-top: 10px;' type='button' onclick=\"location.href='/reboot';\" >รีบูทอุปกรณ์</button><br><br>";
s += "<a href='config'>configure page</a> เพื่อแก้ไขข้อมูล wifi และ user";
s += "<a href='config'>configure page แก้ไขข้อมูล wifi และ user</a>";
s += "</body></html>\n";

server.send(200, "text/html", s);
Expand Down Expand Up @@ -456,24 +456,6 @@ bool formValidator(iotwebconf::WebRequestWrapper *webRequestWrapper)
Serial.println("Validating form.");
bool valid = true;

int l = webRequestWrapper->arg(emailParam.getId()).length();
Serial.println("before");
Serial.print("emailparam.getid.legnth : ");
Serial.println(l);
Serial.print("emailparamvalue : ");
Serial.println(emailParamValue);
Serial.print("emailparamvalue : ");
Serial.println(webRequestWrapper->arg(emailParam.getId()));

webRequestWrapper->arg(emailParam.getId()) = 'g';

Serial.println("after");
Serial.print("emailparam.getid.legnth : ");
Serial.println(l);
Serial.print("emailparamvalue : ");
Serial.println(emailParamValue);
Serial.print("emailparamvalue : ");
Serial.println(webRequestWrapper->arg(emailParam.getId()));
// if (l < 3)
// {
// emailParam.errorMessage = "Please provide at least 3 characters for this test!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ const char wifiInitialApPassword[] = "iotbundle";
#define STRING_LEN 128
#define NUMBER_LEN 32

#define CONFIG_VERSION "0.0.4"

// -- Method declarations.
void handleRoot();
// -- Callback methods.
Expand All @@ -60,7 +58,7 @@ char emailParamValue[STRING_LEN];
char passParamValue[STRING_LEN];
char serverParamValue[STRING_LEN];

IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, CONFIG_VERSION);
IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, VERSION); // version defind in iotbundle.h file
// -- You can also use namespace formats e.g.: iotwebconf::TextParameter
IotWebConfParameterGroup login = IotWebConfParameterGroup("login", "ล็อกอิน(สมัครที่เว็บก่อนนะครับ)");

Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions examples/04DHT/4.3DHT_iotwebconf/4.3DHT_iotwebconf.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const char wifiInitialApPassword[] = "iotbundle";
#define STRING_LEN 128
#define NUMBER_LEN 32

#define CONFIG_VERSION "0.0.4"

// -- Method declarations.
void handleRoot();
// -- Callback methods.
Expand Down Expand Up @@ -52,7 +50,7 @@ char emailParamValue[STRING_LEN];
char passParamValue[STRING_LEN];
char serverParamValue[STRING_LEN];

IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, CONFIG_VERSION);
IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, VERSION); // version defind in iotbundle.h file
// -- You can also use namespace formats e.g.: iotwebconf::TextParameter
IotWebConfParameterGroup login = IotWebConfParameterGroup("login", "ล็อกอิน(สมัครที่เว็บก่อนนะครับ)");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const char wifiInitialApPassword[] = "iotbundle";
#define STRING_LEN 128
#define NUMBER_LEN 32

#define CONFIG_VERSION "0.0.4"

// -- Method declarations.
void handleRoot();
// -- Callback methods.
Expand Down Expand Up @@ -51,7 +49,7 @@ char emailParamValue[STRING_LEN];
char passParamValue[STRING_LEN];
char serverParamValue[STRING_LEN];

IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, CONFIG_VERSION);
IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, VERSION); // version defind in iotbundle.h file
// -- You can also use namespace formats e.g.: iotwebconf::TextParameter
IotWebConfParameterGroup login = IotWebConfParameterGroup("login", "ล็อกอิน(สมัครที่เว็บก่อนนะครับ)");

Expand Down
Loading

0 comments on commit 8e418ea

Please sign in to comment.