firmware/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless

31 lines
624 B
Plaintext

# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright 2016 Tim Niemeyer
wifiListRadio() {
if [ $# -ne "0" ]
then
echo "Usage: wifiListRadio"
return 1
fi
uci -q show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'
return 0
}
wifiGetFreq() {
if [ $# -ne "1" ]
then
echo "Usage: wifiGetFreq <radio>"
return 1
fi
local radio=$1
# Use hwmode for switching, since this is always set by firmware (effectively hard-coded)
# Do not use channel, as this might be "auto" for both
[ "$(uci get "wireless.${radio}.hwmode")" = "11a" ] && echo "5" || echo "2"
return 0
}
# vim: set noexpandtab:tabstop=4