ieee80211.lua 413 B

123456789101112131415161718
  1. module("luci.tools.ieee80211", package.seeall)
  2. function frequency_to_channel(freq)
  3. if (freq == 2484) then
  4. return 14;
  5. elseif (freq < 2484) then
  6. return (freq - 2407) / 5;
  7. elseif (freq >= 4910 and freq <= 4980) then
  8. return (freq - 4000) / 5;
  9. elseif (freq <= 45000) then
  10. return (freq - 5000) / 5;
  11. elseif (freq >= 58320 and freq <= 64800) then
  12. return (freq - 56160) / 2160;
  13. else
  14. return 0;
  15. end
  16. end