After that, I would expect calling wifi_station_disconnect would make wifi_station_get_connect_status return 0, but looks like this is not the case:
AT+CWMODE?
+CWMODE:3
AT+CWSTAT?
+CWSTAT:3
AT+CWQAP
OK
AT+CWSTAT?
+CWSTAT:3
Apparently wifi_station_disconnect disconnects the ip interface leaving the device associated with an AP, as hinted by "wifi disconnect the station interface connected routing" description of this function in the google-translated SDK docs.
The only way to return connect status to 0 that I found is to call wifi_station_set_config with an empty SSID and password and to restart the module. This works, but I would like to avoid restarting the module.
Has anyone experienced this and found a way to work around this issue?