Skip to content

Commit c5da251

Browse files
committed
luci-app-ffwizard-falter: update to use option band instead of iwinfo
Instead of trying to figure out which freq a wireless device uses based on it's reported freq list using iwinfo, simply use the "band" option from the wireless config (since OpenWrt 21.02.2). Also remove deprecated hwmode option. Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
1 parent aaafe2e commit c5da251

File tree

1 file changed

+3
-4
lines changed
  • luci/luci-app-ffwizard-falter/luasrc/model/cbi/freifunk/assistent

1 file changed

+3
-4
lines changed

luci/luci-app-ffwizard-falter/luasrc/model/cbi/freifunk/assistent/wireless.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,14 @@ function calchwmode(device)
378378
end
379379

380380
function getchannel(device)
381-
local iwinfo = get_iwinfo(device)
382-
local freqlist = iwinfo.freqlist(device)
381+
local conf = uci:get("wireless", device, "band") or "X"
383382

384383
local r_channel
385-
if (freqlist[1].mhz > 2411 and freqlist[1].mhz < 2484) then
384+
if (conf == "2g") then
386385
--this is 2.4 Ghz
387386
r_channel = tonumber(uci:get(community, "wifi_device", "channel")) or 13
388387
end
389-
if (freqlist[1].mhz > 5179 and freqlist[1].mhz < 5701) then
388+
if (conf == "5g") then
390389
--this is 5 Ghz
391390
r_channel = tonumber(uci:get(community, "wifi_device_5", "channel")) or 36
392391
end

0 commit comments

Comments
 (0)