Skip to content

Commit

Permalink
extmod/network_cyw43: Add "security" config option to get/set auth mode.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jul 5, 2022
1 parent f4e69ab commit d660a0c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extmod/network_cyw43.c
Expand Up @@ -365,6 +365,11 @@ STATIC mp_obj_t network_cyw43_config(size_t n_args, const mp_obj_t *args, mp_map
return mp_obj_new_str((const char *)buf, len);
}
}
#if MICROPY_PY_NETWORK_CYW43_USE_LIB_DRIVER
case MP_QSTR_security: {
return MP_OBJ_NEW_SMALL_INT(cyw43_wifi_ap_get_auth(self->cyw));
}
#endif
case MP_QSTR_mac: {
uint8_t buf[6];
cyw43_wifi_get_mac(self->cyw, self->itf, buf);
Expand Down Expand Up @@ -421,6 +426,10 @@ STATIC mp_obj_t network_cyw43_config(size_t n_args, const mp_obj_t *args, mp_map
}
break;
}
case MP_QSTR_security: {
cyw43_wifi_ap_set_auth(self->cyw, mp_obj_get_int(e->value));
break;
}
case MP_QSTR_key:
case MP_QSTR_password: {
size_t len;
Expand Down

0 comments on commit d660a0c

Please sign in to comment.