From 95fa5c9bb8193448ae1d66a87d117d4399c8515c Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Fri, 16 Mar 2018 15:02:59 +0900 Subject: [PATCH] Added license --- examples/Credential/Credential.ino | 38 +++++++++++++--------- examples/HandleClient/HandleClient.ino | 9 +++++ examples/HandlePortal/HandlePortal.ino | 16 +++++++++ examples/HandlePortalEX/HandlePortalEX.ino | 21 +++++++++++- examples/Simple/Simple.ino | 9 +++++ 5 files changed, 76 insertions(+), 17 deletions(-) diff --git a/examples/Credential/Credential.ino b/examples/Credential/Credential.ino index 347e300..4d4db07 100644 --- a/examples/Credential/Credential.ino +++ b/examples/Credential/Credential.ino @@ -1,17 +1,19 @@ -/** - * AutoConnect for ESP8266. - * https://github.com/Hieromon/AutoConnect - * Copyright 2018, Hieromon Ikasamo. - * Licensed under The MIT License. - * https://opensource.org/licenses/mit-license.php - * An example sketch for an Arduino library for ESP8266 WLAN configuration - * via the Web interface. This sketch provides a conservation measures - * utility for saved credentials in EEPROM. - * By accessing the root path, you can see the list of currently saved - * credentials via the browser. Enter an entry number of the credential, - * that entry will be deleted from EEPROM. - * This sketch uses PageBuilder to support handling of operation pages. - */ +/* + Credential.ino, AutoConnect for ESP8266. + https://github.com/Hieromon/AutoConnect + Copyright 2018, Hieromon Ikasamo. + Licensed under The MIT License. + https://opensource.org/licenses/MIT + + An example sketch for an Arduino library for ESP8266 WLAN configuration + via the Web interface. This sketch provides a conservation measures + utility for saved credentials in EEPROM. + By accessing the root path, you can see the list of currently saved + credentials via the browser. Enter an entry number of the credential, + that entry will be deleted from EEPROM. + This sketch uses PageBuilder to support handling of operation pages. +*/ + #include #include #include @@ -24,8 +26,12 @@ String viewCredential(PageArgument&); String delCredential(PageArgument&); // Specified the offset if the user data exists. -//#define CREDENTIAL_OFFSET 0 -#define CREDENTIAL_OFFSET 64 +// The following two lines define the boundalyOffset value to be supplied to +// AutoConnectConfig respectively. It may be necessary to adjust the value +// accordingly to the actual situation. + +#define CREDENTIAL_OFFSET 0 +//#define CREDENTIAL_OFFSET 64 /** * An HTML for the operation page. diff --git a/examples/HandleClient/HandleClient.ino b/examples/HandleClient/HandleClient.ino index f29a662..fd2764b 100644 --- a/examples/HandleClient/HandleClient.ino +++ b/examples/HandleClient/HandleClient.ino @@ -1,3 +1,12 @@ +/* + HandleCline.ino, Example for the AutoConnect library. + Copyright (c) 2018, Hieromon Ikasamo + https://github.com/Hieromon/AutoConnect + + This software is released under the MIT License. + https://opensource.org/licenses/MIT +*/ + #include #include #include diff --git a/examples/HandlePortal/HandlePortal.ino b/examples/HandlePortal/HandlePortal.ino index eb1d6e0..1e06e8b 100644 --- a/examples/HandlePortal/HandlePortal.ino +++ b/examples/HandlePortal/HandlePortal.ino @@ -1,3 +1,19 @@ +/* + HandlePortal.ino, Example for the AutoConnect library. + Copyright (c) 2018, Hieromon Ikasamo + https://github.com/Hieromon/AutoConnect + + This software is released under the MIT License. + https://opensource.org/licenses/MIT +*/ +/* + This is a way of not explicitly declaring ESP8266WebServer. It uses + the ESP8266WebServer function without its declaration. + I recommend that you consider this example compared to HandlePortalEX.ino. + https://github.com/Hieromon/AutoConnect/blob/master/examples/HandlePortalEX/HandlePortalEX.ino + It will help you understand AutoConnect usage. +*/ + #include #include #include diff --git a/examples/HandlePortalEX/HandlePortalEX.ino b/examples/HandlePortalEX/HandlePortalEX.ino index 59a4e00..7fb224b 100644 --- a/examples/HandlePortalEX/HandlePortalEX.ino +++ b/examples/HandlePortalEX/HandlePortalEX.ino @@ -1,7 +1,24 @@ +/* + HandlePortalEX.ino, Example for the AutoConnect library. + Copyright (c) 2018, Hieromon Ikasamo + https://github.com/Hieromon/AutoConnect + + This software is released under the MIT License. + https://opensource.org/licenses/MIT +*/ +/* + This is an explicit declaration of ESP8266WebServer. AutoConnect uses + its declaration. Also, by using PageBuilder for HTML assembly, you can + display the web page without using the ESP8266WebServer::send() function. + I recommend that you consider this example compared to HandlePortal.ino. + https://github.com/Hieromon/AutoConnect/blob/master/examples/HandlePortal/HandlePortal.ino + It will help you understand AutoConnect usage. +*/ + #include #include #include -#include "AutoConnect.h" +#include ESP8266WebServer server; AutoConnect portal(server); @@ -72,6 +89,8 @@ String gpio(PageArgument& args) { PageElement elm_io("{{IO}}", { {"IO", gpio} }); PageBuilder io("/io", { elm_io }); +// This function is for redirect only. +// The actual sending the HTML performs in PageBuilder. void sendRedirect(String uri) { server.sendHeader("Location", uri, true); server.send(302, "text/plain", ""); diff --git a/examples/Simple/Simple.ino b/examples/Simple/Simple.ino index f552ea2..2ac3f58 100644 --- a/examples/Simple/Simple.ino +++ b/examples/Simple/Simple.ino @@ -1,3 +1,12 @@ +/* + Simple.ino, Example for the AutoConnect library. + Copyright (c) 2018, Hieromon Ikasamo + https://github.com/Hieromon/AutoConnect + + This software is released under the MIT License. + https://opensource.org/licenses/MIT +*/ + #include #include #include