[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
+9 -9
View File
@@ -1183,7 +1183,7 @@ fn run_playback(
}
}
/// Run the APRS decoder task. Only processes PCM when rig mode is PKT.
/// Run the APRS decoder task. Only processes PCM when rig mode is FM or PKT.
pub async fn run_aprs_decoder(
sample_rate: u32,
channels: u16,
@@ -1257,9 +1257,9 @@ async fn run_aprs_decoder_inner(
let mode_match = |state: &RigState| -> bool {
if is_hf {
matches!(state.status.mode, RigMode::DIG)
matches!(state.status.mode, RigMode::USB | RigMode::DIG)
} else {
matches!(state.status.mode, RigMode::PKT)
matches!(state.status.mode, RigMode::FM | RigMode::PKT)
}
};
let get_reset_seq = |state: &RigState| -> u64 {
@@ -1405,14 +1405,14 @@ pub async fn run_ais_decoder(
let mut decoder_a = AisDecoder::new(sample_rate);
let mut decoder_b = AisDecoder::new(sample_rate);
let mut was_active = false;
let mut active = matches!(state_rx.borrow().status.mode, RigMode::AIS);
let mut active = matches!(state_rx.borrow().status.mode, RigMode::AIS | RigMode::FM | RigMode::PKT);
loop {
if !active {
match state_rx.changed().await {
Ok(()) => {
let state = state_rx.borrow();
active = matches!(state.status.mode, RigMode::AIS);
active = matches!(state.status.mode, RigMode::AIS | RigMode::FM | RigMode::PKT);
if active {
pcm_a_rx = pcm_a_rx.resubscribe();
pcm_b_rx = pcm_b_rx.resubscribe();
@@ -1476,7 +1476,7 @@ pub async fn run_ais_decoder(
match changed {
Ok(()) => {
let state = state_rx.borrow();
active = matches!(state.status.mode, RigMode::AIS);
active = matches!(state.status.mode, RigMode::AIS | RigMode::FM | RigMode::PKT);
if !active && was_active {
decoder_a.reset();
decoder_b.reset();
@@ -1505,14 +1505,14 @@ pub async fn run_vdes_decoder(
info!("VDES decoder started ({}Hz complex baseband)", sample_rate);
let mut decoder = VdesDecoder::new(sample_rate);
let mut was_active = false;
let mut active = matches!(state_rx.borrow().status.mode, RigMode::VDES);
let mut active = matches!(state_rx.borrow().status.mode, RigMode::VDES | RigMode::FM);
loop {
if !active {
match state_rx.changed().await {
Ok(()) => {
let state = state_rx.borrow();
active = matches!(state.status.mode, RigMode::VDES);
active = matches!(state.status.mode, RigMode::VDES | RigMode::FM);
if active {
iq_rx = iq_rx.resubscribe();
}
@@ -1550,7 +1550,7 @@ pub async fn run_vdes_decoder(
match changed {
Ok(()) => {
let state = state_rx.borrow();
active = matches!(state.status.mode, RigMode::VDES);
active = matches!(state.status.mode, RigMode::VDES | RigMode::FM);
if !active && was_active {
decoder.reset();
was_active = false;
@@ -158,7 +158,8 @@ impl SoapySdrRig {
fn default_bandwidth_for_mode(mode: &RigMode) -> u32 {
match mode {
RigMode::LSB | RigMode::USB | RigMode::DIG => 3_000,
RigMode::PKT | RigMode::AIS => 25_000,
RigMode::AIS => 25_000,
RigMode::PKT => 25_000,
RigMode::VDES => 100_000,
RigMode::CW | RigMode::CWR => 500,
RigMode::AM | RigMode::SAM => 9_000,
@@ -317,8 +318,6 @@ impl SoapySdrRig {
RigMode::FM,
RigMode::AIS,
RigMode::VDES,
RigMode::DIG,
RigMode::PKT,
],
num_vfos: 1,
lock: false,
@@ -504,7 +504,7 @@ mod tests {
mgr.add_channel(14_074_000, &RigMode::USB).unwrap();
let hidden_id = Uuid::new_v4();
mgr.ensure_background_channel_pcm(hidden_id, 14_075_000, &RigMode::DIG)
mgr.ensure_background_channel_pcm(hidden_id, 14_075_000, &RigMode::USB)
.unwrap();
let visible = mgr.channels();