luci-app-dawn: Fix getChannelFromFrequency for 6GHz
authorWeikai Kong <priv@pppig236.com>
Fri, 3 Jan 2025 05:31:35 +0000 (00:31 -0500)
committerPaul Donald <newtwen+github@gmail.com>
Sun, 5 Jan 2025 14:06:54 +0000 (14:06 +0000)
For (5.9-)6GHz channels
( Center Frequency - 5950 ) / 5 = channel_number

e.g. ( 5955 - 5950 ) / 5 = Channel 1

Signed-off-by: Weikai Kong <priv@pppig236.com>
applications/luci-app-dawn/htdocs/luci-static/resources/dawn/dawn-common.js

index 9852994fd32a133f73604b2f5878c1016d958aae..a76d38495d12b97eeb0789e2fb8f689a37bb4323 100644 (file)
@@ -49,9 +49,12 @@ function getChannelFromFrequency(freq) {
        else if (freq >= 4910 && freq <= 4980) {
                return (freq - 4000) / 5;
        }
-       else if (freq <= 45000) {
+       else if (freq <= 5935) {
                return (freq - 5000) / 5;
        }
+       else if (freq <= 45000) {
+               return (freq - 5950) / 5;
+       }
        else if (freq >= 58320 && freq <= 64800) {
                return (freq - 56160) / 2160;
        }