Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/AutoConnect/commit/f04ac4ba2cd7524ac644e6b34b1e3a4359d4956e?style=unified&whitespace=ignore-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
32 additions and
5 deletions
src/AutoConnectCredential.cpp
src/AutoConnectCredential.h
@ -2,8 +2,8 @@
* AutoConnectCredential class dispatcher .
* @ file AutoConnectCredential . cpp
* @ author hieromon @ gmail . com
* @ version 1.0 .0
* @ date 2019 - 08 - 15
* @ version 1.0 .2
* @ date 2019 - 09 - 16
* @ copyright MIT license .
*/
@ -520,7 +520,7 @@ bool AutoConnectCredential::_del(const char* ssid, const bool commit) {
uint8_t AutoConnectCredential : : _import ( void ) {
uint8_t cn = 0 ;
if ( _pref - > begin ( AC_CREDENTIAL_NVSNAME , true ) ) {
size_t psz = _pref - > getBytesLength ( AC_CREDENTIAL_NVSKEY ) ;
size_t psz = AutoConnectUtil : : getPrefBytesLength < Preferences > ( _pref . get ( ) , AC_CREDENTIAL_NVSKEY ) ;
if ( psz ) {
uint8_t * credtPool = ( uint8_t * ) malloc ( psz ) ;
if ( credtPool ) {
@ -2,8 +2,8 @@
* Declaration of AutoConnectCredential class .
* @ file AutoConnectCredential . h
* @ author hieromon @ gmail . com
* @ version 1.0 .0
* @ date 2019 - 08 - 15
* @ version 1.0 .2
* @ date 2019 - 09 - 16
* @ copyright MIT license .
*/
@ -40,6 +40,7 @@ uint8_t bssid[6];
wifi_fast_scan_threshold_t threshold ;
} ;
# endif
# include "AutoConnectDefs.h"
/**
* Credential storage area offset specifier in EEPROM .
@ -105,12 +106,38 @@ class AutoConnectCredential : public AutoConnectCredentialBase {
# else
// #pragma message "AutoConnectCredential applies the Preferences"
# include <type_traits>
# include <map>
# include <Preferences.h>
# include <nvs.h>
# define AC_CREDENTIAL_NVSNAME AC_IDENTIFIER
# define AC_CREDENTIAL_NVSKEY AC_CREDENTIAL_NVSNAME
namespace AutoConnectUtil {
AC_HAS_FUNC ( getBytesLength ) ;
template < typename T >
typename std : : enable_if < AutoConnectUtil : : has_func_getBytesLength < T > : : value , size_t > : : type getPrefBytesLength ( T * pref , const char * key ) {
return pref - > getBytesLength ( key ) ;
}
template < typename T >
typename std : : enable_if < ! AutoConnectUtil : : has_func_getBytesLength < T > : : value , size_t > : : type getPrefBytesLength ( T * pref , const char * key ) {
AC_UNUSED ( pref ) ;
uint32_t handle ;
size_t len ;
esp_err_t err = nvs_open ( AC_CREDENTIAL_NVSNAME , NVS_READONLY , & handle ) ;
if ( err )
len = 0 ;
else {
( void ) nvs_get_blob ( handle , key , NULL , & len ) ;
nvs_close ( handle ) ;
}
return len ;
}
}
/** AutoConnectCredential class using Preferences for ESP32 */
class AutoConnectCredential : public AutoConnectCredentialBase {
public :