@@ -20701,10 +20701,8 @@ static bool mg_tcpip_driver_cyw_init(struct mg_tcpip_if *ifp) {
20701
20701
if (!cyw_init(ifp->mac)) return false;
20702
20702
20703
20703
if (wifi->apmode) {
20704
- MG_DEBUG(("Starting AP '%s' (%u)", wifi->apssid, wifi->apchannel));
20705
20704
return mg_wifi_ap_start(wifi);
20706
20705
} else if (wifi->ssid != NULL && wifi->pass != NULL) {
20707
- MG_DEBUG(("Connecting to '%s'", wifi->ssid));
20708
20706
return mg_wifi_connect(wifi);
20709
20707
}
20710
20708
return true;
@@ -22052,7 +22050,7 @@ bool mg_wifi_connect(struct mg_wifi_data *wifi) {
22052
22050
s_ifp->mask = s_mask;
22053
22051
if (s_ifp->ip == 0) s_ifp->enable_dhcp_client = true;
22054
22052
s_ifp->enable_dhcp_server = false;
22055
- MG_DEBUG(("Connecting to %s ", wifi->ssid));
22053
+ MG_DEBUG(("Connecting to '%s' ", wifi->ssid));
22056
22054
return cyw_wifi_connect(wifi->ssid, wifi->pass);
22057
22055
}
22058
22056
@@ -22061,6 +22059,7 @@ bool mg_wifi_disconnect(void) {
22061
22059
}
22062
22060
22063
22061
bool mg_wifi_ap_start(struct mg_wifi_data *wifi) {
22062
+ MG_DEBUG(("Starting AP '%s' (%u)", wifi->apssid, wifi->apchannel));
22064
22063
return cyw_wifi_ap_start(wifi->apssid, wifi->appass, wifi->apchannel);
22065
22064
}
22066
22065
@@ -22485,14 +22484,12 @@ static bool mg_tcpip_driver_pico_w_init(struct mg_tcpip_if *ifp) {
22485
22484
if (cyw43_arch_init() != 0)
22486
22485
return false; // initialize async_context and WiFi chip
22487
22486
if (wifi->apmode && wifi->apssid != NULL) {
22488
- MG_DEBUG(("Starting AP '%s' (%u)", wifi->apssid, wifi->apchannel));
22489
22487
if (!mg_wifi_ap_start(wifi)) return false;
22490
22488
cyw43_wifi_get_mac(&cyw43_state, CYW43_ITF_STA, ifp->mac); // same MAC
22491
22489
} else {
22492
22490
cyw43_arch_enable_sta_mode();
22493
22491
cyw43_wifi_get_mac(&cyw43_state, CYW43_ITF_STA, ifp->mac);
22494
22492
if (wifi->ssid != NULL) {
22495
- MG_DEBUG(("Connecting to '%s'", wifi->ssid));
22496
22493
return mg_wifi_connect(wifi);
22497
22494
} else {
22498
22495
cyw43_arch_disable_sta_mode();
@@ -22609,7 +22606,7 @@ bool mg_wifi_connect(struct mg_wifi_data *wifi) {
22609
22606
if (s_ifp->ip == 0) s_ifp->enable_dhcp_client = true;
22610
22607
s_ifp->enable_dhcp_server = false;
22611
22608
cyw43_arch_enable_sta_mode();
22612
- MG_DEBUG(("Connecting to %s ", wifi->ssid));
22609
+ MG_DEBUG(("Connecting to '%s' ", wifi->ssid));
22613
22610
int res = cyw43_arch_wifi_connect_async(wifi->ssid, wifi->pass,
22614
22611
CYW43_AUTH_WPA2_AES_PSK);
22615
22612
MG_VERBOSE(("res: %d", res));
@@ -22624,6 +22621,7 @@ bool mg_wifi_disconnect(void) {
22624
22621
}
22625
22622
22626
22623
bool mg_wifi_ap_start(struct mg_wifi_data *wifi) {
22624
+ MG_DEBUG(("Starting AP '%s' (%u)", wifi->apssid, wifi->apchannel));
22627
22625
cyw43_wifi_ap_set_channel(&cyw43_state, wifi->apchannel);
22628
22626
cyw43_arch_enable_ap_mode(wifi->apssid, wifi->appass,
22629
22627
CYW43_AUTH_WPA2_AES_PSK);
0 commit comments