Update network.py

This commit is contained in:
Félix Aimé 2021-06-15 18:20:31 +02:00 committed by GitHub
parent 98bd7bab1a
commit 4b9413ba37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,6 +344,7 @@ class Network(object):
Deduce the channel to have for the AP in order to prevent
kind of jamming between the two wifi interfaces.
"""
try:
if self.iface_out[0] == "w":
# Get the channel of the connected interface
sh = sp.Popen(["iw", self.iface_out, "info"],
@ -355,3 +356,5 @@ class Network(object):
return "11" if int(chn) < 7 else "1"
else:
return "1"
except:
return "1"