mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Add scan progress to frontend, fix Europe band defaults
- Forward scanner progress (%) and status to SSE stream - Show progress bar and scan status in TRACKED TOWERS panel - Send scan_complete event with tower count and duration - Fix Europe BAND_CONFIG: only EGSM900 is recommended (GSM850/GSM800 are rarely used in Europe and waste scan time) - DCS1800 available but not recommended (RTL-SDR sensitivity is lower) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1312,7 +1312,30 @@ def scanner_thread(cmd, device_index):
|
||||
break # EOF
|
||||
|
||||
last_output = time.time()
|
||||
logger.info(f"Scanner [{msg_type}]: {line.strip()}")
|
||||
stripped = line.strip()
|
||||
logger.info(f"Scanner [{msg_type}]: {stripped}")
|
||||
|
||||
# Forward progress and status info to frontend
|
||||
progress_match = re.match(r'Scanning:\s+([\d.]+)%\s+done', stripped)
|
||||
if progress_match:
|
||||
try:
|
||||
app_module.gsm_spy_queue.put_nowait({
|
||||
'type': 'progress',
|
||||
'percent': float(progress_match.group(1)),
|
||||
'scan': scan_count
|
||||
})
|
||||
except queue.Full:
|
||||
pass
|
||||
continue
|
||||
if stripped.startswith('Try scan CCCH'):
|
||||
try:
|
||||
app_module.gsm_spy_queue.put_nowait({
|
||||
'type': 'status',
|
||||
'message': stripped,
|
||||
'scan': scan_count
|
||||
})
|
||||
except queue.Full:
|
||||
pass
|
||||
|
||||
parsed = parse_grgsm_scanner_output(line)
|
||||
if parsed:
|
||||
@@ -1375,6 +1398,17 @@ def scanner_thread(cmd, device_index):
|
||||
scan_duration = time.time() - scan_start
|
||||
logger.info(f"Scan #{scan_count} complete (exit code: {exit_code}, duration: {scan_duration:.1f}s)")
|
||||
|
||||
# Notify frontend scan completed
|
||||
try:
|
||||
app_module.gsm_spy_queue.put_nowait({
|
||||
'type': 'scan_complete',
|
||||
'scan': scan_count,
|
||||
'duration': round(scan_duration, 1),
|
||||
'towers_found': gsm_towers_found
|
||||
})
|
||||
except queue.Full:
|
||||
pass
|
||||
|
||||
# Detect crash pattern: process exits too quickly with no data
|
||||
if scan_duration < 5 and exit_code != 0:
|
||||
crash_count += 1
|
||||
|
||||
Reference in New Issue
Block a user