fix(wifi): Disconnect station in wps_start instead of wps_enable

Modifies changes from 4cc09f2436
This commit is contained in:
Sarvesh Bodakhe
2025-07-02 14:32:51 +05:30
parent a16d45cee9
commit b33aa5384a

View File

@@ -1457,7 +1457,6 @@ static int wifi_station_wps_init(const esp_wps_config_t *config)
} }
sm = gWpsSm; sm = gWpsSm;
esp_wifi_disconnect();
esp_wifi_get_macaddr_internal(WIFI_IF_STA, sm->ownaddr); esp_wifi_get_macaddr_internal(WIFI_IF_STA, sm->ownaddr);
os_memcpy(gWpaSm.own_addr, sm->ownaddr, ETH_ALEN); os_memcpy(gWpaSm.own_addr, sm->ownaddr, ETH_ALEN);
@@ -1733,6 +1732,7 @@ int wifi_station_wps_start(void)
sm->wps->wps->dh_pubkey = sm->wps->dh_pubkey_e; sm->wps->wps->dh_pubkey = sm->wps->dh_pubkey_e;
sm->wps->wps->rf_band_cb = wps_rf_band_cb; sm->wps->wps->rf_band_cb = wps_rf_band_cb;
sm->wps->dh_privkey = NULL; sm->wps->dh_privkey = NULL;
esp_wifi_disconnect();
wifi_wps_scan(NULL, NULL); wifi_wps_scan(NULL, NULL);
break; break;
case WPS_STATUS_SCANNING: case WPS_STATUS_SCANNING: