Skip to content

Commit 1151d1b

Browse files
authored
Merge pull request micropython#8590 from eightycc/8138
Implement wifi.stop_ap for RP2
2 parents a5bd4b2 + 1451d77 commit 1151d1b

File tree

1 file changed

+5
-11
lines changed
  • ports/raspberrypi/common-hal/wifi

1 file changed

+5
-11
lines changed

ports/raspberrypi/common-hal/wifi/Radio.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,12 @@ void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) {
206206
}
207207

208208
if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_AP) != CYW43_LINK_DOWN) {
209-
mp_raise_NotImplementedError(translate("Stopping AP is not supported."));
209+
// Disassociate from WLAN
210+
cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP);
211+
// Stop AP
212+
cyw43_wifi_set_up(&cyw43_state, CYW43_ITF_AP, false, 0);
213+
bindings_cyw43_wifi_enforce_pm();
210214
}
211-
212-
/*
213-
* AP cannot be disconnected. cyw43_wifi_leave is broken.
214-
* This code snippet should work, but doesn't.
215-
*
216-
* cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP);
217-
* cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA);
218-
*
219-
* bindings_cyw43_wifi_enforce_pm();
220-
*/
221215
}
222216

223217
static bool connection_unchanged(wifi_radio_obj_t *self, const uint8_t *ssid, size_t ssid_len) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy