mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
Register SSTV mode with SDR device registry for device state panel
SSTV was not claiming/releasing SDR devices through the centralized registry, so the device state panel always showed the device as idle during SSTV use. Added claim_sdr_device/release_sdr_device on the backend and reserveDevice/releaseDevice on the frontend, matching the pattern used by all other modes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -521,6 +521,11 @@ const SSTV = (function() {
|
||||
const frequency = parseFloat(freqInput?.value || ISS_FREQ);
|
||||
const device = parseInt(deviceSelect?.value || '0', 10);
|
||||
|
||||
// Check if device is available
|
||||
if (typeof checkDeviceAvailability === 'function' && !checkDeviceAvailability('sstv')) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateStatusUI('connecting', 'Starting...');
|
||||
|
||||
try {
|
||||
@@ -534,6 +539,9 @@ const SSTV = (function() {
|
||||
|
||||
if (data.status === 'started' || data.status === 'already_running') {
|
||||
isRunning = true;
|
||||
if (typeof reserveDevice === 'function') {
|
||||
reserveDevice(device, 'sstv');
|
||||
}
|
||||
updateStatusUI('listening', `${frequency} MHz`);
|
||||
startStream();
|
||||
showNotification('SSTV', `Listening on ${frequency} MHz`);
|
||||
@@ -555,6 +563,9 @@ const SSTV = (function() {
|
||||
try {
|
||||
await fetch('/sstv/stop', { method: 'POST' });
|
||||
isRunning = false;
|
||||
if (typeof releaseDevice === 'function') {
|
||||
releaseDevice('sstv');
|
||||
}
|
||||
stopStream();
|
||||
updateStatusUI('idle', 'Stopped');
|
||||
showNotification('SSTV', 'Decoder stopped');
|
||||
|
||||
Reference in New Issue
Block a user