summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-08-08 20:07:39 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-08-08 20:07:39 +0000
commita521cddcf89bb47c1dd20581c428bc4566d478e4 (patch)
tree872da763a52af14450102cc2756a409a3f34eace /modules
parent30597efafb3dcca1460d0e91bc3e67f5a9cdba3d (diff)
modules/freifunk: use getiwinfo() instead of getiwconfig()
Diffstat (limited to 'modules')
-rw-r--r--modules/freifunk/luasrc/controller/freifunk/freifunk.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
index 1b5513125..666f0864b 100644
--- a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
+++ b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
@@ -219,7 +219,6 @@ function jsonstatus()
root.network = {}
root.wireless = {devices = {}, interfaces = {}, status = {}}
local wifs = root.wireless.interfaces
- local wifidata = luci.sys.wifi.getiwconfig() or {}
local netdata = luci.sys.net.deviceinfo() or {}
for _, vif in ipairs(ffwifs) do
@@ -229,7 +228,18 @@ function jsonstatus()
if s.device == vif and s.network == vif then
wifs[#wifs+1] = s
if s.ifname then
- root.wireless.status[s.ifname] = wifidata[s.ifname]
+ local iwinfo = luci.sys.wifi.getiwinfo(s.ifname)
+ if iwinfo then
+ root.wireless.status[s.ifname] = { }
+
+ local _, f
+ for _, f in ipairs({
+ "channel", "txpower", "bitrate", "signal", "noise",
+ "quality", "quality_max", "mode", "ssid", "bssid", "encryption", "ifname"
+ }) do
+ root.wireless.status[s.ifname][f] = iwinfo[f]
+ end
+ end
end
end
end)