|
@@ -722,10 +722,7 @@ static int wifi_station_clear_config ( lua_State* L )
|
|
|
bool auto_connect=true;
|
|
|
bool save_to_flash=true;
|
|
|
|
|
|
- memset(sta_conf.ssid, 0, sizeof(sta_conf.ssid));
|
|
|
- memset(sta_conf.password, 0, sizeof(sta_conf.password));
|
|
|
- memset(sta_conf.bssid, 0, sizeof(sta_conf.bssid));
|
|
|
- sta_conf.bssid_set=0;
|
|
|
+ memset(&sta_conf, 0, sizeof(sta_conf));
|
|
|
|
|
|
wifi_station_disconnect();
|
|
|
|
|
@@ -753,10 +750,9 @@ static int wifi_station_config( lua_State* L )
|
|
|
bool save_to_flash=true;
|
|
|
size_t sl, pl, ml;
|
|
|
|
|
|
- memset(sta_conf.ssid, 0, sizeof(sta_conf.ssid));
|
|
|
- memset(sta_conf.password, 0, sizeof(sta_conf.password));
|
|
|
- memset(sta_conf.bssid, 0, sizeof(sta_conf.bssid));
|
|
|
- sta_conf.bssid_set=0;
|
|
|
+ memset(&sta_conf, 0, sizeof(sta_conf));
|
|
|
+ sta_conf.threshold.rssi = -127;
|
|
|
+ sta_conf.threshold.authmode = AUTH_OPEN;
|
|
|
|
|
|
if(lua_istable(L, 1))
|
|
|
{
|
|
@@ -1032,6 +1028,8 @@ static int wifi_station_listap( lua_State* L )
|
|
|
return luaL_error( L, "Can't list ap in SOFTAP mode" );
|
|
|
}
|
|
|
struct scan_config scan_cfg;
|
|
|
+ memset(&scan_cfg, 0, sizeof(scan_cfg));
|
|
|
+
|
|
|
getap_output_format=0;
|
|
|
|
|
|
if (lua_type(L, 1)==LUA_TTABLE)
|
|
@@ -1061,10 +1059,6 @@ static int wifi_station_listap( lua_State* L )
|
|
|
return luaL_error( L, "wrong arg type" );
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- scan_cfg.ssid=NULL;
|
|
|
- }
|
|
|
|
|
|
lua_getfield(L, 1, "bssid");
|
|
|
if (!lua_isnil(L, -1)) /* found? */
|
|
@@ -1085,10 +1079,6 @@ static int wifi_station_listap( lua_State* L )
|
|
|
return luaL_error( L, "wrong arg type" );
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- scan_cfg.bssid=NULL;
|
|
|
- }
|
|
|
|
|
|
|
|
|
lua_getfield(L, 1, "channel");
|
|
@@ -1107,10 +1097,6 @@ static int wifi_station_listap( lua_State* L )
|
|
|
return luaL_error( L, "wrong arg type" );
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- scan_cfg.channel=0;
|
|
|
- }
|
|
|
|
|
|
lua_getfield(L, 1, "show_hidden");
|
|
|
if (!lua_isnil(L, -1)) /* found? */
|
|
@@ -1129,10 +1115,6 @@ static int wifi_station_listap( lua_State* L )
|
|
|
return luaL_error( L, "wrong arg type" );
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- scan_cfg.show_hidden=0;
|
|
|
- }
|
|
|
|
|
|
if (lua_type(L, 2) == LUA_TFUNCTION || lua_type(L, 2) == LUA_TLIGHTFUNCTION)
|
|
|
{
|