******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.69>
******************************************************************************
EXCEPTION error.
wifi already connected or established
0: WifiServiceProvider.scan /home/runner/work/toit/toit/system/extensions/esp32/wifi.toit:145:7
1: WifiServiceProvider.handle /home/runner/work/toit/toit/system/extensions/esp32/wifi.toit:63:14
2: ServiceManager_.<lambda> <sdk>/system/services.toit:640:15
3: RpcRequest_.process.<block> <sdk>/rpc/broker.toit:98:26
4: RpcRequest_.process <sdk>/rpc/broker.toit:95:3
5: RpcRequestQueue_.ensure_processing_task_.<lambda>.<block>.<block> <sdk>/rpc/broker.toit:214:20
6: RpcRequestQueue_.ensure_processing_task_.<lambda>.<block> <sdk>/rpc/broker.toit:209:9
7: RpcRequestQueue_.ensure_processing_task_.<lambda> <sdk>/rpc/broker.toit:204:85
******************************************************************************
scan config/Map -> List:
if state_.module:
throw "wifi already connected or established"
module := WifiModule.sta this "" ""
try:
channels := config.get wifi.CONFIG_SCAN_CHANNELS
passive := config.get wifi.CONFIG_SCAN_PASSIVE
period := config.get wifi.CONFIG_SCAN_PERIOD
return module.scan channels passive period
finally:
module.disconnect
esp_wifi_set_mode
wifi_esp32.cc
esp_wifi_set_mode(WIFI_MODE_XXX)
esp_wifi_set_mode(WIFI_MODE_APSTA)
set_mode
esp_netif_new
init
ESP_NETIF_DEFAULT_WIFI_AP
ESP_NETIF_DEFAULT_WIFI_STA
ESP_NETIF_DEFAULT_WIFI_APSTA
esp_wifi_set_mode
set_mode
/**
* @brief Start WiFi according to current configuration
* If mode is WIFI_MODE_STA, it create station control block and start station
* If mode is WIFI_MODE_AP, it create soft-AP control block and start soft-AP
* If mode is WIFI_MODE_APSTA, it create soft-AP and station control block and start soft-AP and station
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_NO_MEM: out of memory
* - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong
* - ESP_FAIL: other WiFi internal errors
*/
esp_err_t esp_wifi_start(void);
third_party/esp-idf/components/esp_wifi/include/esp_wifi.h