mirror of
https://github.com/smittix/intercept.git
synced 2026-05-02 02:29:58 -07:00
fix(airband): parse composite device value and send sdr_type to backend
The airband start function was calling parseInt() directly on composite device selector values like "rtlsdr:0", which always returned NaN and fell back to device 0. This also meant sdr_type was never sent to the backend, and could result in int(None) TypeError on the server. Now properly splits the composite value (matching ADS-B/ACARS/VDL2 pattern) and sends both device index and sdr_type. Also hardened backend int() parsing to use explicit None checks. Fixes: "Airband Error: Invalid parameter: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3652,10 +3652,12 @@ sudo make install</code>
|
||||
|
||||
async function startAirband() {
|
||||
const frequency = getAirbandFrequency();
|
||||
const device = parseInt(document.getElementById('airbandDeviceSelect').value) || 0;
|
||||
const compositeVal = document.getElementById('airbandDeviceSelect').value || 'rtlsdr:0';
|
||||
const [sdr_type, deviceIdx] = compositeVal.includes(':') ? compositeVal.split(':') : ['rtlsdr', compositeVal];
|
||||
const device = parseInt(deviceIdx) || 0;
|
||||
const squelch = parseInt(document.getElementById('airbandSquelch').value) || 0;
|
||||
|
||||
console.log('[AIRBAND] Starting with device:', device, 'freq:', frequency, 'squelch:', squelch);
|
||||
console.log('[AIRBAND] Starting with device:', device, 'sdr_type:', sdr_type, 'freq:', frequency, 'squelch:', squelch);
|
||||
|
||||
// Check if ADS-B tracking is using this device
|
||||
if (isTracking && adsbActiveDevice !== null && device === adsbActiveDevice) {
|
||||
@@ -3682,7 +3684,8 @@ sudo make install</code>
|
||||
modulation: 'am', // Airband uses AM
|
||||
squelch: squelch,
|
||||
gain: 40,
|
||||
device: device
|
||||
device: device,
|
||||
sdr_type: sdr_type
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user