Rename to match WIFI_REASON. Also return specific reason code.
This commit is contained in:
parent
e519dd3c52
commit
f75bb5c50f
|
@ -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());
|
} while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted());
|
||||||
if ((bits & WIFI_DISCONNECTED_BIT) != 0) {
|
if ((bits & WIFI_DISCONNECTED_BIT) != 0) {
|
||||||
if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) {
|
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) {
|
} else if (self->last_disconnect_reason == WIFI_REASON_NO_AP_FOUND) {
|
||||||
return WIFI_RADIO_ERROR_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;
|
return WIFI_RADIO_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue