File tree Expand file tree Collapse file tree 1 file changed +7
-24
lines changed
ports/raspberrypi/common-hal/wifi Expand file tree Collapse file tree 1 file changed +7
-24
lines changed Original file line number Diff line number Diff line change @@ -187,40 +187,23 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
187
187
break ;
188
188
}
189
189
190
- int result = cyw43_wifi_link_status (& cyw43_state , CYW43_ITF_STA );
190
+ int result = cyw43_tcpip_link_status (& cyw43_state , CYW43_ITF_STA );
191
191
192
- // While the async connection is running, it will return CYW43_LINK_JOIN.
193
-
194
- int done = 0 ;
195
192
switch (result ) {
196
193
case CYW43_LINK_UP :
197
- done = 1 ;
198
- break ;
199
- case ( unsigned int ) CYW43_LINK_FAIL :
194
+ bindings_cyw43_wifi_enforce_pm () ;
195
+ return WIFI_RADIO_ERROR_NONE ;
196
+ case CYW43_LINK_FAIL :
200
197
return WIFI_RADIO_ERROR_CONNECTION_FAIL ;
201
- case ( unsigned int ) CYW43_LINK_NONET :
198
+ case CYW43_LINK_NONET :
202
199
return WIFI_RADIO_ERROR_NO_AP_FOUND ;
203
- case ( unsigned int ) CYW43_LINK_BADAUTH :
200
+ case CYW43_LINK_BADAUTH :
204
201
return WIFI_RADIO_ERROR_AUTH_FAIL ;
205
202
}
206
-
207
- if (done == 1 ) {
208
- break ;
209
- }
210
203
}
211
204
212
205
// Being here means we either timed out or got interrupted.
213
- int result = cyw43_wifi_link_status (& cyw43_state , CYW43_ITF_STA );
214
- switch (result ) {
215
- case CYW43_LINK_UP :
216
- case CYW43_LINK_JOIN :
217
- // If CYW43_LINK_JOIN wasn't here, it wouldn't work even though we have ip.
218
- bindings_cyw43_wifi_enforce_pm ();
219
- return WIFI_RADIO_ERROR_NONE ;
220
-
221
- default :
222
- return WIFI_RADIO_ERROR_UNSPECIFIED ;
223
- }
206
+ return WIFI_RADIO_ERROR_UNSPECIFIED ;
224
207
}
225
208
226
209
mp_obj_t common_hal_wifi_radio_get_ap_info (wifi_radio_obj_t * self ) {
You can’t perform that action at this time.
0 commit comments