[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 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -305,9 +305,10 @@ mod tests {
|
|||||||
let snap_json = serde_json::to_string(&RigSnapshot {
|
let snap_json = serde_json::to_string(&RigSnapshot {
|
||||||
filter: Some(RigFilterState {
|
filter: Some(RigFilterState {
|
||||||
bandwidth_hz: 3000,
|
bandwidth_hz: 3000,
|
||||||
fir_taps: 64,
|
|
||||||
cw_center_hz: 700,
|
cw_center_hz: 700,
|
||||||
sdr_gain_db: Some(12.0),
|
sdr_gain_db: Some(12.0),
|
||||||
|
sdr_lna_gain_db: None,
|
||||||
|
sdr_agc_enabled: None,
|
||||||
sdr_squelch_enabled: None,
|
sdr_squelch_enabled: None,
|
||||||
sdr_squelch_threshold_db: None,
|
sdr_squelch_threshold_db: None,
|
||||||
wfm_deemphasis_us: 75,
|
wfm_deemphasis_us: 75,
|
||||||
@@ -323,7 +324,6 @@ mod tests {
|
|||||||
"filter=Some should be serialized"
|
"filter=Some should be serialized"
|
||||||
);
|
);
|
||||||
assert!(snap_json.contains("\"bandwidth_hz\":3000"));
|
assert!(snap_json.contains("\"bandwidth_hz\":3000"));
|
||||||
assert!(snap_json.contains("\"fir_taps\":64"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -347,9 +347,10 @@ mod tests {
|
|||||||
let orig = RigSnapshot {
|
let orig = RigSnapshot {
|
||||||
filter: Some(RigFilterState {
|
filter: Some(RigFilterState {
|
||||||
bandwidth_hz: 12000,
|
bandwidth_hz: 12000,
|
||||||
fir_taps: 128,
|
|
||||||
cw_center_hz: 700,
|
cw_center_hz: 700,
|
||||||
sdr_gain_db: Some(18.0),
|
sdr_gain_db: Some(18.0),
|
||||||
|
sdr_lna_gain_db: None,
|
||||||
|
sdr_agc_enabled: None,
|
||||||
sdr_squelch_enabled: None,
|
sdr_squelch_enabled: None,
|
||||||
sdr_squelch_threshold_db: None,
|
sdr_squelch_threshold_db: None,
|
||||||
wfm_deemphasis_us: 50,
|
wfm_deemphasis_us: 50,
|
||||||
@@ -363,7 +364,6 @@ mod tests {
|
|||||||
let decoded: RigSnapshot = serde_json::from_str(&json).unwrap();
|
let decoded: RigSnapshot = serde_json::from_str(&json).unwrap();
|
||||||
let f = decoded.filter.expect("filter should round-trip");
|
let f = decoded.filter.expect("filter should round-trip");
|
||||||
assert_eq!(f.bandwidth_hz, 12000);
|
assert_eq!(f.bandwidth_hz, 12000);
|
||||||
assert_eq!(f.fir_taps, 128);
|
|
||||||
assert_eq!(f.sdr_gain_db, Some(18.0));
|
assert_eq!(f.sdr_gain_db, Some(18.0));
|
||||||
assert_eq!(f.wfm_deemphasis_us, 50);
|
assert_eq!(f.wfm_deemphasis_us, 50);
|
||||||
assert!(f.wfm_stereo_detected);
|
assert!(f.wfm_stereo_detected);
|
||||||
@@ -426,6 +426,8 @@ mod tests {
|
|||||||
hf_aprs_decode_enabled: false,
|
hf_aprs_decode_enabled: false,
|
||||||
cw_decode_enabled: false,
|
cw_decode_enabled: false,
|
||||||
ft8_decode_enabled: false,
|
ft8_decode_enabled: false,
|
||||||
|
ft4_decode_enabled: false,
|
||||||
|
ft2_decode_enabled: false,
|
||||||
wspr_decode_enabled: false,
|
wspr_decode_enabled: false,
|
||||||
cw_auto: false,
|
cw_auto: false,
|
||||||
cw_wpm: 0,
|
cw_wpm: 0,
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
|
|||||||
ClientCommand::ResetFt2Decoder => RigCommand::ResetFt2Decoder,
|
ClientCommand::ResetFt2Decoder => RigCommand::ResetFt2Decoder,
|
||||||
ClientCommand::ResetWsprDecoder => RigCommand::ResetWsprDecoder,
|
ClientCommand::ResetWsprDecoder => RigCommand::ResetWsprDecoder,
|
||||||
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
|
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
|
||||||
ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps),
|
|
||||||
ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db),
|
ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db),
|
||||||
ClientCommand::SetSdrLnaGain { gain_db } => RigCommand::SetSdrLnaGain(gain_db),
|
ClientCommand::SetSdrLnaGain { gain_db } => RigCommand::SetSdrLnaGain(gain_db),
|
||||||
ClientCommand::SetSdrAgc { enabled } => RigCommand::SetSdrAgc(enabled),
|
ClientCommand::SetSdrAgc { enabled } => RigCommand::SetSdrAgc(enabled),
|
||||||
@@ -119,7 +118,6 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand {
|
|||||||
RigCommand::ResetFt2Decoder => ClientCommand::ResetFt2Decoder,
|
RigCommand::ResetFt2Decoder => ClientCommand::ResetFt2Decoder,
|
||||||
RigCommand::ResetWsprDecoder => ClientCommand::ResetWsprDecoder,
|
RigCommand::ResetWsprDecoder => ClientCommand::ResetWsprDecoder,
|
||||||
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
|
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
|
||||||
RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps },
|
|
||||||
RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db },
|
RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db },
|
||||||
RigCommand::SetSdrLnaGain(gain_db) => ClientCommand::SetSdrLnaGain { gain_db },
|
RigCommand::SetSdrLnaGain(gain_db) => ClientCommand::SetSdrLnaGain { gain_db },
|
||||||
RigCommand::SetSdrAgc(enabled) => ClientCommand::SetSdrAgc { enabled },
|
RigCommand::SetSdrAgc(enabled) => ClientCommand::SetSdrAgc { enabled },
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ pub enum ClientCommand {
|
|||||||
ResetFt2Decoder,
|
ResetFt2Decoder,
|
||||||
ResetWsprDecoder,
|
ResetWsprDecoder,
|
||||||
SetBandwidth { bandwidth_hz: u32 },
|
SetBandwidth { bandwidth_hz: u32 },
|
||||||
SetFirTaps { taps: u32 },
|
|
||||||
SetSdrGain { gain_db: f64 },
|
SetSdrGain { gain_db: f64 },
|
||||||
SetSdrLnaGain { gain_db: f64 },
|
SetSdrLnaGain { gain_db: f64 },
|
||||||
SetSdrAgc { enabled: bool },
|
SetSdrAgc { enabled: bool },
|
||||||
|
|||||||
Reference in New Issue
Block a user