Skip to content

Commit 3b7fecc

Browse files
committed
picow: Implement stop_station
Weirdly we have to stop the AP too (which we never started), or cyw43_tcpip_link_status still reports that STA is connected. As long as AP mode isn't implemented, this doesn't matter and we can just do it.
1 parent 508c80d commit 3b7fecc

File tree

1 file changed

+7
-0
lines changed
  • ports/raspberrypi/common-hal/wifi

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self) {
158158
}
159159

160160
void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) {
161+
cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA);
162+
// This is wrong, but without this call the state of ITF_STA is still
163+
// reported as CYW43_LINK_JOIN (by wifi_link_status) and CYW43_LINK_UP
164+
// (by tcpip_link_status). Until AP support is added, we can ignore the
165+
// problem.
166+
cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP);
167+
bindings_cyw43_wifi_enforce_pm();
161168
}
162169

163170
void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) {

0 commit comments

Comments
 (0)