Added license

pull/8/head
Hieromon Ikasamo 7 years ago
parent 6fce7d031d
commit 95fa5c9bb8
  1. 36
      examples/Credential/Credential.ino
  2. 9
      examples/HandleClient/HandleClient.ino
  3. 16
      examples/HandlePortal/HandlePortal.ino
  4. 21
      examples/HandlePortalEX/HandlePortalEX.ino
  5. 9
      examples/Simple/Simple.ino

@ -1,17 +1,19 @@
/** /*
* AutoConnect for ESP8266. Credential.ino, AutoConnect for ESP8266.
* https://github.com/Hieromon/AutoConnect https://github.com/Hieromon/AutoConnect
* Copyright 2018, Hieromon Ikasamo. Copyright 2018, Hieromon Ikasamo.
* Licensed under The MIT License. Licensed under The MIT License.
* https://opensource.org/licenses/mit-license.php 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 An example sketch for an Arduino library for ESP8266 WLAN configuration
* utility for saved credentials in EEPROM. via the Web interface. This sketch provides a conservation measures
* By accessing the root path, you can see the list of currently saved utility for saved credentials in EEPROM.
* credentials via the browser. Enter an entry number of the credential, By accessing the root path, you can see the list of currently saved
* that entry will be deleted from EEPROM. credentials via the browser. Enter an entry number of the credential,
* This sketch uses PageBuilder to support handling of operation pages. that entry will be deleted from EEPROM.
This sketch uses PageBuilder to support handling of operation pages.
*/ */
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <AutoConnect.h> #include <AutoConnect.h>
@ -24,8 +26,12 @@ String viewCredential(PageArgument&);
String delCredential(PageArgument&); String delCredential(PageArgument&);
// Specified the offset if the user data exists. // Specified the offset if the user data exists.
//#define CREDENTIAL_OFFSET 0 // The following two lines define the boundalyOffset value to be supplied to
#define CREDENTIAL_OFFSET 64 // 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. * An HTML for the operation page.

@ -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 <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <AutoConnect.h> #include <AutoConnect.h>

@ -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 <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <AutoConnect.h> #include <AutoConnect.h>

@ -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 <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <PageBuilder.h> #include <PageBuilder.h>
#include "AutoConnect.h" #include <AutoConnect.h>
ESP8266WebServer server; ESP8266WebServer server;
AutoConnect portal(server); AutoConnect portal(server);
@ -72,6 +89,8 @@ String gpio(PageArgument& args) {
PageElement elm_io("{{IO}}", { {"IO", gpio} }); PageElement elm_io("{{IO}}", { {"IO", gpio} });
PageBuilder io("/io", { elm_io }); PageBuilder io("/io", { elm_io });
// This function is for redirect only.
// The actual sending the HTML performs in PageBuilder.
void sendRedirect(String uri) { void sendRedirect(String uri) {
server.sendHeader("Location", uri, true); server.sendHeader("Location", uri, true);
server.send(302, "text/plain", ""); server.send(302, "text/plain", "");

@ -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 <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <time.h> #include <time.h>

Loading…
Cancel
Save