3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 13:59:24 +01:00

auto-t: hostapd.py: add chan_switch()

Forces hostapd to channel switch
This commit is contained in:
James Prestwood 2021-10-19 11:19:09 -07:00 committed by Denis Kenzior
parent 4b88607b19
commit 74e7e341fd

View File

@ -216,6 +216,14 @@ class HostapdCLI(object):
cmd = 'RESEND_M3 %s' % address cmd = 'RESEND_M3 %s' % address
self.ctrl_sock.sendall(cmd.encode('utf-8')) self.ctrl_sock.sendall(cmd.encode('utf-8'))
def chan_switch(self, channel):
if channel > len(chan_freq_map):
raise Exception("Only 2.4GHz channels supported for chan_switch")
cmd = self.cmdline + ['chan_switch', '50', str(chan_freq_map[channel])]
ctx.start_process(cmd).wait()
self.wait_for_event('AP-CSA-FINISHED')
@property @property
def bssid(self): def bssid(self):
cmd = self.cmdline + ['status'] cmd = self.cmdline + ['status']