[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:
@@ -35,6 +35,7 @@ pub enum RigCommand {
|
|||||||
SetBandwidth(u32),
|
SetBandwidth(u32),
|
||||||
SetFirTaps(u32),
|
SetFirTaps(u32),
|
||||||
SetSdrGain(f64),
|
SetSdrGain(f64),
|
||||||
|
SetSdrSquelch { enabled: bool, threshold_db: f64 },
|
||||||
SetWfmDeemphasis(u32),
|
SetWfmDeemphasis(u32),
|
||||||
SetWfmStereo(bool),
|
SetWfmStereo(bool),
|
||||||
SetWfmDenoise(WfmDenoiseLevel),
|
SetWfmDenoise(WfmDenoiseLevel),
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
|
|||||||
| RigCommand::SetBandwidth(_)
|
| RigCommand::SetBandwidth(_)
|
||||||
| RigCommand::SetFirTaps(_)
|
| RigCommand::SetFirTaps(_)
|
||||||
| RigCommand::SetSdrGain(_)
|
| RigCommand::SetSdrGain(_)
|
||||||
|
| RigCommand::SetSdrSquelch { .. }
|
||||||
| RigCommand::SetWfmDeemphasis(_)
|
| RigCommand::SetWfmDeemphasis(_)
|
||||||
| RigCommand::SetWfmStereo(_)
|
| RigCommand::SetWfmStereo(_)
|
||||||
| RigCommand::SetWfmDenoise(_)
|
| RigCommand::SetWfmDenoise(_)
|
||||||
|
|||||||
@@ -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>(
|
fn set_wfm_stereo<'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
_enabled: bool,
|
_enabled: bool,
|
||||||
|
|||||||
@@ -278,6 +278,10 @@ pub struct RigFilterState {
|
|||||||
pub cw_center_hz: u32,
|
pub cw_center_hz: u32,
|
||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub sdr_gain_db: Option<f64>,
|
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")]
|
#[serde(default = "default_wfm_deemphasis_us")]
|
||||||
pub wfm_deemphasis_us: u32,
|
pub wfm_deemphasis_us: u32,
|
||||||
#[serde(default = "default_wfm_stereo")]
|
#[serde(default = "default_wfm_stereo")]
|
||||||
|
|||||||
Reference in New Issue
Block a user