[feat](trx-core): add SDR squelch command and state fields

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:09 +01:00
parent 3d9003feb2
commit 5597a8c206
4 changed files with 17 additions and 0 deletions
+1
View File
@@ -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),
@@ -517,6 +517,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
| RigCommand::SetBandwidth(_)
| RigCommand::SetFirTaps(_)
| RigCommand::SetSdrGain(_)
| RigCommand::SetSdrSquelch { .. }
| RigCommand::SetWfmDeemphasis(_)
| RigCommand::SetWfmStereo(_)
| RigCommand::SetWfmDenoise(_)
+11
View File
@@ -190,6 +190,17 @@ pub trait RigCat: Rig + Send {
)))
}
fn set_sdr_squelch<'a>(
&'a mut self,
_enabled: bool,
_threshold_db: f64,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_sdr_squelch"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
fn set_wfm_stereo<'a>(
&'a mut self,
_enabled: bool,
+4
View File
@@ -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<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sdr_squelch_enabled: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sdr_squelch_threshold_db: Option<f64>,
#[serde(default = "default_wfm_deemphasis_us")]
pub wfm_deemphasis_us: u32,
#[serde(default = "default_wfm_stereo")]