mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-21 19:40:11 +00:00
add a function to list all channels that can be used.
This commit is contained in:
parent
aa670d1f57
commit
ecea779793
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user