From ff36dbb3b41c4a4aa02e45398d757e759a5bea44 Mon Sep 17 00:00:00 2001 From: Russ Marshall Date: Mon, 19 Feb 2018 08:13:20 -0500 Subject: [PATCH] support for 5GHz channels --- includes/functions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 417190fc..8d05d415 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -138,8 +138,16 @@ function ParseConfig( $arrConfig ) { * @return $channel */ function ConvertToChannel( $freq ) { - $channel = ($freq - 2407)/5; - if ($channel > 0 && $channel < 14) { + if ($freq >= 2412 && $freq <= 2484) { + $channel = ($freq - 2407)/5; + } elseif ($freq >= 4915 && $freq <= 4980) { + $channel = ($freq - 4910)/5 + 182; + } elseif ($freq >= 5035 && $freq <= 5865) { + $channel = ($freq - 5030)/5 + 6; + } else { + $channel = -1; + } + if ($channel >= 1 && $channel <= 196) { return $channel; } else { return 'Invalid Channel';