Add channel change detection and update logic in main loop
This commit is contained in:
parent
d0d7dd473f
commit
e93addb4c0
1 changed files with 11 additions and 1 deletions
10
listener.py
10
listener.py
|
@ -124,6 +124,16 @@ if __name__ == "__main__":
|
||||||
timeout=10
|
timeout=10
|
||||||
)
|
)
|
||||||
print_stats()
|
print_stats()
|
||||||
|
|
||||||
|
# Check channel every 3 loops (~30 seconds)
|
||||||
|
channel_check_counter += 1
|
||||||
|
if channel_check_counter >= 3:
|
||||||
|
channel_check_counter = 0
|
||||||
|
new_channel = get_current_channel(test_interface)
|
||||||
|
if new_channel and new_channel != last_channel:
|
||||||
|
print(f"[~] Detected channel change: {last_channel} → {new_channel}")
|
||||||
|
set_monitor_channel(monitor_interface, new_channel)
|
||||||
|
last_channel = new_channel
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue