From 017998f437996c6288ccaa54526e43abb5225ee7 Mon Sep 17 00:00:00 2001 From: Cossid Date: Sat, 18 Nov 2023 18:50:49 -0600 Subject: [PATCH] Move all _CFG setting to begin() --- cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp index 952d60d84..e040d1285 100644 --- a/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp @@ -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); @@ -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); }