From: Jo-Philipp Wich Date: Sun, 4 Mar 2012 18:35:13 +0000 (+0000) Subject: modules/admin-full: scan three times to catch more networks in wifi join setup X-Git-Tag: 0.11.0~1019 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=e6bf801bad495bc15f8272af3ae653e50421c6c6 modules/admin-full: scan three times to catch more networks in wifi join setup --- diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm index b6204c0dc..03407b839 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm @@ -72,6 +72,24 @@ $Id$ luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless")) return end + + + function scanlist(times) + local i, k, v + local l = { } + local s = { } + + for i = 1, times do + for k, v in ipairs(iw.scanlist) do + if not s[v.bssid] then + l[#l+1] = v + s[v.bssid] = true + end + end + end + + return l + end -%> <%+header%> @@ -82,7 +100,7 @@ $Id$
- <% for i, net in ipairs(iw.scanlist) do net.encryption = net.encryption or { } %> + <% for i, net in ipairs(scanlist(3)) do net.encryption = net.encryption or { } %>