From 30597efafb3dcca1460d0e91bc3e67f5a9cdba3d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 8 Aug 2012 20:07:36 +0000 Subject: [PATCH] modules/admin-mini: use getiwinfo() instead of getiwconfig() --- modules/admin-mini/luasrc/model/cbi/mini/wifi.lua | 11 ++++++----- 1 file 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 ff87be4e7..a18c072e7 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("