summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-08-08 20:07:36 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-08-08 20:07:36 +0000
commit30597efafb3dcca1460d0e91bc3e67f5a9cdba3d (patch)
treef6da9c1a7a3df326c64f98b0689309dfe4f787fd /modules/admin-mini/luasrc
parenta7f05a3341c04a0a09fc9af1455855dc04459e9a (diff)
modules/admin-mini: use getiwinfo() instead of getiwconfig()
Diffstat (limited to 'modules/admin-mini/luasrc')
-rw-r--r--modules/admin-mini/luasrc/model/cbi/mini/wifi.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
index ff87be4e75..a18c072e73 100644
--- a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
+++ b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua
@@ -27,7 +27,6 @@ end
local wlcursor = luci.model.uci.cursor_state()
local wireless = wlcursor:get_all("wireless")
-local wifidata = sys.wifi.getiwconfig()
local wifidevs = {}
local ifaces = {}
@@ -55,7 +54,8 @@ s = m:section(Table, ifaces, translate("Networks"))
link = s:option(DummyValue, "_link", translate("Link"))
function link.cfgvalue(self, section)
local ifname = self.map:get(section, "ifname")
- return wifidata[ifname] and wifidata[ifname]["Link Quality"] or "-"
+ local iwinfo = sys.wifi.getiwinfo(ifname)
+ return iwinfo and "%d/%d" %{ iwinfo.quality, iwinfo.quality_max } or "-"
end
essid = s:option(DummyValue, "ssid", "ESSID")
@@ -63,8 +63,8 @@ essid = s:option(DummyValue, "ssid", "ESSID")
bssid = s:option(DummyValue, "_bsiid", "BSSID")
function bssid.cfgvalue(self, section)
local ifname = self.map:get(section, "ifname")
- return (wifidata[ifname] and (wifidata[ifname].Cell
- or wifidata[ifname]["Access Point"])) or "-"
+ local iwinfo = sys.wifi.getiwinfo(ifname)
+ return iwinfo and iwinfo.bssid or "-"
end
channel = s:option(DummyValue, "channel", translate("Channel"))
@@ -84,7 +84,8 @@ encryption = s:option(DummyValue, "encryption", translate("<abbr title=\"Encrypt
power = s:option(DummyValue, "_power", translate("Power"))
function power.cfgvalue(self, section)
local ifname = self.map:get(section, "ifname")
- return wifidata[ifname] and wifidata[ifname]["Tx-Power"] or "-"
+ local iwinfo = sys.wifi.getiwinfo(ifname)
+ return iwinfo and "%d dBm" % iwinfo.txpower or "-"
end
scan = s:option(Button, "_scan", translate("Scan"))