2021-02-10 01:53:21 +01:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#
|
2016-06-10 23:58:09 +02:00
|
|
|
# Copyright 2016 Tim Niemeyer
|
|
|
|
|
2019-06-16 16:23:24 +02:00
|
|
|
wifiListRadio() {
|
2016-06-10 23:58:09 +02:00
|
|
|
if [ $# -ne "0" ]
|
|
|
|
then
|
2019-06-16 16:23:24 +02:00
|
|
|
echo "Usage: wifiListRadio"
|
2016-06-10 23:58:09 +02:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2019-11-23 21:43:02 +01:00
|
|
|
uci -q show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'
|
2016-06-10 23:58:09 +02:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-06-16 16:23:24 +02:00
|
|
|
wifiGetFreq() {
|
|
|
|
if [ $# -ne "1" ]
|
2017-10-05 15:37:44 +02:00
|
|
|
then
|
2019-06-16 16:23:24 +02:00
|
|
|
echo "Usage: wifiGetFreq <radio>"
|
2016-06-10 23:58:09 +02:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
local radio=$1
|
2017-10-15 11:27:58 +02:00
|
|
|
|
2022-02-21 17:48:35 +01:00
|
|
|
# Use uci radio band for switching, since this is always set by firmware (effectively hard-coded)
|
2019-06-16 16:23:24 +02:00
|
|
|
# Do not use channel, as this might be "auto" for both
|
2022-02-21 17:48:35 +01:00
|
|
|
[ "$(uci get "wireless.${radio}.band")" = "5g" ] && echo "5" || echo "2"
|
2017-10-15 11:27:58 +02:00
|
|
|
return 0
|
|
|
|
}
|
2016-06-10 23:58:09 +02:00
|
|
|
# vim: set noexpandtab:tabstop=4
|