Skip to content

Commit 2e93c95

Browse files
authored
Merge pull request #7349 from dhalbert/fix-authmode-fetching
fix AuthMode printing regression
2 parents c6ea3e8 + 66efed5 commit 2e93c95

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ports/espressif/common-hal/wifi/Network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
8686
}
8787
mp_obj_t authmode_list = mp_obj_new_list(0, NULL);
8888
if (authmode_mask != 0) {
89-
for (uint8_t i = 0; i < 8; i++) {
89+
for (uint8_t i = 0; i < 32; i++) {
9090
if ((authmode_mask >> i) & 1) {
91-
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i));
91+
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i));
9292
}
9393
}
9494
}

ports/raspberrypi/common-hal/wifi/Network.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) {
5353
}
5454

5555
mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
56-
uint8_t authmode_mask = 0;
56+
uint32_t authmode_mask = 0;
5757
if (self->record.auth_mode == 0) {
5858
authmode_mask = AUTHMODE_OPEN;
5959
}
@@ -71,9 +71,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
7171
;
7272
mp_obj_t authmode_list = mp_obj_new_list(0, NULL);
7373
if (authmode_mask != 0) {
74-
for (uint8_t i = 0; i < 8; i++) {
74+
for (uint32_t i = 0; i < 32; i++) {
7575
if ((authmode_mask >> i) & 1) {
76-
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i));
76+
mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i));
7777
}
7878
}
7979
}

0 commit comments

Comments
 (0)