Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/AutoConnect/commit/cb2a8f4972bda5cdf1db87412a40ec2ba652399a?style=split&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
15 additions and
4 deletions
examples/Credential/Credential.ino
examples/CreditMigrate/CreditMigrate.ino
src/AutoConnectCredential.h
@ -103,7 +103,7 @@ PageBuilder delPage("/del", { elmDel });
// with the <li> tag.
// with the <li> tag.
String viewCredential ( PageArgument & args ) {
String viewCredential ( PageArgument & args ) {
AutoConnectCredential ac ( CREDENTIAL_OFFSET ) ;
AutoConnectCredential ac ( CREDENTIAL_OFFSET ) ;
struct station_config entry ;
station_config_t entry ;
String content = " " ;
String content = " " ;
uint8_t count = ac . entries ( ) ; // Get number of entries.
uint8_t count = ac . entries ( ) ; // Get number of entries.
@ -75,7 +75,7 @@ void convert(const uint8_t* eeprom, const size_t size) {
break ;
break ;
// Obtain each entry and store to Preferences
// Obtain each entry and store to Preferences
struct station_config config ;
station_config_t config ;
Serial . printf ( " [%d] " , ec ) ;
Serial . printf ( " [%d] " , ec ) ;
uint8_t ei = 0 ;
uint8_t ei = 0 ;
do {
do {
@ -91,6 +91,17 @@ void convert(const uint8_t* eeprom, const size_t size) {
config . bssid [ ei ] = * dp + + ;
config . bssid [ ei ] = * dp + + ;
Serial . printf ( " :%02x " , config . bssid [ ei ] ) ;
Serial . printf ( " :%02x " , config . bssid [ ei ] ) ;
}
}
config . dhcp = * dp + + ;
if ( config . dhcp = = STA_STATIC ) {
for ( uint8_t e = 0 ; e < sizeof ( station_config_t : : _config : : addr ) / sizeof ( uint32_t ) ; e + + ) {
uint32_t * ip = & config . config . addr [ e ] ;
* ip = 0 ;
for ( uint8_t b = 0 ; b < sizeof ( uint32_t ) ; b + + ) {
* ip < < = 8 ;
* ip + = * dp + + ;
}
}
}
bool rc = credential . save ( & config ) ;
bool rc = credential . save ( & config ) ;
Serial . println ( rc ? " transferred " : " failed to save Preferences " ) ;
Serial . println ( rc ? " transferred " : " failed to save Preferences " ) ;
}
}
@ -53,7 +53,7 @@ extern "C" {
# endif
# endif
typedef enum {
typedef enum {
STA_DHCP ,
STA_DHCP = 0 ,
STA_STATIC
STA_STATIC
} station_config_dhcp ;
} station_config_dhcp ;
@ -61,7 +61,7 @@ typedef struct {
uint8_t ssid [ 32 ] ;
uint8_t ssid [ 32 ] ;
uint8_t password [ 64 ] ;
uint8_t password [ 64 ] ;
uint8_t bssid [ 6 ] ;
uint8_t bssid [ 6 ] ;
uint8_t dhcp ; /**< 1:DHCP, 2 :Static IP */
uint8_t dhcp ; /**< 0:DHCP, 1 :Static IP */
union _config {
union _config {
uint32_t addr [ 5 ] ;
uint32_t addr [ 5 ] ;
struct _sta {
struct _sta {