Skip to content
Snippets Groups Projects
Commit 54b89665 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

esp8266/modnetwork: .config(): Add "password" param (W/O).

parent 7acc252e
No related branches found
No related tags found
No related merge requests found
...@@ -264,6 +264,15 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs ...@@ -264,6 +264,15 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
cfg.ap.authmode = mp_obj_get_int(kwargs->table[i].value); cfg.ap.authmode = mp_obj_get_int(kwargs->table[i].value);
break; break;
} }
case QS(MP_QSTR_password): {
req_if = SOFTAP_IF;
mp_uint_t len;
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
len = MIN(len, sizeof(cfg.ap.password) - 1);
memcpy(cfg.ap.password, s, len);
cfg.ap.password[len] = 0;
break;
}
default: default:
goto unknown; goto unknown;
} }
......
...@@ -126,6 +126,7 @@ Q(AUTH_WPA_WPA2_PSK) ...@@ -126,6 +126,7 @@ Q(AUTH_WPA_WPA2_PSK)
// config keys // config keys
Q(essid) Q(essid)
Q(authmode) Q(authmode)
Q(password)
// Pin class // Pin class
Q(Pin) Q(Pin)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment