extmod/network_cyw43: Add "security" config option to get/set auth mode.

Signed-off-by: Damien George <damien@micropython.org>
pull/8863/head
Damien George 2022-07-05 11:05:13 +10:00
rodzic f4e69ab103
commit d660a0c3d1
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -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);
@ -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;