<!doctype html>
< html lang = "en" class = "no-js" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
< meta http-equiv = "x-ua-compatible" content = "ie=edge" >
< meta name = "description" content = "ESP8266/ESP32 WLAN configuration at run time with web interface" >
< link rel = "canonical" href = "https://Hieromon.github.io/AutoConnect/api.html" >
< meta name = "author" content = "Hieromon Ikasamo" >
< meta name = "lang:clipboard.copy" content = "Copy to clipboard" >
< meta name = "lang:clipboard.copied" content = "Copied to clipboard" >
< meta name = "lang:search.language" content = "en" >
< meta name = "lang:search.pipeline.stopwords" content = "True" >
< meta name = "lang:search.pipeline.trimmer" content = "True" >
< meta name = "lang:search.result.none" content = "No matching documents" >
< meta name = "lang:search.result.one" content = "1 matching document" >
< meta name = "lang:search.result.other" content = "# matching documents" >
< meta name = "lang:search.tokenizer" content = "[\s\-]+" >
< link rel = "shortcut icon" href = "assets/images/favicon.png" >
< meta name = "generator" content = "mkdocs-1.1, mkdocs-material-4.6.3" >
< title > AutoConnect API - AutoConnect for ESP8266/ESP32< / title >
< link rel = "stylesheet" href = "assets/stylesheets/application.adb8469c.css" >
< link rel = "stylesheet" href = "assets/stylesheets/application-palette.a8b3c06d.css" >
< meta name = "theme-color" content = "#3f51b5" >
< script src = "assets/javascripts/modernizr.86422ebf.js" > < / script >
< link href = "https://fonts.gstatic.com" rel = "preconnect" crossorigin >
< link rel = "stylesheet" href = "https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback" >
< style > body , input { font-family : "Roboto" , "Helvetica Neue" , Helvetica , Arial , sans-serif } code , kbd , pre { font-family : "Roboto Mono" , "Courier New" , Courier , monospace } < / style >
< link rel = "stylesheet" href = "assets/fonts/material-icons.css" >
< link rel = "stylesheet" href = "css/paragraph.css" >
< link rel = "stylesheet" href = "css/extra.css" >
< link rel = "stylesheet" href = "https://use.fontawesome.com/releases/v5.6.3/css/all.css" >
< script >
window.ga = window.ga || function() {
(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date
/* Setup integration and send page view */
ga("create", "UA-116150854-1", "auto")
ga("set", "anonymizeIp", true)
ga("send", "pageview")
/* Register handler to log search on blur */
document.addEventListener("DOMContentLoaded", () => {
if (document.forms.search) {
var query = document.forms.search.query
query.addEventListener("blur", function() {
if (this.value) {
var path = document.location.pathname;
ga("send", "pageview", path + "?q=" + this.value)
}
})
}
})
< / script >
< script async src = "https://www.google-analytics.com/analytics.js" > < / script >
< / head >
< body dir = "ltr" data-md-color-primary = "indigo" data-md-color-accent = "indigo" >
< svg class = "md-svg" >
< defs >
< svg xmlns = "http://www.w3.org/2000/svg" width = "416" height = "448" viewBox = "0 0 416 448" id = "__github" > < path fill = "currentColor" d = "M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z" / > < / svg >
< / defs >
< / svg >
< input class = "md-toggle" data-md-toggle = "drawer" type = "checkbox" id = "__drawer" autocomplete = "off" >
< input class = "md-toggle" data-md-toggle = "search" type = "checkbox" id = "__search" autocomplete = "off" >
< label class = "md-overlay" data-md-component = "overlay" for = "__drawer" > < / label >
< a href = "#include-headers" tabindex = "0" class = "md-skip" >
Skip to content
< / a >
< header class = "md-header" data-md-component = "header" >
< nav class = "md-header-nav md-grid" >
< div class = "md-flex" >
< div class = "md-flex__cell md-flex__cell--shrink" >
< a href = "https://Hieromon.github.io/AutoConnect/" title = "AutoConnect for ESP8266/ESP32" aria-label = "AutoConnect for ESP8266/ESP32" class = "md-header-nav__button md-logo" >
< img alt = "logo" src = "images/arduino-logo.svg" width = "24" height = "24" >
< / a >
< / div >
< div class = "md-flex__cell md-flex__cell--shrink" >
< label class = "md-icon md-icon--menu md-header-nav__button" for = "__drawer" > < / label >
< / div >
< div class = "md-flex__cell md-flex__cell--stretch" >
< div class = "md-flex__ellipsis md-header-nav__title" data-md-component = "title" >
< span class = "md-header-nav__topic" >
AutoConnect for ESP8266/ESP32
< / span >
< span class = "md-header-nav__topic" >
AutoConnect API
< / span >
< / div >
< / div >
< div class = "md-flex__cell md-flex__cell--shrink" >
< label class = "md-icon md-icon--search md-header-nav__button" for = "__search" > < / label >
< div class = "md-search" data-md-component = "search" role = "dialog" >
< label class = "md-search__overlay" for = "__search" > < / label >
< div class = "md-search__inner" role = "search" >
< form class = "md-search__form" name = "search" >
< input type = "text" class = "md-search__input" aria-label = "search" name = "query" placeholder = "Search" autocapitalize = "off" autocorrect = "off" autocomplete = "off" spellcheck = "false" data-md-component = "query" data-md-state = "active" >
< label class = "md-icon md-search__icon" for = "__search" > < / label >
< button type = "reset" class = "md-icon md-search__icon" data-md-component = "reset" tabindex = "-1" >

< / button >
< / form >
< div class = "md-search__output" >
< div class = "md-search__scrollwrap" data-md-scrollfix >
< div class = "md-search-result" data-md-component = "result" >
< div class = "md-search-result__meta" >
Type to start searching
< / div >
< ol class = "md-search-result__list" > < / ol >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "md-flex__cell md-flex__cell--shrink" >
< div class = "md-header-nav__source" >
< a href = "https://github.com/Hieromon/AutoConnect" title = "Go to repository" class = "md-source" data-md-source = "github" >
< div class = "md-source__icon" >
< svg viewBox = "0 0 24 24" width = "24" height = "24" >
< use xlink:href = "#__github" width = "24" height = "24" > < / use >
< / svg >
< / div >
< div class = "md-source__repository" >
Hieromon/AutoConnect
< / div >
< / a >
< / div >
< / div >
< / div >
< / nav >
< / header >
< div class = "md-container" >
< main class = "md-main" role = "main" >
< div class = "md-main__inner md-grid" data-md-component = "container" >
< div class = "md-sidebar md-sidebar--primary" data-md-component = "navigation" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--primary" data-md-level = "0" >
< label class = "md-nav__title md-nav__title--site" for = "__drawer" >
< a href = "https://Hieromon.github.io/AutoConnect/" title = "AutoConnect for ESP8266/ESP32" class = "md-nav__button md-logo" >
< img alt = "logo" src = "images/arduino-logo.svg" width = "48" height = "48" >
< / a >
AutoConnect for ESP8266/ESP32
< / label >
< div class = "md-nav__source" >
< a href = "https://github.com/Hieromon/AutoConnect" title = "Go to repository" class = "md-source" data-md-source = "github" >
< div class = "md-source__icon" >
< svg viewBox = "0 0 24 24" width = "24" height = "24" >
< use xlink:href = "#__github" width = "24" height = "24" > < / use >
< / svg >
< / div >
< div class = "md-source__repository" >
Hieromon/AutoConnect
< / div >
< / a >
< / div >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "index.html" title = "Overview" class = "md-nav__link" >
Overview
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "gettingstarted.html" title = "Getting started" class = "md-nav__link" >
Getting started
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "menu.html" title = "AutoConnect menu" class = "md-nav__link" >
AutoConnect menu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "basicusage.html" title = "Basic usage" class = "md-nav__link" >
Basic usage
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "advancedusage.html" title = "Advanced usage" class = "md-nav__link" >
Advanced usage
< / a >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "nav-6" type = "checkbox" id = "nav-6" >
< label class = "md-nav__link" for = "nav-6" >
Custom Web pages
< / label >
< nav class = "md-nav" data-md-component = "collapsible" data-md-level = "1" >
< label class = "md-nav__title" for = "nav-6" >
Custom Web pages
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "acintro.html" title = "Custom Web pages with AutoConnect" class = "md-nav__link" >
Custom Web pages with AutoConnect
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "acelements.html" title = "AutoConnectElements" class = "md-nav__link" >
AutoConnectElements
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "acjson.html" title = "Custom Web pages with JSON" class = "md-nav__link" >
Custom Web pages with JSON
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "achandling.html" title = "Handling the custom Web pages" class = "md-nav__link" >
Handling the custom Web pages
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "nav-7" type = "checkbox" id = "nav-7" >
< label class = "md-nav__link" for = "nav-7" >
OTA Updates
< / label >
< nav class = "md-nav" data-md-component = "collapsible" data-md-level = "1" >
< label class = "md-nav__title" for = "nav-7" >
OTA Updates
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "otaupdate.html" title = "OTA Updates" class = "md-nav__link" >
OTA Updates
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "otabrowser.html" title = "Using Web Browser" class = "md-nav__link" >
Using Web Browser
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "otaserver.html" title = "Using Update Server" class = "md-nav__link" >
Using Update Server
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "nav-8" type = "checkbox" id = "nav-8" checked >
< label class = "md-nav__link" for = "nav-8" >
Library APIs
< / label >
< nav class = "md-nav" data-md-component = "collapsible" data-md-level = "1" >
< label class = "md-nav__title" for = "nav-8" >
Library APIs
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item md-nav__item--active" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "toc" type = "checkbox" id = "__toc" >
< label class = "md-nav__link md-nav__link--active" for = "__toc" >
AutoConnect API
< / label >
< a href = "api.html" title = "AutoConnect API" class = "md-nav__link md-nav__link--active" >
AutoConnect API
< / a >
< nav class = "md-nav md-nav--secondary" >
< label class = "md-nav__title" for = "__toc" > Table of contents< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "#include-headers" class = "md-nav__link" >
Include headers
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#autoconnecth" class = "md-nav__link" >
AutoConnect.h
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#defined-macros" class = "md-nav__link" >
Defined macros
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#constructors" class = "md-nav__link" >
Constructors
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#autoconnect" class = "md-nav__link" >
AutoConnect
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#public-member-functions" class = "md-nav__link" >
Public member functions
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#aux" class = "md-nav__link" >
aux
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#begin" class = "md-nav__link" >
begin
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#config" class = "md-nav__link" >
config
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#enablemenu" class = "md-nav__link" >
enableMenu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#end" class = "md-nav__link" >
end
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#disablemenu" class = "md-nav__link" >
disableMenu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#handleclient" class = "md-nav__link" >
handleClient
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#handlerequest" class = "md-nav__link" >
handleRequest
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#home" class = "md-nav__link" >
home
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#host" class = "md-nav__link" >
host
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#join" class = "md-nav__link" >
join
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#load" class = "md-nav__link" >
load
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#on" class = "md-nav__link" >
on
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#ondetect" class = "md-nav__link" >
onDetect
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#onnotfound" class = "md-nav__link" >
onNotFound
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#where" class = "md-nav__link" >
where
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "apiaux.html" title = "AutoConnectAux API" class = "md-nav__link" >
AutoConnectAux API
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "apiconfig.html" title = "AutoConnectConfig API" class = "md-nav__link" >
AutoConnectConfig API
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "apielements.html" title = "AutoConnectElements API" class = "md-nav__link" >
AutoConnectElements API
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "apiupdate.html" title = "AutoConnectUpdate API" class = "md-nav__link" >
AutoConnectUpdate API
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "apiextra.html" title = "Something extra" class = "md-nav__link" >
Something extra
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "nav-9" type = "checkbox" id = "nav-9" >
< label class = "md-nav__link" for = "nav-9" >
Examples
< / label >
< nav class = "md-nav" data-md-component = "collapsible" data-md-level = "1" >
< label class = "md-nav__title" for = "nav-9" >
Examples
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "howtoembed.html" title = "How to embed" class = "md-nav__link" >
How to embed
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "datatips.html" title = "Tips for data conversion" class = "md-nav__link" >
Tips for data conversion
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "menuize.html" title = "Attach the menu" class = "md-nav__link" >
Attach the menu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "wojson.html" title = "Custom Web pages w/o JSON" class = "md-nav__link" >
Custom Web pages w/o JSON
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-toggle md-nav__toggle" data-md-toggle = "nav-10" type = "checkbox" id = "nav-10" >
< label class = "md-nav__link" for = "nav-10" >
Appendix
< / label >
< nav class = "md-nav" data-md-component = "collapsible" data-md-level = "1" >
< label class = "md-nav__title" for = "nav-10" >
Appendix
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "lsbegin.html" title = "Inside AutoConnect::begin" class = "md-nav__link" >
Inside AutoConnect::begin
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "credit.html" title = "Saved credentials access" class = "md-nav__link" >
Saved credentials access
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "acupload.html" title = "File upload handler" class = "md-nav__link" >
File upload handler
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "colorized.html" title = "Custom colorized" class = "md-nav__link" >
Custom colorized
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "changelabel.html" title = "Change label text" class = "md-nav__link" >
Change label text
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "faq.html" title = "FAQ" class = "md-nav__link" >
FAQ
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "changelog.html" title = "Change log" class = "md-nav__link" >
Change log
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "license.html" title = "License" class = "md-nav__link" >
License
< / a >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-sidebar md-sidebar--secondary" data-md-component = "toc" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--secondary" >
< label class = "md-nav__title" for = "__toc" > Table of contents< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "#include-headers" class = "md-nav__link" >
Include headers
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#autoconnecth" class = "md-nav__link" >
AutoConnect.h
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#defined-macros" class = "md-nav__link" >
Defined macros
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#constructors" class = "md-nav__link" >
Constructors
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#autoconnect" class = "md-nav__link" >
AutoConnect
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#public-member-functions" class = "md-nav__link" >
Public member functions
< / a >
< nav class = "md-nav" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#aux" class = "md-nav__link" >
aux
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#begin" class = "md-nav__link" >
begin
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#config" class = "md-nav__link" >
config
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#enablemenu" class = "md-nav__link" >
enableMenu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#end" class = "md-nav__link" >
end
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#disablemenu" class = "md-nav__link" >
disableMenu
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#handleclient" class = "md-nav__link" >
handleClient
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#handlerequest" class = "md-nav__link" >
handleRequest
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#home" class = "md-nav__link" >
home
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#host" class = "md-nav__link" >
host
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#join" class = "md-nav__link" >
join
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#load" class = "md-nav__link" >
load
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#on" class = "md-nav__link" >
on
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#ondetect" class = "md-nav__link" >
onDetect
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#onnotfound" class = "md-nav__link" >
onNotFound
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#where" class = "md-nav__link" >
where
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-content" >
< article class = "md-content__inner md-typeset" >
< h1 > AutoConnect API< / h1 >
< h2 id = "include-headers" > < i class = "fa fa-code" > < / i > Include headers< a class = "headerlink" href = "#include-headers" title = "Permanent link" > ¶ < / a > < / h2 >
< h3 id = "autoconnecth" > AutoConnect.h< a class = "headerlink" href = "#autoconnecth" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #7a7a7a" > #include< / span > < span style = "color: #7a7a7a" > < AutoConnect.h> < / span >
< / code > < / pre > < / div >
< h2 id = "defined-macros" > < i class = "fa fa-code" > < / i > Defined macros< a class = "headerlink" href = "#defined-macros" title = "Permanent link" > ¶ < / a > < / h2 >
< p > They contain in < code > AutoConnectDefs.h< / code > .< / p >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #7a7a7a" > #define AC_DEBUG // Monitor message output activation< / span >
< span style = "color: #7a7a7a" > #define AC_DEBUG_PORT Serial // Default message output device< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_AP_IP 0x011CD9AC // Default SoftAP IP< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_AP_GW 0x011CD9AC // Default SoftAP Gateway IP< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_AP_NM 0x00FFFFFF // Default subnet mask< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_DNSPORT 53 // Default DNS port at captive portal< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_HTTPPORT 80 // Default HTTP< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_MENU_TITLE " AutoConnect" // Default AutoConnect menu title< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_URI " /_ac" // Default AutoConnect root path< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_TIMEOUT 30000 // Default connection timeout[ms]< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_CAPTIVEPORTAL_TIMEOUT 0 // Captive portal timeout value< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_STARTUPTIME 30 // Default waiting time[s] for after reset< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_USE_JSON // Allow AutoConnect elements to be handled by JSON format< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_USE_UPDATE // Indicator of whether to use the AutoConnectUpdate feature.< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_UPDATE_PORT 8000 // Available HTTP port number for the update< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_UPDATE_TIMEOUT 8000 // HTTP client timeout limitation for the update [ms]< / span >
< span style = "color: #7a7a7a" > #define AUTOCONNECT_TICKER_PORT LED_BUILTIN // Ticker port< / span >
< span style = "color: #7a7a7a" > #endif< / span >
< / code > < / pre > < / div >
< div class = "admonition note" >
< p class = "admonition-title" > Macros placement moved< / p >
< p > Source code placement of the above macros provided for user sketch changed from v0.9.7. The new code is in < code > AutoConnectDefs.h< / code > .< / p >
< / div >
< h2 id = "constructors" > < i class = "fa fa-code" > < / i > Constructors< a class = "headerlink" href = "#constructors" title = "Permanent link" > ¶ < / a > < / h2 >
< h3 id = "autoconnect" > AutoConnect< a class = "headerlink" href = "#autoconnect" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > AutoConnect()< / span >
< / code > < / pre > < / div >
< p > < a id = "withparameter" > < / a > < / p >
< p > AutoConnect default constructor. This entry internally allocates the ESP8266WebServer for ESP8266 or WebServer for ESP32 and is activated internally.< / p >
< ul >
< li > For ESP8266< / li >
< / ul >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > AutoConnect(ESP8266WebServer< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > webServer)< / span >
< / code > < / pre > < / div >
< ul >
< li > For ESP32< / li >
< / ul >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > AutoConnect(WebServer< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > webServer)< / span >
< / code > < / pre > < / div >
< p > Run the AutoConnect site using the externally ensured ESP8266WebServer for ESP8266 or WebServer for ESP32.< / p >
< p > The < a href = "api.html#handleclient" > < strong > handleClient< / strong > < / a > function of AutoConnect can include the response of the URI handler added by the user using the "< em > on< / em > " function of ESP8266WebServer/WebServer. If ESP8266WebServer/WebServer is assigned internally by AutoConnect, the Sketch can obtain that reference with the < a href = "api.html#host" > < strong > host< / strong > < / a > function.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > webServer< / span > < span class = "apidesc" > A reference of ESP8266WebServer or WebServer instance.< / span > < / dd >
< / dl > < / p >
< h2 id = "public-member-functions" > < i class = "fa fa-code" > < / i > Public member functions< a class = "headerlink" href = "#public-member-functions" title = "Permanent link" > ¶ < / a > < / h2 >
< h3 id = "aux" > < i class = "fa fa-caret-right" > < / i > aux< a class = "headerlink" href = "#aux" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > AutoConnectAux< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > aux(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #f8f8f2" > String< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > uri)< / span > < span style = "color: #66d9ef" > const< / span >
< / code > < / pre > < / div >
Returns a pointer to AutoConnectAux with the URI specified by < em > uri< / em > . If AutoConnectAux with that URI is not bound, it returns < strong > nullptr< / strong > .
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > uri< / span > < span class = "apidesc" > A string of the URI.< / span > < / dd >
< dt > < strong > Return value< / strong > < / dt >
< dd > A Pointer of the AutoConnectAux instance.< / dd >
< / dl > < / p >
< h3 id = "begin" > < i class = "fa fa-caret-right" > < / i > begin< a class = "headerlink" href = "#begin" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > begin()< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > begin(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > ssid,< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > passphrase)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > begin(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > ssid,< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > passphrase,< / span > < span style = "color: #66d9ef" > unsigned< / span > < span style = "color: #66d9ef" > long< / span > < span style = "color: #f8f8f2" > timeout)< / span >
< / code > < / pre > < / div > < / p >
< p > Starts establishing the WiFi connection. The WiFi mode at this time is WIFI_STA.< br / >
AutoConnect first invokes < em > WiFi.begin< / em > . If the < em > ssid< / em > and the < em > passphrase< / em > are missing, its < em > WiFi.begin< / em > has no SSID and Password. Regardless of the result, ESP8266WebServer/WebServer will start immediately after the first < em > WiFi.begin< / em > .< br / >
The captive portal will not be started if the connection has been established with first < em > WiFi.begin< / em > . If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
< dl class = "apidl" >
< dt > < strong > Parameters< / strong > < / dt >
< dd > < span class = "apidef" > ssid< / span > < span class = "apidesc" > SSID to be connected.< / span > < / dd >
< dd > < span class = "apidef" > passphrase< / span > < span class = "apidesc" > Password for connection.< / span > < / dd >
< dd > < span class = "apidef" > timeout< / span > < span class = "apidesc" > A time out value in milliseconds for waiting connection.< / span > < / dd >
< dt > < strong > Return value< / strong > < / dt >
< dd > < span class = "apidef" > true< / span > < span class = "apidesc" > Connection established, AutoConnect service started with WIFI_STA mode.< / span > < / dd >
< dd > < span class = "apidef" > false< / span > < span class = "apidesc" > Could not connected, Captive portal started with WIFI_AP_STA mode.< / span > < / dd >
< / dl > < / p >
< h3 id = "config" > < i class = "fa fa-caret-right" > < / i > config< a class = "headerlink" href = "#config" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > config(AutoConnectConfig< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > config)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > config(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > ap,< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > char< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > password< / span > < span style = "color: #f92672" > =< / span > < span style = "color: #66d9ef" > nullptr< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div > < / p >
< p > Set SoftAP's WiFi configuration and static IP configuration.
< dl class = "apidl" >
< dt > < strong > Parameters< / strong > < / dt >
< dd > < span class = "apidef" > config< / span > < span class = "apidesc" > Reference to < a href = "apiconfig.html" > < strong > AutoConnectConfig< / strong > < / a > containing SoftAP's parameters and static IP parameters.< / span > < / dd >
< dd > < span class = "apidef" > ap< / span > < span class = "apidesc" > SSID for SoftAP. The default value is < strong > esp8266ap< / strong > for ESP8266, < strong > esp32ap< / strong > for ESP32.< / span > < / dd >
< dd > < span class = "apidef" > password< / span > < span class = "apidesc" > Password for SodtAP. The default value is < strong > 12345678< / strong > .< / span > < / dd >
< dt > < strong > Return value< / strong > < / dt >
< dd > < span class = "apidef" > true< / span > < span class = "apidesc" > Successfully configured.< / span > < / dd >
< dd > < span class = "apidef" > false< / span > < span class = "aidesc" > Configuration parameter is invalid, some values out of range.< / span > < / dd >
< / dl > < / p >
< h3 id = "enablemenu" > < i class = "fa fa-caret-right" > < / i > enableMenu< a class = "headerlink" href = "#enablemenu" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > enableMenu(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > uint16_t< / span > < span style = "color: #f8f8f2" > items)< / span >
< / code > < / pre > < / div >
< dl >
< dt > Enable the < a href = "menu.html" > AutoConnect menu< / a > items specified by the items parameter with logical OR value using < strong > AC_MENUITEM_t< / strong > constant.< / dt >
< dt > < dl class = "apidl" > < / dt >
< dt > < dt > < strong > Parameter< / strong > < / dt > < / dt >
< dt > < dd > < span class = "apidef" > items< / span > < span class = "apidesc" > Specify the combined value of < strong > AC_MENUITEM_t< / strong > of the items applying to the AutoConnect menu. It provides the value calculated from the < strong > logical OR< / strong > by the AC_MENUITEM_t value of each item applied as a menu. AC_MENUITEM_t is enumeration type to identify each menu item and it has the below values.< / span > < / dd > < / dt >
< dd >
< ul >
< li > < strong > AC_MENUITEM_CONFIGNEW< / strong > :
< a href = "menu.html#configure-new-ap" > Configure new AP< / a > < / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_MENUITEM_OPENSSIDS< / strong > :
< a href = "menu.html#open-ssids" > Open SSIDs< / a > < / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_MENUITEM_DISCONNECT< / strong > :
< a href = "menu.html#disconnect" > Disconnect< / a > < / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_MENUITEM_RESET< / strong > :
< a href = "menu.html#reset" > Reset...< / a > < / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_MENUITEM_HOME< / strong > :
< a href = "menu.html#home" > HOME< / a > < / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_MENUITEM_DEVINFO< / strong > :
< a href = "menu.html#where-the-from" > Device statistics< / a > as AutoConnect root page< / li >
< / ul >
< / dd >
< / dl >
< / dl >
< div class = "admonition note" >
< p class = "admonition-title" > It is added, not replaced.< / p >
< p > The initial configuration of the AutoConnect menu items:< br / >
< code > AC_MENUITEM_CONFIGNEW | AC_MENUITEM_OPENSSIDS | AC_MENUITEM_DISCONNECT | AC_MENUITEM_RESET | AC_MENUITEM_HOME< / code > < br / >
The enableMenu function adds an indication of the specified items to the current. Therefore, use the < a href = "#disableMenu" > disableMenu< / a > to remove the specified item from the initial menu.< / p >
< / div >
< h3 id = "end" > < i class = "fa fa-caret-right" > < / i > end< a class = "headerlink" href = "#end" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > end(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
< p > Stops AutoConnect captive portal service. Release ESP8266WebServer/WebServer and DNSServer. < / p >
< div class = "admonition warning" >
< p class = "admonition-title" > Attention to end< / p >
< p > The end function releases the instance of ESP8266WebServer/WebServer and DNSServer. It can not process them after the end function.< / p >
< / div >
< h3 id = "disablemenu" > < i class = "fa fa-caret-right" > < / i > disableMenu< a class = "headerlink" href = "#disablemenu" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > disableMenu(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #66d9ef" > uint16_t< / span > < span style = "color: #f8f8f2" > items)< / span >
< / code > < / pre > < / div >
< p > Disable the < a href = "menu.html" > AutoConnect menu< / a > items specified by the items parameter with logical OR value using < strong > AC_MENUITEM_t< / strong > constant.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > items< / span > < span class = "apidesc" > Specify the combined value of < strong > AC_MENUITEM_t< / strong > of the items deleting from the AutoConnect menu. It provides the value calculated from the < strong > logical OR< / strong > by the AC_MENUITEM_t value of each item. Refer to the < a href = "#enablemenu" > enableMenu< / a > about AC_MENUITEM_t.< / span > < / dd >
< / dl > < / p >
< h3 id = "handleclient" > < i class = "fa fa-caret-right" > < / i > handleClient< a class = "headerlink" href = "#handleclient" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > handleClient(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
< p > Process the AutoConnect menu interface. The handleClient() function of the ESP8266WebServer/WebServer hosted by AutoConnect is also called from within AutoConnect, and the client request handlers contained in the user sketch are also handled.< / p >
< h3 id = "handlerequest" > < i class = "fa fa-caret-right" > < / i > handleRequest< a class = "headerlink" href = "#handlerequest" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > handleRequest(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
< p > Handling for the AutoConnect menu request.< / p >
< div class = "admonition warning" >
< p class = "admonition-title" > About used in combination with handleClient< / p >
< p > The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266WebServer::handleClient or WebServer::handleClient.< / p >
< / div >
< h3 id = "home" > < i class = "fa fa-caret-right" > < / i > home< a class = "headerlink" href = "#home" title = "Permanent link" > ¶ < / a > < / h3 >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > home(String< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > uri)< / span >
< / code > < / pre > < / div >
< p > Put a user site's home URI. The URI specified by home is linked from "HOME" in the AutoConnect menu.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > uri< / span > < span class = "aidesc" > A URI string of user site's home path.< / span > < / dd >
< / dl > < / p >
< h3 id = "host" > < i class = "fa fa-caret-right" > < / i > host< a class = "headerlink" href = "#host" title = "Permanent link" > ¶ < / a > < / h3 >
< ul >
< li > For ESP8266< / li >
< / ul >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > ESP8266WebServer< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > host(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
< ul >
< li > For ESP32< / li >
< / ul >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > WebServer< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > host(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
< p > Returns the reference of the ESP8266WebServer/WebServer which is allocated in AutoConnect automatically.
< dl class = "apidl" >
< dt > < strong > Return value< / strong > < / dt >
< dd > A reference of the ESP8266WebServer/WebServer.< / dd >
< / dl > < / p >
< div class = "admonition note" >
< p class = "admonition-title" > & reference is not a pointer< / p >
< p > A reference cannot be re-assigned, and must be assigned at initialization. It's like as bind as alias. < br / >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > ESP8266WebServer< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > server< / span > < span style = "color: #f92672" > =< / span > < span style = "color: #f8f8f2" > portal.host();< / span >
< span style = "color: #f8f8f2" > server.handleClient();< / span >
< / code > < / pre > < / div >
or< br / >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > portal.host().handleClient();< / span >
< / code > < / pre > < / div > < / p >
< / div >
< h3 id = "join" > < i class = "fa fa-caret-right" > < / i > join< a class = "headerlink" href = "#join" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > join(AutoConnectAux< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > join(std< / span > < span style = "color: #f92672" > ::< / span > < span style = "color: #f8f8f2" > vector< / span > < span style = "color: #f92672" > < < / span > < span style = "color: #f8f8f2" > std< / span > < span style = "color: #f92672" > ::< / span > < span style = "color: #f8f8f2" > reference_wrapper< / span > < span style = "color: #f92672" > < < / span > < span style = "color: #f8f8f2" > AutoConnectAux< / span > < span style = "color: #f92672" > > > < / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
Join the AutoConnectAux object to AutoConnect. AutoConnectAux objects can be joined one by one, or joined altogether. The AutoConnectAux object joined by the join function can be handled from the AutoConnect menu.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > aux< / span > < span class = "apidesc" > Reference to AutoConnectAux. It can be std::vector of std::reference_wrapper of AutoConnectAux with < a href = "https://en.cppreference.com/w/cpp/language/list_initialization" > list initialization< / a > .< / span > < / dd >
< / dl > < / p >
< h3 id = "load" > < i class = "fa fa-caret-right" > < / i > load< a class = "headerlink" href = "#load" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > load(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #f8f8f2" > String< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > load(PGM_P< / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > load(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #f8f8f2" > __FlashStringHelper< / span > < span style = "color: #f92672" > *< / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > load(Stream< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > aux)< / span >
< / code > < / pre > < / div >
Load JSON document of AutoConnectAux which contains AutoConnectElements. If there is a syntax error in the JSON document, false is returned.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > aux< / span > < span class = "apidesc" > The input string to be loaded.< / span > < / dd >
< dt > < strong > Return value< / strong > < / dt >
< dd > < span class = "apidef" > true< / span > < span class = "apidesc" > The JSON document as AutoConnectAux successfully loaded.< / span > < / dd >
< dd > < span class = "apidef" > false< / span > < span class = "apidesc" > Loading JSON document unsuccessful, probably syntax errors have occurred or insufficient memory. You can diagnose the cause of loading failure using the < a href = "https://arduinojson.org/v5/assistant/" > ArduinoJson Assistant< / a > .< / span > < / dd >
< / dl > < / p >
< h3 id = "on" > < i class = "fa fa-caret-right" > < / i > on< a class = "headerlink" href = "#on" title = "Permanent link" > ¶ < / a > < / h3 >
< dl >
< dt > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > on(< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #f8f8f2" > String< / span > < span style = "color: #f92672" > & < / span > < span style = "color: #f8f8f2" > uri,< / span > < span style = "color: #66d9ef" > const< / span > < span style = "color: #f8f8f2" > AuxHandlerFunctionT< / span > < span style = "color: #f8f8f2" > handler,< / span > < span style = "color: #f8f8f2" > AutoConnectExitOrder_t< / span > < span style = "color: #f8f8f2" > order< / span > < span style = "color: #f92672" > =< / span > < span style = "color: #f8f8f2" > AC_EXIT_AHEAD)< / span >
< / code > < / pre > < / div > < / dt >
< dt > Register the handler function of the AutoConnectAux.< / dt >
< dt > < dl class = "apidl" > < / dt >
< dt > < dt > < strong > Parameters< / strong > < / dt > < / dt >
< dt > < dd > < span class = "apidef" > uri< / span > < span class = "apidesc" > A string of the URI assigned to the AutoConnectAux page.< / span > < / dd > < / dt >
< dt > < dd > < span class = "apidef" > handler< / span > < span class = "apidesc" > A function that behaves when a request to the AutoConnectAux page occurs. AuxHandlerFunctionT type is defined by the following declaration.< p class = "" apidesc " > < code > String handler(AutoConnectAux& , PageArgument& )< / code > < / p > < / span > < / dd > < / dt >
< dt > < dd > < span class = "apidef" > order< / span > < span class = "apidesc" > Specifies when the handler is called with the following enumeration value.< / span > < / dd > < / dt >
< dd >
< ul >
< li > < strong > AC_EXIT_AHEAD< / strong > :
Called before AutoConnect generates the HTML of the page. You set the value of AutoConnectElements in the handler then its value will be displayed on the page.< / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_EXIT_LATER< / strong > :
Called after AutoConnect generates the HTML of the page. You can append to HTML generated by AutoConnect.< / li >
< / ul >
< / dd >
< dd >
< ul >
< li > < strong > AC_EXIT_BOTH< / strong > :
Called even before generating HTML and after generated.< / li >
< / ul >
< / dd >
< / dl >
< / dl >
< div class = "admonition caution" >
< p class = "admonition-title" > It is not ESP8266WebServer::on, not WebServer::on for ESP32.< / p >
< p > This function effects to AutoConnectAux only. However, it coexists with that of ESP8266WebServer::on or WebServer::on of ESP32. < / p >
< / div >
< h3 id = "ondetect" > < i class = "fa fa-caret-right" > < / i > onDetect< a class = "headerlink" href = "#ondetect" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > onDetect(DetectExit_ft< / span > < span style = "color: #f8f8f2" > fn)< / span >
< / code > < / pre > < / div >
Register the function which will call from AutoConnect at the start of the captive portal.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > fn< / span > < span class = "apidesc" > Function called at the captive portal start.< / span > < / dd > < / p >
< / dl >
< p > An < em > fn< / em > specifies the function called when the captive portal starts. Its prototype declaration is defined as "< em > DetectExit_ft< / em > ".< / p >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > typedef< / span > < span style = "color: #f8f8f2" > std< / span > < span style = "color: #f92672" > ::< / span > < span style = "color: #f8f8f2" > function< / span > < span style = "color: #f92672" > < < / span > < span style = "color: #66d9ef" > bool< / span > < span style = "color: #f8f8f2" > (IPAddress< / span > < span style = "color: #f8f8f2" > softapIP)< / span > < span style = "color: #f92672" > > < / span > < span style = "color: #f8f8f2" > DetectExit_ft< / span >
< / code > < / pre > < / div >
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > softapIP< / span > < span class = "apidesc" > An IP address of SoftAP for the captive portal.< / span > < / dd >
< dt > < strong > Return value< / strong > < / dt >
< dd > < span class = "apidef" > true< / span > < span class = "apidesc" > Continues captive portal handling.< / span > < / dd >
< dd > < span class = "apidef" > false< / span > < span class = "apidesc" > Cancel the captive portal. AutoConnect::begin function will return with a false.< / span > < / dd >
< / dl > < / p >
< h3 id = "onnotfound" > < i class = "fa fa-caret-right" > < / i > onNotFound< a class = "headerlink" href = "#onnotfound" title = "Permanent link" > ¶ < / a > < / h3 >
< ul >
< li > For ESP8266< / li >
< / ul >
< div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > onNotFound(ESP8266WebServer< / span > < span style = "color: #f92672" > ::< / span > < span style = "color: #f8f8f2" > THandlerFunction< / span > < span style = "color: #f8f8f2" > fn)< / span >
< / code > < / pre > < / div >
< ul >
< li > For ESP32< / li >
< / ul >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > onNotFound(WebServer< / span > < span style = "color: #f92672" > ::< / span > < span style = "color: #f8f8f2" > THandlerFunction< / span > < span style = "color: #f8f8f2" > fn)< / span >
< / code > < / pre > < / div >
Register the handler function for undefined URL request detected.
< dl class = "apidl" >
< dt > < strong > Parameter< / strong > < / dt >
< dd > < span class = "apidef" > fn< / span > < span class = "apidesc" > A function of the "not found" handler.< / span > < / dd >
< / dl > < / p >
< h3 id = "where" > < i class = "fa fa-caret-right" > < / i > where< a class = "headerlink" href = "#where" title = "Permanent link" > ¶ < / a > < / h3 >
< p > < div class = "codehilite" style = "background: #272822" > < pre style = "line-height: 125%" > < span > < / span > < code > < span style = "color: #f8f8f2" > String< / span > < span style = "color: #f8f8f2" > where(< / span > < span style = "color: #66d9ef" > void< / span > < span style = "color: #f8f8f2" > )< / span >
< / code > < / pre > < / div >
Returns an uri string of the AutoConnectAux uri object of the custom Web page that caused the request to the page.< br >
AutoConnect identifies the URI (ie. the referrer URI) that caused the request each time from the client occurs and will save the URI If the request source is a custom Web page of AutoConnectAux. The < strong > where< / strong > function returns a pointer of AutoConnectAux which is a URI of a least recent request from the custom Web page.< br >
This function is provided to access the fields (ie. the AutoConnectElements) with a custom Web page handler of a page and is available only for request source that is the custom Web pages. It is invalid for HTTP requests from individual pages registered with the < strong > on< / strong > handler of ESP8266WebServer/WebServer for ESP32. In other words, this function only returns the AutoConnecAux page which is a least recently displayed.
< dl class = "apidl" >
< dt > < strong > Return value< / strong > < / dt >
< dd > An uri string of the AutoConnectAux that caused the request the page.< / dd >
< / dl > < / p >
< p > The < strong > where< / strong > function usage is described in the section < a href = "achandling.html#where-to-pick-up-the-values" > < em > Where to pick up the values< / em > < / a > .< / p >
< / article >
< / div >
< / div >
< / main >
< footer class = "md-footer" >
< div class = "md-footer-nav" >
< nav class = "md-footer-nav__inner md-grid" >
< a href = "otaserver.html" title = "Using Update Server" class = "md-flex md-footer-nav__link md-footer-nav__link--prev" rel = "prev" >
< div class = "md-flex__cell md-flex__cell--shrink" >
< i class = "md-icon md-icon--arrow-back md-footer-nav__button" > < / i >
< / div >
< div class = "md-flex__cell md-flex__cell--stretch md-footer-nav__title" >
< span class = "md-flex__ellipsis" >
< span class = "md-footer-nav__direction" >
Previous
< / span >
Using Update Server
< / span >
< / div >
< / a >
< a href = "apiaux.html" title = "AutoConnectAux API" class = "md-flex md-footer-nav__link md-footer-nav__link--next" rel = "next" >
< div class = "md-flex__cell md-flex__cell--stretch md-footer-nav__title" >
< span class = "md-flex__ellipsis" >
< span class = "md-footer-nav__direction" >
Next
< / span >
AutoConnectAux API
< / span >
< / div >
< div class = "md-flex__cell md-flex__cell--shrink" >
< i class = "md-icon md-icon--arrow-forward md-footer-nav__button" > < / i >
< / div >
< / a >
< / nav >
< / div >
< div class = "md-footer-meta md-typeset" >
< div class = "md-footer-meta__inner md-grid" >
< div class = "md-footer-copyright" >
< div class = "md-footer-copyright__highlight" >
Copyright © 2018-2020 Hieromon Ikasamo
< / div >
powered by
< a href = "https://www.mkdocs.org" target = "_blank" rel = "noopener" > MkDocs< / a >
and
< a href = "https://squidfunk.github.io/mkdocs-material/" target = "_blank" rel = "noopener" >
Material for MkDocs< / a >
< / div >
< div class = "md-footer-social" >
< link rel = "stylesheet" href = "assets/fonts/font-awesome.css" >
< a href = "https://github.com/Hieromon" target = "_blank" rel = "noopener" title = "github" class = "md-footer-social__link fa fa-github" > < / a >
< a href = "https://twitter.com/hieromon" target = "_blank" rel = "noopener" title = "twitter" class = "md-footer-social__link fa fa-twitter" > < / a >
< / div >
< / div >
< / div >
< / footer >
< / div >
< script src = "assets/javascripts/application.c33a9706.js" > < / script >
< script > app . initialize ( { version : "1.1" , url : { base : "." } } ) < / script >
< script src = "js/gifffer.min.js" > < / script >
< / body >
< / html >