Add channel tracking and periodic check in main loop

This commit is contained in:
Yaro Kasear 2025-04-30 15:20:43 -05:00
parent e93addb4c0
commit 3b03e5c048

View file

@ -115,6 +115,9 @@ if __name__ == "__main__":
# Start sniffing in a background thread # Start sniffing in a background thread
try: try:
last_channel = current_channel
channel_check_counter = 0
while running: while running:
sniff( sniff(
iface=LISTEN_INTERFACE, iface=LISTEN_INTERFACE,
@ -124,7 +127,7 @@ if __name__ == "__main__":
timeout=10 timeout=10
) )
print_stats() print_stats()
# Check channel every 3 loops (~30 seconds) # Check channel every 3 loops (~30 seconds)
channel_check_counter += 1 channel_check_counter += 1
if channel_check_counter >= 3: if channel_check_counter >= 3: