add a function to list all channels that can be used.

This commit is contained in:
HAO, Yun (郝运) 2019-06-02 18:27:51 +02:00
parent aa670d1f57
commit ecea779793

View File

@ -300,6 +300,26 @@ can_be_ap() {
return 1
}
get_avail_channel_list() {
AVAIL_CH_LIST=$(\
get_adapter_info ${IFACE} | \
grep "\* [0-9]* MHz \[[0-9]*\]" | \
while read l; do\
[[ $l != *disabled* ]] && [[ $l != *no\ IR* ]] && echo "$l";\
done | \
sed 's/^* //'
)
if [[ -z "$AVAIL_CH_LIST" ]]; then
echo "Cannot determine which channels are supported"
return 1
# else
# echo "$AVAIL_CH_LIST"
fi
return 0
}
can_transmit_to_channel() {
local IFACE CHANNEL_NUM CHANNEL_INFO
IFACE=$1