summaryrefslogtreecommitdiff
path: root/ports/esp32s2
diff options
context:
space:
mode:
authoranecdata <16617689+anecdata@users.noreply.github.com>2021-01-13 23:46:35 -0600
committeranecdata <16617689+anecdata@users.noreply.github.com>2021-01-13 23:46:35 -0600
commitf75bb5c50f3fac1d12c058abfc3446345d97f013 (patch)
tree0c28c821948440926cdf2feac15d735cf3f8e0fc /ports/esp32s2
parente519dd3c5269745f4d6c66a012974e622bc08343 (diff)
Rename to match WIFI_REASON. Also return specific reason code.
Diffstat (limited to 'ports/esp32s2')
-rw-r--r--ports/esp32s2/common-hal/wifi/Radio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c
index e9f374a06..930230088 100644
--- a/ports/esp32s2/common-hal/wifi/Radio.c
+++ b/ports/esp32s2/common-hal/wifi/Radio.c
@@ -168,11 +168,11 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
} while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted());
if ((bits & WIFI_DISCONNECTED_BIT) != 0) {
if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) {
- return WIFI_RADIO_ERROR_AUTH;
+ return WIFI_RADIO_ERROR_AUTH_FAIL;
} else if (self->last_disconnect_reason == WIFI_REASON_NO_AP_FOUND) {
return WIFI_RADIO_ERROR_NO_AP_FOUND;
}
- return WIFI_RADIO_ERROR_UNKNOWN;
+ return self->last_disconnect_reason;
}
return WIFI_RADIO_ERROR_NONE;
}