[feat](trx-rs): expose live sdr gain control

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 23:30:08 +01:00
parent 93e507606e
commit 617255cd32
15 changed files with 138 additions and 0 deletions
+3
View File
@@ -297,6 +297,7 @@ mod tests {
bandwidth_hz: 3000,
fir_taps: 64,
cw_center_hz: 700,
sdr_gain_db: Some(12.0),
wfm_deemphasis_us: 75,
wfm_stereo: true,
wfm_stereo_detected: false,
@@ -335,6 +336,7 @@ mod tests {
bandwidth_hz: 12000,
fir_taps: 128,
cw_center_hz: 700,
sdr_gain_db: Some(18.0),
wfm_deemphasis_us: 50,
wfm_stereo: true,
wfm_stereo_detected: true,
@@ -346,6 +348,7 @@ mod tests {
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);
}
+2
View File
@@ -48,6 +48,7 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
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::SetWfmDeemphasis { deemphasis_us } => {
RigCommand::SetWfmDeemphasis(deemphasis_us)
}
@@ -93,6 +94,7 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand {
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::SetWfmDeemphasis(deemphasis_us) => {
ClientCommand::SetWfmDeemphasis { deemphasis_us }
}
+1
View File
@@ -38,6 +38,7 @@ pub enum ClientCommand {
ResetWsprDecoder,
SetBandwidth { bandwidth_hz: u32 },
SetFirTaps { taps: u32 },
SetSdrGain { gain_db: f64 },
SetWfmDeemphasis { deemphasis_us: u32 },
SetWfmStereo { enabled: bool },
GetSpectrum,