diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2020-04-02 12:18:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 12:18:25 +0300 |
commit | c8f9f6f4945622181bb00af0c1ad6a13f717e60f (patch) | |
tree | 9e77f0bbf0f3e4ea98a135fb99bdad7cfb0a75ea /applications/luci-app-dawn/luasrc/tools/ieee80211.lua | |
parent | cf1845b16e51e1efb26aefb9be567698cda2b3de (diff) | |
parent | 9707acf72fd789b917c97f93ac0bb2fede9a86f4 (diff) |
Merge pull request #3790 from PolynomialDivision/feature/luci-app-dawn
luci-app-dawn: add luci app for dawn
Diffstat (limited to 'applications/luci-app-dawn/luasrc/tools/ieee80211.lua')
-rw-r--r-- | applications/luci-app-dawn/luasrc/tools/ieee80211.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/applications/luci-app-dawn/luasrc/tools/ieee80211.lua b/applications/luci-app-dawn/luasrc/tools/ieee80211.lua new file mode 100644 index 0000000000..b35991ed7d --- /dev/null +++ b/applications/luci-app-dawn/luasrc/tools/ieee80211.lua @@ -0,0 +1,18 @@ +module("luci.tools.ieee80211", package.seeall) + +function frequency_to_channel(freq) + if (freq == 2484) then + return 14; + elseif (freq < 2484) then + return (freq - 2407) / 5; + elseif (freq >= 4910 and freq <= 4980) then + return (freq - 4000) / 5; + elseif (freq <= 45000) then + return (freq - 5000) / 5; + elseif (freq >= 58320 and freq <= 64800) then + return (freq - 56160) / 2160; + else + return 0; + end +end + |