Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

Commit 54b8966

Browse files
author
Paul Sokolovsky
committed
esp8266/modnetwork: .config(): Add "password" param (W/O).
1 parent 7acc252 commit 54b8966

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

esp8266/modnetwork.c

+9
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,15 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
264264
cfg.ap.authmode = mp_obj_get_int(kwargs->table[i].value);
265265
break;
266266
}
267+
case QS(MP_QSTR_password): {
268+
req_if = SOFTAP_IF;
269+
mp_uint_t len;
270+
const char *s = mp_obj_str_get_data(kwargs->table[i].value, &len);
271+
len = MIN(len, sizeof(cfg.ap.password) - 1);
272+
memcpy(cfg.ap.password, s, len);
273+
cfg.ap.password[len] = 0;
274+
break;
275+
}
267276
default:
268277
goto unknown;
269278
}

esp8266/qstrdefsport.h

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Q(AUTH_WPA_WPA2_PSK)
126126
// config keys
127127
Q(essid)
128128
Q(authmode)
129+
Q(password)
129130

130131
// Pin class
131132
Q(Pin)

0 commit comments

Comments
 (0)