Correct the frequency for 3GHz radio (#345)

This commit is contained in:
Tim Wilkinson 2022-04-29 11:25:47 -07:00 committed by GitHub
parent ac78a4a40a
commit 15c83780a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -226,6 +226,14 @@ function model.getFreq()
local api=iwinfo.type(wlanInf) local api=iwinfo.type(wlanInf)
local iw = iwinfo[api] local iw = iwinfo[api]
local freq = iw.frequency(wlanInf) local freq = iw.frequency(wlanInf)
local radio = wlanInf:match("wlan(%d+)")
if radio then
local chan = tonumber(uci.cursor():get("wireless", "radio" .. radio, "channel") or 0)
-- 3GHZ channel -> Freq conversion
if (chan >= 76 and chan <= 99) then
freq = freq - 2000
end
end
return tostring(freq) return tostring(freq)
end end