Merge pull request #134 from Hieromon/patches/v103

Patches/v103
pull/91/merge v1.0.3
Hieromon Ikasamo 5 years ago committed by GitHub
commit becd58ec63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      README.md
  2. 22
      docs/changelog.html
  3. 2
      docs/search/search_index.json
  4. 58
      docs/sitemap.xml
  5. BIN
      docs/sitemap.xml.gz
  6. 2
      library.json
  7. 2
      library.properties
  8. 3
      mkdocs/changelog.md
  9. 8
      src/AutoConnect.cpp
  10. 11
      src/AutoConnectCredential.cpp
  11. 1
      src/AutoConnectCredential.h

@ -101,6 +101,9 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
## Change log
### [1.0.3] Sept. 30, 2019
- Fixed a return of AutoConnectCredential::entries(). (issue #133)
### [1.0.2] Sept. 19, 2019
- Fixed compilation error that no member named 'success' with ArduinoJson 5. (issue #130)
- Fixed SSID non termination. (issue #128)

@ -122,7 +122,7 @@
<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="#102-sept-19-2019" tabindex="1" class="md-skip">
<a href="#103-sept-30-2019" tabindex="1" class="md-skip">
Skip to content
</a>
@ -725,6 +725,13 @@
<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="#103-sept-30-2019" title="[1.0.3] Sept. 30, 2019" class="md-nav__link">
[1.0.3] Sept. 30, 2019
</a>
</li>
<li class="md-nav__item">
<a href="#102-sept-19-2019" title="[1.0.2] Sept. 19, 2019" class="md-nav__link">
[1.0.2] Sept. 19, 2019
@ -871,6 +878,13 @@
<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="#103-sept-30-2019" title="[1.0.3] Sept. 30, 2019" class="md-nav__link">
[1.0.3] Sept. 30, 2019
</a>
</li>
<li class="md-nav__item">
<a href="#102-sept-19-2019" title="[1.0.2] Sept. 19, 2019" class="md-nav__link">
[1.0.2] Sept. 19, 2019
@ -995,7 +1009,11 @@
<h1>Change log</h1>
<h4 id="102-sept-19-2019">[1.0.2] Sept. 19, 2019<a class="headerlink" href="#102-sept-19-2019" title="Permanent link">&para;</a></h4>
<h4 id="103-sept-30-2019">[1.0.3] Sept. 30, 2019<a class="headerlink" href="#103-sept-30-2019" title="Permanent link">&para;</a></h4>
<ul>
<li>Fixed a return of AutoConnectCredential::entries().</li>
</ul>
<h4 id="102-sept-19-2019">[1.0.2] Sept. 19, 2019<a class="headerlink" href="#102-sept-19-2019" title="Permanent link">&para;</a></h4>
<ul>
<li>Fixed compilation error that no member named 'success' with ArduinoJson 5.</li>
<li>Fixed SSID non termination.</li>

File diff suppressed because one or more lines are too long

@ -2,147 +2,147 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://Hieromon.github.io/AutoConnect/index.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/gettingstarted.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/menu.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/basicusage.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/advancedusage.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acintro.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acelements.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acjson.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/achandling.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/otaupdate.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/otabrowser.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/otaserver.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/api.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiaux.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiconfig.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apielements.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiupdate.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiextra.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/howtoembed.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/datatips.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/menuize.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/wojson.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/lsbegin.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/credit.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acupload.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/colorized.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/faq.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/changelog.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/license.html</loc>
<lastmod>2019-09-18</lastmod>
<lastmod>2019-09-30</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -25,6 +25,6 @@
"espressif8266",
"espressif32"
],
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT"
}

@ -1,5 +1,5 @@
name=AutoConnect
version=1.0.2
version=1.0.3
author=Hieromon Ikasamo <hieromon@gmail.com>
maintainer=Hieromon Ikasamo <hieromon@gmail.com>
sentence=ESP8266/ESP32 WLAN configuration at runtime with web interface.

@ -1,3 +1,6 @@
#### [1.0.3] Sept. 30, 2019
- Fixed a return of AutoConnectCredential::entries().
#### [1.0.2] Sept. 19, 2019
- Fixed compilation error that no member named 'success' with ArduinoJson 5.
- Fixed SSID non termination.

@ -489,16 +489,16 @@ void AutoConnect::handleRequest(void) {
if (_apConfig.autoSave == AC_SAVECREDENTIAL_AUTO) {
AutoConnectCredential credit(_apConfig.boundaryOffset);
if (credit.save(&_credential))
AC_DBG("%*s credential saved\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
AC_DBG("%.*s credential saved\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
else
AC_DBG("credential %*s save failed\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
AC_DBG("credential %.*s save failed\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
}
// Ensures that keeps a connection with the current AP while the portal behaves.
_setReconnect(AC_RECONNECT_SET);
}
else
AC_DBG("%*s has no BSSID, saving is unavailable\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
AC_DBG("%.*s has no BSSID, saving is unavailable\n", sizeof(_credential.ssid), reinterpret_cast<const char*>(_credential.ssid));
// Activate AutoConnectUpdate if it is attached and incorporate
// it into the AutoConnect menu.
@ -742,7 +742,7 @@ String AutoConnect::_induceConnect(PageArgument& args) {
credential.load(args.arg(String(F(AUTOCONNECT_PARAMID_CRED))).c_str(), &entry);
strncpy(reinterpret_cast<char*>(_credential.ssid), reinterpret_cast<const char*>(entry.ssid), sizeof(_credential.ssid));
strncpy(reinterpret_cast<char*>(_credential.password), reinterpret_cast<const char*>(entry.password), sizeof(_credential.password));
AC_DBG("Credential loaded:%*s\n", sizeof(station_config::ssid), _credential.ssid);
AC_DBG("Credential loaded:%.*s\n", sizeof(station_config::ssid), _credential.ssid);
}
else {
AC_DBG("Queried SSID:%s\n", args.arg(AUTOCONNECT_PARAMID_SSID).c_str());

@ -344,6 +344,15 @@ inline bool AutoConnectCredential::del(const char* ssid) {
return _del(ssid, true);
}
/**
* Refresh the number of stored credential entries.
* @retval A number of entries.
*/
inline uint8_t AutoConnectCredential::entries(void) {
_entries = _credit.size();
return _entries;
}
/**
* Load the credential entry for the specified SSID from the internal
* dictionary. The credentials are stored to the station_config
@ -356,6 +365,7 @@ inline bool AutoConnectCredential::del(const char* ssid) {
int8_t AutoConnectCredential::load(const char* ssid, struct station_config* config) {
// Determine the number in entries
int8_t en = 0;
_entries = _import(); // Reload the saved credentials
for (decltype(_credit)::iterator it = _credit.begin(), e = _credit.end(); it != e; ++it) {
String key = it->first;
if (!strcmp(ssid, key.c_str())) {
@ -377,6 +387,7 @@ int8_t AutoConnectCredential::load(const char* ssid, struct station_config* conf
* false The number is not available.
*/
bool AutoConnectCredential::load(int8_t entry, struct station_config* config) {
_entries = _import();
for (decltype(_credit)::iterator it = _credit.begin(), e = _credit.end(); it != e; ++it) {
if (!entry--) {
_obtain(it, config);

@ -126,6 +126,7 @@ class AutoConnectCredential : public AutoConnectCredentialBase {
explicit AutoConnectCredential(uint16_t offset);
~AutoConnectCredential();
bool del(const char* ssid) override;
uint8_t entries(void) override;
int8_t load(const char* ssid, struct station_config* config) override;
bool load(int8_t entry, struct station_config* config) override;
bool save(const struct station_config* config) override;

Loading…
Cancel
Save