mirror of https://github.com/aredn/aredn.git
Correct the frequency for 3GHz radio (#345)
This commit is contained in:
parent
ac78a4a40a
commit
15c83780a5
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue