diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-08-08 19:57:05 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-08-08 19:57:05 +0000 |
commit | a7f05a3341c04a0a09fc9af1455855dc04459e9a (patch) | |
tree | 3841a667c4c5161750a1bd6254e2cb86475db175 /modules | |
parent | adafc828193c924daedecbf59808d77e065d44d6 (diff) |
modules/admin-mini: use iwinfo to perform scans
Diffstat (limited to 'modules')
-rw-r--r-- | modules/admin-mini/luasrc/model/cbi/mini/wifi.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua index 762412e03..ff87be4e7 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua @@ -102,7 +102,21 @@ function scan.write(self, section) m.autoapply = false t2.render = t2._render local ifname = self.map:get(section, "ifname") - luci.util.update(t2.data, sys.wifi.iwscan(ifname)) + local iwinfo = sys.wifi.getiwinfo(ifname) + if iwinfo then + local _, cell + for _, cell in ipairs(iwinfo.scanlist) do + t2.data[#t2.data+1] = { + Quality = "%d/%d" %{ cell.quality, cell.quality_max }, + ESSID = cell.ssid, + Address = cell.bssid, + Mode = cell.mode, + ["Encryption key"] = cell.encryption.enabled and "On" or "Off", + ["Signal level"] = "%d dBm" % cell.signal, + ["Noise level"] = "%d dBm" % iwinfo.noise + } + end + end end t2._render = t2.render |