Skip to content

Commit f75bb5c

Browse files
committed
Rename to match WIFI_REASON. Also return specific reason code.
1 parent e519dd3 commit f75bb5c

File tree

1 file changed

+2
-2
lines changed
  • ports/esp32s2/common-hal/wifi

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
168168
} while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted());
169169
if ((bits & WIFI_DISCONNECTED_BIT) != 0) {
170170
if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) {
171-
return WIFI_RADIO_ERROR_AUTH;
171+
return WIFI_RADIO_ERROR_AUTH_FAIL;
172172
} else if (self->last_disconnect_reason == WIFI_REASON_NO_AP_FOUND) {
173173
return WIFI_RADIO_ERROR_NO_AP_FOUND;
174174
}
175-
return WIFI_RADIO_ERROR_UNKNOWN;
175+
return self->last_disconnect_reason;
176176
}
177177
return WIFI_RADIO_ERROR_NONE;
178178
}

0 commit comments

Comments
 (0)