[feat](trx-protocol): add SDR squelch command mapping

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-05 22:43:13 +01:00
parent 5597a8c206
commit 3188c9b0ad
3 changed files with 21 additions and 2 deletions
+6 -2
View File
@@ -310,10 +310,12 @@ mod tests {
fir_taps: 64,
cw_center_hz: 700,
sdr_gain_db: Some(12.0),
sdr_squelch_enabled: None,
sdr_squelch_threshold_db: None,
wfm_deemphasis_us: 75,
wfm_stereo: true,
wfm_stereo_detected: false,
wfm_denoise: true,
wfm_denoise: trx_core::WfmDenoiseLevel::Auto,
}),
..minimal_snapshot()
})
@@ -350,10 +352,12 @@ mod tests {
fir_taps: 128,
cw_center_hz: 700,
sdr_gain_db: Some(18.0),
sdr_squelch_enabled: None,
sdr_squelch_threshold_db: None,
wfm_deemphasis_us: 50,
wfm_stereo: true,
wfm_stereo_detected: true,
wfm_denoise: true,
wfm_denoise: trx_core::WfmDenoiseLevel::Auto,
}),
..minimal_snapshot()
};
+14
View File
@@ -49,6 +49,13 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps),
ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db),
ClientCommand::SetSdrSquelch {
enabled,
threshold_db,
} => RigCommand::SetSdrSquelch {
enabled,
threshold_db,
},
ClientCommand::SetWfmDeemphasis { deemphasis_us } => {
RigCommand::SetWfmDeemphasis(deemphasis_us)
}
@@ -96,6 +103,13 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand {
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps },
RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db },
RigCommand::SetSdrSquelch {
enabled,
threshold_db,
} => ClientCommand::SetSdrSquelch {
enabled,
threshold_db,
},
RigCommand::SetWfmDeemphasis(deemphasis_us) => {
ClientCommand::SetWfmDeemphasis { deemphasis_us }
}
+1
View File
@@ -40,6 +40,7 @@ pub enum ClientCommand {
SetBandwidth { bandwidth_hz: u32 },
SetFirTaps { taps: u32 },
SetSdrGain { gain_db: f64 },
SetSdrSquelch { enabled: bool, threshold_db: f64 },
SetWfmDeemphasis { deemphasis_us: u32 },
SetWfmStereo { enabled: bool },
SetWfmDenoise { level: WfmDenoiseLevel },