diff --git a/src/trx-core/src/rig/command.rs b/src/trx-core/src/rig/command.rs index 1c874e2..0486da2 100644 --- a/src/trx-core/src/rig/command.rs +++ b/src/trx-core/src/rig/command.rs @@ -35,6 +35,7 @@ pub enum RigCommand { SetBandwidth(u32), SetFirTaps(u32), SetSdrGain(f64), + SetSdrSquelch { enabled: bool, threshold_db: f64 }, SetWfmDeemphasis(u32), SetWfmStereo(bool), SetWfmDenoise(WfmDenoiseLevel), diff --git a/src/trx-core/src/rig/controller/handlers.rs b/src/trx-core/src/rig/controller/handlers.rs index 8b92af8..768f4fc 100644 --- a/src/trx-core/src/rig/controller/handlers.rs +++ b/src/trx-core/src/rig/controller/handlers.rs @@ -517,6 +517,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box { | RigCommand::SetBandwidth(_) | RigCommand::SetFirTaps(_) | RigCommand::SetSdrGain(_) + | RigCommand::SetSdrSquelch { .. } | RigCommand::SetWfmDeemphasis(_) | RigCommand::SetWfmStereo(_) | RigCommand::SetWfmDenoise(_) diff --git a/src/trx-core/src/rig/mod.rs b/src/trx-core/src/rig/mod.rs index 24bf499..9045d5b 100644 --- a/src/trx-core/src/rig/mod.rs +++ b/src/trx-core/src/rig/mod.rs @@ -190,6 +190,17 @@ pub trait RigCat: Rig + Send { ))) } + fn set_sdr_squelch<'a>( + &'a mut self, + _enabled: bool, + _threshold_db: f64, + ) -> Pin> + Send + 'a>> { + Box::pin(std::future::ready(Err( + Box::new(response::RigError::not_supported("set_sdr_squelch")) + as Box, + ))) + } + fn set_wfm_stereo<'a>( &'a mut self, _enabled: bool, diff --git a/src/trx-core/src/rig/state.rs b/src/trx-core/src/rig/state.rs index b3141ef..fa2482c 100644 --- a/src/trx-core/src/rig/state.rs +++ b/src/trx-core/src/rig/state.rs @@ -278,6 +278,10 @@ pub struct RigFilterState { pub cw_center_hz: u32, #[serde(default, skip_serializing_if = "Option::is_none")] pub sdr_gain_db: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sdr_squelch_enabled: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sdr_squelch_threshold_db: Option, #[serde(default = "default_wfm_deemphasis_us")] pub wfm_deemphasis_us: u32, #[serde(default = "default_wfm_stereo")]