From 1a8bfb3c4e99f8ddf652a20586f51d79370562dc Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Mon, 16 Mar 2026 23:17:10 +0100 Subject: [PATCH] [refactor](trx-protocol): remove SetFirTaps from client protocol Drop SetFirTaps ClientCommand variant and its mapping to/from RigCommand. Remove fir_taps from RigFilterState codec tests. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Stanislaw Grams --- src/trx-protocol/src/codec.rs | 10 ++++++---- src/trx-protocol/src/mapping.rs | 2 -- src/trx-protocol/src/types.rs | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/trx-protocol/src/codec.rs b/src/trx-protocol/src/codec.rs index 38d6f5a..9d37513 100644 --- a/src/trx-protocol/src/codec.rs +++ b/src/trx-protocol/src/codec.rs @@ -305,9 +305,10 @@ mod tests { let snap_json = serde_json::to_string(&RigSnapshot { filter: Some(RigFilterState { bandwidth_hz: 3000, - fir_taps: 64, cw_center_hz: 700, sdr_gain_db: Some(12.0), + sdr_lna_gain_db: None, + sdr_agc_enabled: None, sdr_squelch_enabled: None, sdr_squelch_threshold_db: None, wfm_deemphasis_us: 75, @@ -323,7 +324,6 @@ mod tests { "filter=Some should be serialized" ); assert!(snap_json.contains("\"bandwidth_hz\":3000")); - assert!(snap_json.contains("\"fir_taps\":64")); } #[test] @@ -347,9 +347,10 @@ mod tests { let orig = RigSnapshot { filter: Some(RigFilterState { bandwidth_hz: 12000, - fir_taps: 128, cw_center_hz: 700, sdr_gain_db: Some(18.0), + sdr_lna_gain_db: None, + sdr_agc_enabled: None, sdr_squelch_enabled: None, sdr_squelch_threshold_db: None, wfm_deemphasis_us: 50, @@ -363,7 +364,6 @@ mod tests { let decoded: RigSnapshot = serde_json::from_str(&json).unwrap(); let f = decoded.filter.expect("filter should round-trip"); assert_eq!(f.bandwidth_hz, 12000); - assert_eq!(f.fir_taps, 128); assert_eq!(f.sdr_gain_db, Some(18.0)); assert_eq!(f.wfm_deemphasis_us, 50); assert!(f.wfm_stereo_detected); @@ -426,6 +426,8 @@ mod tests { hf_aprs_decode_enabled: false, cw_decode_enabled: false, ft8_decode_enabled: false, + ft4_decode_enabled: false, + ft2_decode_enabled: false, wspr_decode_enabled: false, cw_auto: false, cw_wpm: 0, diff --git a/src/trx-protocol/src/mapping.rs b/src/trx-protocol/src/mapping.rs index 3c8199a..d177ae6 100644 --- a/src/trx-protocol/src/mapping.rs +++ b/src/trx-protocol/src/mapping.rs @@ -55,7 +55,6 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand { ClientCommand::ResetFt2Decoder => RigCommand::ResetFt2Decoder, ClientCommand::ResetWsprDecoder => RigCommand::ResetWsprDecoder, ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz), - ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps), ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db), ClientCommand::SetSdrLnaGain { gain_db } => RigCommand::SetSdrLnaGain(gain_db), ClientCommand::SetSdrAgc { enabled } => RigCommand::SetSdrAgc(enabled), @@ -119,7 +118,6 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand { RigCommand::ResetFt2Decoder => ClientCommand::ResetFt2Decoder, RigCommand::ResetWsprDecoder => ClientCommand::ResetWsprDecoder, RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz }, - RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps }, RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db }, RigCommand::SetSdrLnaGain(gain_db) => ClientCommand::SetSdrLnaGain { gain_db }, RigCommand::SetSdrAgc(enabled) => ClientCommand::SetSdrAgc { enabled }, diff --git a/src/trx-protocol/src/types.rs b/src/trx-protocol/src/types.rs index efc1239..affc1a7 100644 --- a/src/trx-protocol/src/types.rs +++ b/src/trx-protocol/src/types.rs @@ -44,7 +44,6 @@ pub enum ClientCommand { ResetFt2Decoder, ResetWsprDecoder, SetBandwidth { bandwidth_hz: u32 }, - SetFirTaps { taps: u32 }, SetSdrGain { gain_db: f64 }, SetSdrLnaGain { gain_db: f64 }, SetSdrAgc { enabled: bool },