mirror of
https://github.com/smittix/intercept.git
synced 2026-07-13 12:08:12 -07:00
Add debug logging for TSCM Bluetooth scanning
Helps diagnose why Bluetooth devices appear in Bluetooth section but not in TSCM section. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -928,15 +928,21 @@ def get_tscm_bluetooth_snapshot(duration: int = 8) -> list[dict]:
|
|||||||
List of device dictionaries in TSCM format.
|
List of device dictionaries in TSCM format.
|
||||||
"""
|
"""
|
||||||
import time
|
import time
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger('intercept.bluetooth_v2')
|
||||||
|
|
||||||
scanner = get_bluetooth_scanner()
|
scanner = get_bluetooth_scanner()
|
||||||
|
|
||||||
# Start scan if not running
|
# Start scan if not running
|
||||||
if not scanner.is_scanning:
|
if not scanner.is_scanning:
|
||||||
|
logger.info(f"TSCM snapshot: Scanner not running, starting scan for {duration}s")
|
||||||
scanner.start_scan(mode='auto', duration_s=duration)
|
scanner.start_scan(mode='auto', duration_s=duration)
|
||||||
time.sleep(duration + 1)
|
time.sleep(duration + 1)
|
||||||
|
else:
|
||||||
|
logger.info("TSCM snapshot: Scanner already running, getting current devices")
|
||||||
|
|
||||||
devices = scanner.get_devices()
|
devices = scanner.get_devices()
|
||||||
|
logger.info(f"TSCM snapshot: get_devices() returned {len(devices)} devices")
|
||||||
|
|
||||||
# Convert to TSCM format with tracker detection data
|
# Convert to TSCM format with tracker detection data
|
||||||
tscm_devices = []
|
tscm_devices = []
|
||||||
|
|||||||
@@ -1243,9 +1243,13 @@ def _run_sweep(
|
|||||||
try:
|
try:
|
||||||
# Use unified Bluetooth scanner if available
|
# Use unified Bluetooth scanner if available
|
||||||
if _USE_UNIFIED_BT_SCANNER:
|
if _USE_UNIFIED_BT_SCANNER:
|
||||||
|
logger.info("TSCM: Using unified BT scanner for snapshot")
|
||||||
bt_devices = get_tscm_bluetooth_snapshot(duration=8)
|
bt_devices = get_tscm_bluetooth_snapshot(duration=8)
|
||||||
|
logger.info(f"TSCM: Unified scanner returned {len(bt_devices)} devices")
|
||||||
else:
|
else:
|
||||||
|
logger.info(f"TSCM: Using legacy BT scanner on {bt_interface}")
|
||||||
bt_devices = _scan_bluetooth_devices(bt_interface, duration=8)
|
bt_devices = _scan_bluetooth_devices(bt_interface, duration=8)
|
||||||
|
logger.info(f"TSCM: Legacy scanner returned {len(bt_devices)} devices")
|
||||||
for device in bt_devices:
|
for device in bt_devices:
|
||||||
mac = device.get('mac', '')
|
mac = device.get('mac', '')
|
||||||
if mac and mac not in all_bt:
|
if mac and mac not in all_bt:
|
||||||
|
|||||||
Reference in New Issue
Block a user