mirror of
https://github.com/smittix/intercept.git
synced 2026-07-10 18:48:12 -07:00
fix: propagate USRP/BladeRF/HydraSDR through remaining SDR-type lists
Several modules independently reimplemented the sdr_type string-to-enum mapping and bandwidth caps instead of using the canonical mapping in utils/sdr/detection.py, so they were never updated when USRP, BladeRF, and HydraSDR support was added: - routes/listening_post/audio.py: the receiver audio-start endpoint hard-rejected these types with a 400, even though the underlying SDRFactory command builder already supports them. - routes/meteor_websocket.py and routes/waterfall_websocket.py: unknown sdr_type strings silently fell back to RTL_SDR, which could build a command against the wrong hardware. Added the missing mapping entries and matching MAX_BANDWIDTH caps for the three new types. - utils/ground_station/iq_bus.py: same silent-fallback mapping gap in IQ capture command building.
This commit is contained in:
@@ -54,7 +54,7 @@ def start_audio() -> Response:
|
||||
if frequency <= 0:
|
||||
return jsonify({"status": "error", "message": "frequency is required"}), 400
|
||||
|
||||
valid_sdr_types = ["rtlsdr", "hackrf", "airspy", "limesdr", "sdrplay"]
|
||||
valid_sdr_types = ["rtlsdr", "hackrf", "airspy", "limesdr", "sdrplay", "usrp", "bladerf", "hydrasdr"]
|
||||
if sdr_type not in valid_sdr_types:
|
||||
return jsonify({"status": "error", "message": f"Invalid sdr_type. Use: {', '.join(valid_sdr_types)}"}), 400
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ MAX_BANDWIDTH = {
|
||||
SDRType.LIME_SDR: 20000000,
|
||||
SDRType.AIRSPY: 10000000,
|
||||
SDRType.SDRPLAY: 2000000,
|
||||
SDRType.USRP: 25000000,
|
||||
SDRType.BLADE_RF: 40000000,
|
||||
SDRType.HYDRA_SDR: 10000000,
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +90,9 @@ def _resolve_sdr_type(sdr_type_str: str) -> SDRType:
|
||||
"limesdr": SDRType.LIME_SDR,
|
||||
"airspy": SDRType.AIRSPY,
|
||||
"sdrplay": SDRType.SDRPLAY,
|
||||
"usrp": SDRType.USRP,
|
||||
"bladerf": SDRType.BLADE_RF,
|
||||
"hydrasdr": SDRType.HYDRA_SDR,
|
||||
}
|
||||
return mapping.get(sdr_type_str.lower(), SDRType.RTL_SDR)
|
||||
|
||||
|
||||
@@ -62,6 +62,9 @@ MAX_BANDWIDTH = {
|
||||
SDRType.LIME_SDR: 20000000,
|
||||
SDRType.AIRSPY: 10000000,
|
||||
SDRType.SDRPLAY: 2000000,
|
||||
SDRType.USRP: 25000000,
|
||||
SDRType.BLADE_RF: 40000000,
|
||||
SDRType.HYDRA_SDR: 10000000,
|
||||
}
|
||||
|
||||
|
||||
@@ -330,6 +333,9 @@ def _resolve_sdr_type(sdr_type_str: str) -> SDRType:
|
||||
"lime_sdr": SDRType.LIME_SDR,
|
||||
"airspy": SDRType.AIRSPY,
|
||||
"sdrplay": SDRType.SDRPLAY,
|
||||
"usrp": SDRType.USRP,
|
||||
"bladerf": SDRType.BLADE_RF,
|
||||
"hydrasdr": SDRType.HYDRA_SDR,
|
||||
}
|
||||
return mapping.get(sdr_type_str.lower(), SDRType.RTL_SDR)
|
||||
|
||||
|
||||
@@ -281,6 +281,9 @@ class IQBus:
|
||||
"limesdr": SDRType.LIME_SDR,
|
||||
"airspy": SDRType.AIRSPY,
|
||||
"sdrplay": SDRType.SDRPLAY,
|
||||
"usrp": SDRType.USRP,
|
||||
"bladerf": SDRType.BLADE_RF,
|
||||
"hydrasdr": SDRType.HYDRA_SDR,
|
||||
}
|
||||
sdr_type = type_map.get(self._sdr_type.lower(), SDRType.RTL_SDR)
|
||||
builder = SDRFactory.get_builder(sdr_type)
|
||||
|
||||
Reference in New Issue
Block a user