0d3beb804d4a0bc22bba5e3b906c659c41443b1c
[wilink8-wlan/wl18xx-target-scripts.git] / mr / FreqToCh.sh
1 CHANNEL_FREQ=$1\r
2 echo $CHANNEL_FREQ\r
3 CHANNEL=0\r
4 \r
5 if [ "$CHANNEL_FREQ" -ge 5745 ] ; then \r
6         let "CHANNEL = (($CHANNEL_FREQ - 5745) / 5) + 149"\r
7 elif [ "$CHANNEL_FREQ" -ge 5180 ] ; then \r
8         let "CHANNEL = (($CHANNEL_FREQ - 5180) / 5) + 36"\r
9 elif [ "$CHANNEL_FREQ" -ge 2412 ] ; then \r
10         let "CHANNEL = (($CHANNEL_FREQ - 2412) / 5) + 1"\r
11 else\r
12         echo "FREQ in not in range" \r
13 fi\r
14 \r
15 echo $CHANNEL\r
16 \r
17 \r