Skip to content

Commit

Permalink
Move all _CFG setting to begin()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cossid committed Nov 19, 2023
1 parent b1bbe47 commit 017998f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
}
STA_ADV_CFG.ap_info.channel = channel;
STA_ADV_CFG.wifi_retry_interval = 100;

// Unsure why, but this gets unset in advanced config if set during config(), but standard config survives
STA_ADV_CFG.dhcp_mode = STA_CFG.dhcp_mode;
} else {
strcpy(STA_CFG.wifi_ssid, ssid);
memset(STA_CFG.wifi_bssid, 0x00, 6);
Expand Down Expand Up @@ -95,8 +98,6 @@ bool WiFiClass::reconnect(const uint8_t *bssid) {

if (bssid) {
LT_IM(WIFI, "Connecting to " MACSTR, MAC2STR(bssid));
// Unsure why, but this gets unset in advanced config if set during config(), but standard config survives
STA_ADV_CFG.dhcp_mode = STA_CFG.dhcp_mode;
} else {
LT_IM(WIFI, "Connecting to %s", STA_CFG.wifi_ssid);
}
Expand Down

0 comments on commit 017998f

Please sign in to comment.