Merge pull request #7349 from dhalbert/fix-authmode-fetching

fix AuthMode printing regression
This commit is contained in:
Dan Halbert 2022-12-15 18:01:30 -05:00 committed by GitHub
commit 2e93c9577a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -86,9 +86,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
}
mp_obj_t authmode_list = mp_obj_new_list(0, NULL);
if (authmode_mask != 0) {
for (uint8_t i = 0; i < 8; i++) {
for (uint8_t i = 0; i < 32; i++) {
if ((authmode_mask >> i) & 1) {
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i));
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i));
}
}
}

View File

@ -53,7 +53,7 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) {
}
mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
uint8_t authmode_mask = 0;
uint32_t authmode_mask = 0;
if (self->record.auth_mode == 0) {
authmode_mask = AUTHMODE_OPEN;
}
@ -71,9 +71,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
;
mp_obj_t authmode_list = mp_obj_new_list(0, NULL);
if (authmode_mask != 0) {
for (uint8_t i = 0; i < 8; i++) {
for (uint32_t i = 0; i < 32; i++) {
if ((authmode_mask >> i) & 1) {
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i));
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i));
}
}
}