mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Fix grgsm_scanner crash on unsupported band names (GSM800, EGSM900_EXT)
Add explicit band name mapping from internal names to grgsm_scanner's accepted -b values (GSM900, GSM850, DCS1800, PCS1900). Bands without a valid grgsm_scanner equivalent (GSM800, EGSM900_EXT) are skipped with a log message instead of crashing the scanner. Remove GSM800 from the dashboard band selector since it can't be scanned. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -614,11 +614,31 @@ def start_scanner():
|
||||
cmd.extend(['--args', f'rtl={device_index}'])
|
||||
|
||||
# Add selected band arguments
|
||||
# Map EGSM900 to GSM900 since that's what grgsm_scanner expects
|
||||
# Map internal band names to grgsm_scanner -b values
|
||||
# grgsm_scanner accepts: GSM900, GSM850, DCS1800, PCS1900, GSM450, GSM480, GSM-R
|
||||
GRGSM_BAND_MAP = {
|
||||
'EGSM900': 'GSM900',
|
||||
'EGSM900_EXT': None, # Covered by GSM900 scan
|
||||
'GSM850': 'GSM850',
|
||||
'GSM800': None, # Not a standard GSM band for grgsm_scanner
|
||||
'DCS1800': 'DCS1800',
|
||||
'PCS1900': 'PCS1900',
|
||||
}
|
||||
bands_added = set()
|
||||
for band_name in selected_bands:
|
||||
# Normalize band name (EGSM900 -> GSM900, remove EGSM prefix)
|
||||
normalized_band = band_name.replace('EGSM', 'GSM')
|
||||
cmd.extend(['-b', normalized_band])
|
||||
grgsm_band = GRGSM_BAND_MAP.get(band_name, band_name)
|
||||
if grgsm_band is None:
|
||||
logger.info(f"Skipping band {band_name} (not supported by grgsm_scanner)")
|
||||
continue
|
||||
if grgsm_band not in bands_added:
|
||||
cmd.extend(['-b', grgsm_band])
|
||||
bands_added.add(grgsm_band)
|
||||
|
||||
if not bands_added:
|
||||
from app import release_sdr_device
|
||||
release_sdr_device(device_index)
|
||||
return jsonify({'error': f'No scannable bands selected. '
|
||||
f'GSM800 and EGSM900_EXT are not supported by grgsm_scanner.'}), 400
|
||||
|
||||
logger.info(f"Starting GSM scanner: {' '.join(cmd)}")
|
||||
|
||||
|
||||
@@ -1826,8 +1826,7 @@
|
||||
'Europe': [
|
||||
{ name: 'EGSM900', label: 'EGSM900 (925-960 MHz)', freq: '925-960 MHz', common: true, recommended: true },
|
||||
{ name: 'DCS1800', label: 'DCS1800 (1805-1880 MHz)', freq: '1805-1880 MHz', common: true, recommended: false },
|
||||
{ name: 'GSM850', label: 'GSM850 (869-894 MHz)', freq: '869-894 MHz', common: false, recommended: false },
|
||||
{ name: 'GSM800', label: 'GSM800 (832-862 MHz)', freq: '832-862 MHz', common: false, recommended: false }
|
||||
{ name: 'GSM850', label: 'GSM850 (869-894 MHz)', freq: '869-894 MHz', common: false, recommended: false }
|
||||
],
|
||||
'Americas': [
|
||||
{ name: 'GSM850', label: 'GSM850 (869-894 MHz)', freq: '869-894 MHz', common: true, recommended: true },
|
||||
|
||||
Reference in New Issue
Block a user