can_transmit_to_channel() ignores freq value just focus on channel number
This commit is contained in:
parent
f42dc4314d
commit
32f168ec8c
11
lnxrouter
11
lnxrouter
|
@ -630,11 +630,7 @@ can_transmit_to_channel() {
|
|||
CHANNEL_NUM=$2
|
||||
|
||||
if [[ $USE_IWCONFIG -eq 0 ]]; then
|
||||
if [[ $FREQ_BAND == 2.4 ]]; then
|
||||
CHANNEL_INFO=$(get_adapter_info "${IFACE}" | grep -E " 24[0-9][0-9](\.0+){0,1} MHz \[${CHANNEL_NUM}\]")
|
||||
else
|
||||
CHANNEL_INFO=$(get_adapter_info "${IFACE}" | grep " \(49[0-9][0-9]\|5[0-9]\{3\}\) MHz \[${CHANNEL_NUM}\]")
|
||||
fi
|
||||
CHANNEL_INFO=$(get_adapter_info "${IFACE}" | grep -E " [0-9]+(\.[0-9]+){0,1} MHz \[${CHANNEL_NUM}\]")
|
||||
[[ -z "${CHANNEL_INFO}" ]] && return 1
|
||||
[[ "${CHANNEL_INFO}" == *no\ IR* ]] && return 1
|
||||
[[ "${CHANNEL_INFO}" == *disabled* ]] && return 1
|
||||
|
@ -665,9 +661,6 @@ ieee80211_frequency_to_channel() {
|
|||
fi
|
||||
}
|
||||
|
||||
is_5ghz_frequency() {
|
||||
[[ $1 =~ ^(49[0-9]{2})|(5[0-9]{3})$ ]]
|
||||
}
|
||||
|
||||
is_interface_wifi_connected() {
|
||||
if [[ $USE_IWCONFIG -eq 0 ]]; then
|
||||
|
@ -1700,7 +1693,7 @@ prepare_wifi_interface() {
|
|||
|
||||
# TODO move this to check_wifi_settings() ?
|
||||
if is_interface_wifi_connected "${WIFI_IFACE}"; then
|
||||
WIFI_IFACE_FREQ=$(iw dev "${WIFI_IFACE}" link | grep -i freq | awk '{print $2}' | sed 's/\.00*$//g')
|
||||
WIFI_IFACE_FREQ=$(iw dev "${WIFI_IFACE}" link | grep -i freq | awk '{print $2}' | sed 's/\.00*$//g') # NOTE we assume integer currently, which can be right, or wrong in the future
|
||||
WIFI_IFACE_CHANNEL=$(ieee80211_frequency_to_channel "${WIFI_IFACE_FREQ}")
|
||||
|
||||
echo "${WIFI_IFACE} already working in channel ${WIFI_IFACE_CHANNEL} (${WIFI_IFACE_FREQ} MHz)"
|
||||
|
|
Loading…
Reference in New Issue