[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
+1
View File
@@ -33,6 +33,7 @@ pub enum RigCommand {
ResetWsprDecoder,
SetBandwidth(u32),
SetFirTaps(u32),
SetSdrGain(f64),
SetWfmDeemphasis(u32),
SetWfmStereo(bool),
GetSpectrum,
@@ -516,6 +516,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
| RigCommand::ResetWsprDecoder
| RigCommand::SetBandwidth(_)
| RigCommand::SetFirTaps(_)
| RigCommand::SetSdrGain(_)
| RigCommand::SetWfmDeemphasis(_)
| RigCommand::SetWfmStereo(_)
| RigCommand::GetSpectrum => Box::new(GetSnapshotCommand),
+10
View File
@@ -165,6 +165,16 @@ pub trait RigCat: Rig + Send {
)))
}
fn set_sdr_gain<'a>(
&'a mut self,
_gain_db: f64,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_sdr_gain"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
fn set_wfm_stereo<'a>(
&'a mut self,
_enabled: bool,
+2
View File
@@ -269,6 +269,8 @@ pub struct RigFilterState {
pub bandwidth_hz: u32,
pub fir_taps: u32,
pub cw_center_hz: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sdr_gain_db: Option<f64>,
#[serde(default = "default_wfm_deemphasis_us")]
pub wfm_deemphasis_us: u32,
#[serde(default = "default_wfm_stereo")]