Commit Graph

3 Commits

Author SHA1 Message Date
Robert McMahon 96aab517af fix communicate and await 2026-02-13 15:34:47 -08:00
Robert McMahon e09456aab9 Refactor MonitorModeSetup to WiFiMonitor with async start/stop methods
- Rename MonitorModeSetup class to WiFiMonitor (better naming)
- Add async start() method for setting up monitor mode
- Add async stop() method for restoring interface to managed mode
- Convert all subprocess calls to async (asyncio.create_subprocess_exec)
- Add is_started property to track monitor mode state
- Update capture methods to use async implementation
- Use try/finally to ensure proper cleanup
- Run blocking scapy sniff() calls in executor for async compatibility
- Improve error handling with proper stderr communication

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 15:30:13 -08:00
Robert McMahon b67107e53e Refactor WiFi monitor script: improve code quality and rename
- Rename test_monitor.py to wifi_monitor.py (better naming)
- Delete parse_tshark_pcap.py (deprecated, replaced by wifi_monitor.py)
- Refactor to class-based architecture for better modularity:
  * Config: Configuration management
  * MonitorModeSetup: Monitor mode setup operations
  * PacketParser: Packet parsing utilities
  * PacketAnalyzer: Packet analysis and statistics
  * PacketCapture: Capture operations (PCAP and live)
  * ArgumentParser: Command line argument parsing
- Add properties where appropriate (snaplen, is_successful, error_message)
- Remove 'get_' prefix from utility methods (Python convention)
- Fix Python convention violations:
  * Replace wildcard imports with explicit imports
  * Use specific exception types instead of bare Exception
  * Organize imports (stdlib, third-party)
  * Remove unused imports
- Single exit point pattern throughout code
- Remove trailing whitespace

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 15:19:18 -08:00