applications/luci-meshwizard: use wifi.getiwinfo() to find available channels
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 8 Aug 2012 20:22:18 +0000 (20:22 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 8 Aug 2012 20:22:18 +0000 (20:22 +0000)
applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua

index 48fb9060089a5686ffba22dd0cf5799efdee1e0c..bb65635e1f438439064538685f826d66338e6de1 100644 (file)
@@ -98,9 +98,12 @@ uci:foreach("wireless", "wifi-device", function(section)
        chan:depends(device .. "_config", 1)
        chan:value('default')
 
-       for _, f in ipairs(sys.wifi.channels(device)) do
-               if not f.restricted then
-                       chan:value(f.channel)
+       local iwinfo = sys.wifi.getiwinfo(device)
+       if iwinfo then
+               for _, f in ipairs(iwinfo.freqlist) do
+                       if not f.restricted then
+                               chan:value(f.channel)
+                       end
                end
        end
        -- IPv4 address