projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
adafc82
)
modules/admin-mini: use iwinfo to perform scans
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 8 Aug 2012 19:57:05 +0000
(19:57 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 8 Aug 2012 19:57:05 +0000
(19:57 +0000)
modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
patch
|
blob
|
history
diff --git
a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
index 762412e03429a288f19a9590485d1a0daba5426e..ff87be4e753a1ebb8ab89562de35b34d8f5c2a26 100644
(file)
--- 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")
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
end
t2._render = t2.render