mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
commit
cf93b4ba02
@ -850,6 +850,7 @@ void jswrap_wifi_save(JsVar *what) {
|
||||
jsvObjectSetChildAndUnLock(o, "passwordAP", jsvNewFromString((char *) ap_config.password));
|
||||
jsvObjectSetChildAndUnLock(o, "authmodeAP", jsvNewFromInteger(ap_config.authmode));
|
||||
jsvObjectSetChildAndUnLock(o, "hiddenAP", jsvNewFromInteger(ap_config.ssid_hidden));
|
||||
jsvObjectSetChildAndUnLock(o, "channelAP", jsvNewFromInteger(ap_config.channel));
|
||||
|
||||
savedMode = wifi_get_opmode();
|
||||
|
||||
@ -900,7 +901,7 @@ void jswrap_wifi_restore(void) {
|
||||
ap_config.ssid_hidden = jsvGetInteger(v);
|
||||
jsvUnLock(v);
|
||||
|
||||
v = jsvObjectGetChild(o,"ssid",0);
|
||||
v = jsvObjectGetChild(o,"ssidAP",0);
|
||||
jsvGetString(v, (char *)ap_config.ssid, sizeof(ap_config.ssid));
|
||||
|
||||
ap_config.ssid_len = jsvGetStringLength(v);
|
||||
@ -910,7 +911,10 @@ void jswrap_wifi_restore(void) {
|
||||
jsvGetString(v, (char *)ap_config.password, sizeof(ap_config.password));
|
||||
jsvUnLock(v);
|
||||
|
||||
ap_config.channel = 1;
|
||||
v = jsvObjectGetChild(o,"channelAP",0);
|
||||
ap_config.channel = jsvGetInteger(v);
|
||||
jsvUnLock(v);
|
||||
|
||||
ap_config.max_connection = 4;
|
||||
ap_config.beacon_interval = 100;
|
||||
wifi_softap_set_config_current(&ap_config);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user