[feat](trx-rs): remap decoder modes — remove DIG/PKT from SDR, wire decoders to standard modes

For SDR backends, DIG and PKT are removed from supported_modes and
replaced by USB and FM respectively. CAT backends (FT-817, FT-450D)
retain DIG/PKT as before.

Decoder mode allowances updated:
- APRS: FM | PKT (was PKT only)
- HF-APRS: USB | DIG (was DIG only)
- AIS: AIS | FM | PKT (was AIS only)
- VDES: VDES | FM (was VDES only)
- FT8/FT4/FT2/WSPR: USB | DIG (unchanged)
- CW: CW | CWR (unchanged)
- LRPT: FM (unchanged, mode-independent)

Frontend status text, bookmark decoder toggles, background-decode
fallbacks, and scheduler wiring updated to match.

https://claude.ai/code/session_01DCAaMH8RF5FNB2gRtVu4pY
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-30 16:32:23 +00:00
committed by Stan Grams
parent f944cc0790
commit 5c43bac42b
11 changed files with 41 additions and 41 deletions
@@ -3241,22 +3241,22 @@ function render(update) {
const wsprStatus = document.getElementById("wspr-status");
setModeBoundDecodeStatus(
aisStatus,
["AIS"],
"Select AIS mode to decode",
["AIS", "FM", "PKT"],
"Select AIS or FM mode to decode",
"Connected, listening for packets",
);
if (window.updateAisBar) window.updateAisBar();
setModeBoundDecodeStatus(
vdesStatus,
["VDES"],
"Select VDES mode to decode",
["VDES", "FM"],
"Select VDES or FM mode to decode",
"Connected, listening for bursts",
);
if (window.updateVdesBar) window.updateVdesBar();
setModeBoundDecodeStatus(
aprsStatus,
["PKT"],
"Select PKT mode to decode",
["PKT", "FM"],
"Select FM mode to decode",
"Connected, listening for packets",
);
if (window.updateAprsBar) window.updateAprsBar();
@@ -8903,10 +8903,10 @@ function updateDecodeStatus(text) {
const ft8 = document.getElementById("ft8-status");
const ft4 = document.getElementById("ft4-status");
const ft2 = document.getElementById("ft2-status");
setModeBoundDecodeStatus(ais, ["AIS"], "Select AIS mode to decode", text);
setModeBoundDecodeStatus(ais, ["AIS", "FM", "PKT"], "Select AIS or FM mode to decode", text);
const vdesText = text === "Connected, listening for packets" ? "Connected, listening for bursts" : text;
setModeBoundDecodeStatus(vdes, ["VDES"], "Select VDES mode to decode", vdesText);
setModeBoundDecodeStatus(aprs, ["PKT"], "Select PKT mode to decode", text);
setModeBoundDecodeStatus(vdes, ["VDES", "FM"], "Select VDES or FM mode to decode", vdesText);
setModeBoundDecodeStatus(aprs, ["PKT", "FM"], "Select FM mode to decode", text);
const cwText = text === "Connected, listening for packets" ? "Connected, listening for CW" : text;
setModeBoundDecodeStatus(cw, ["CW", "CWR"], "Select CW mode to decode", cwText);
if (ft8 && ft8.textContent !== "Receiving") ft8.textContent = text;
@@ -449,14 +449,13 @@
<input type="number" id="bm-freq" class="status-input" required min="0" placeholder="e.g. 7074000" />
</label>
<label class="bm-label">Mode
<input type="text" id="bm-mode" class="status-input" list="bm-mode-list" required placeholder="e.g. DIG" />
<input type="text" id="bm-mode" class="status-input" list="bm-mode-list" required placeholder="e.g. USB" />
<datalist id="bm-mode-list">
<option value="LSB">
<option value="USB">
<option value="AM">
<option value="SAM">
<option value="FM">
<option value="DIG">
<option value="CW">
<option value="WFM">
</datalist>
@@ -561,25 +560,25 @@
<div class="plugin-item">
<strong>FT8 Decoder</strong>
<div style="color:var(--text-muted); font-size:0.85rem; margin-top:0.2rem;">
Decodes FT8 messages from RX audio (DIG/USB only, toggle required).
Decodes FT8 messages from RX audio (USB only, toggle required).
</div>
</div>
<div class="plugin-item">
<strong>FT4 Decoder</strong>
<div style="color:var(--text-muted); font-size:0.85rem; margin-top:0.2rem;">
Decodes FT4 messages from RX audio (DIG/USB only, toggle required). 7.5-second slots.
Decodes FT4 messages from RX audio (USB only, toggle required). 7.5-second slots.
</div>
</div>
<div class="plugin-item">
<strong>FT2 Decoder</strong>
<div style="color:var(--text-muted); font-size:0.85rem; margin-top:0.2rem;">
Decodes FT2 messages from RX audio (DIG/USB only, toggle required). 3.75-second slots.
Decodes FT2 messages from RX audio (USB only, toggle required). 3.75-second slots.
</div>
</div>
<div class="plugin-item">
<strong>WSPR Decoder</strong>
<div style="color:var(--text-muted); font-size:0.85rem; margin-top:0.2rem;">
Decodes WSPR messages from RX audio (DIG/USB only, toggle required).
Decodes WSPR messages from RX audio (USB only, toggle required).
</div>
</div>
<div class="plugin-item">
@@ -322,7 +322,8 @@ function renderAprsHistory() {
function updateAprsBar() {
if (!aprsBarOverlay) return;
const isPkt = (document.getElementById("mode")?.value || "").toUpperCase() === "PKT";
const modeVal = (document.getElementById("mode")?.value || "").toUpperCase();
const isPkt = modeVal === "PKT" || modeVal === "FM";
const cutoffMs = Date.now() - APRS_BAR_WINDOW_MS;
const okFrames = aprsPacketHistory.filter((p) => p.crcOk && p._tsMs >= cutoffMs);
const frames = collapseAprsDuplicates(okFrames).slice(0, 8);
@@ -102,7 +102,7 @@
if (supported.length > 0) return supported;
const mode = String(bookmark && bookmark.mode || "").trim().toUpperCase();
if (mode === "AIS") return ["ais"];
if (mode === "PKT") return ["aprs"];
if (mode === "PKT" || mode === "FM") return ["aprs"];
return supported;
}
@@ -428,9 +428,9 @@ async function bmApply(bm) {
await postPath("/set_freq?hz=" + bm.freq_hz);
}
})();
// Decoder toggles (DIG / FM modes) — also fire-and-forget.
// Decoder toggles (USB / DIG / FM / PKT modes) — also fire-and-forget.
const hasDecoders = Array.isArray(bm.decoders) && bm.decoders.length > 0;
const decoderMode = bm.mode === "DIG" || bm.mode === "FM";
const decoderMode = bm.mode === "USB" || bm.mode === "DIG" || bm.mode === "FM" || bm.mode === "PKT";
const decoderPromise = (hasDecoders && decoderMode) ? (async () => {
const statusResp = await fetch("/status");
if (statusResp.ok) {