[feat](trx-protocol): add SDR squelch command mapping
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -310,10 +310,12 @@ mod tests {
|
|||||||
fir_taps: 64,
|
fir_taps: 64,
|
||||||
cw_center_hz: 700,
|
cw_center_hz: 700,
|
||||||
sdr_gain_db: Some(12.0),
|
sdr_gain_db: Some(12.0),
|
||||||
|
sdr_squelch_enabled: None,
|
||||||
|
sdr_squelch_threshold_db: None,
|
||||||
wfm_deemphasis_us: 75,
|
wfm_deemphasis_us: 75,
|
||||||
wfm_stereo: true,
|
wfm_stereo: true,
|
||||||
wfm_stereo_detected: false,
|
wfm_stereo_detected: false,
|
||||||
wfm_denoise: true,
|
wfm_denoise: trx_core::WfmDenoiseLevel::Auto,
|
||||||
}),
|
}),
|
||||||
..minimal_snapshot()
|
..minimal_snapshot()
|
||||||
})
|
})
|
||||||
@@ -350,10 +352,12 @@ mod tests {
|
|||||||
fir_taps: 128,
|
fir_taps: 128,
|
||||||
cw_center_hz: 700,
|
cw_center_hz: 700,
|
||||||
sdr_gain_db: Some(18.0),
|
sdr_gain_db: Some(18.0),
|
||||||
|
sdr_squelch_enabled: None,
|
||||||
|
sdr_squelch_threshold_db: None,
|
||||||
wfm_deemphasis_us: 50,
|
wfm_deemphasis_us: 50,
|
||||||
wfm_stereo: true,
|
wfm_stereo: true,
|
||||||
wfm_stereo_detected: true,
|
wfm_stereo_detected: true,
|
||||||
wfm_denoise: true,
|
wfm_denoise: trx_core::WfmDenoiseLevel::Auto,
|
||||||
}),
|
}),
|
||||||
..minimal_snapshot()
|
..minimal_snapshot()
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
|
|||||||
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
|
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
|
||||||
ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps),
|
ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps),
|
||||||
ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db),
|
ClientCommand::SetSdrGain { gain_db } => RigCommand::SetSdrGain(gain_db),
|
||||||
|
ClientCommand::SetSdrSquelch {
|
||||||
|
enabled,
|
||||||
|
threshold_db,
|
||||||
|
} => RigCommand::SetSdrSquelch {
|
||||||
|
enabled,
|
||||||
|
threshold_db,
|
||||||
|
},
|
||||||
ClientCommand::SetWfmDeemphasis { deemphasis_us } => {
|
ClientCommand::SetWfmDeemphasis { deemphasis_us } => {
|
||||||
RigCommand::SetWfmDeemphasis(deemphasis_us)
|
RigCommand::SetWfmDeemphasis(deemphasis_us)
|
||||||
}
|
}
|
||||||
@@ -96,6 +103,13 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand {
|
|||||||
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
|
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
|
||||||
RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps },
|
RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps },
|
||||||
RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db },
|
RigCommand::SetSdrGain(gain_db) => ClientCommand::SetSdrGain { gain_db },
|
||||||
|
RigCommand::SetSdrSquelch {
|
||||||
|
enabled,
|
||||||
|
threshold_db,
|
||||||
|
} => ClientCommand::SetSdrSquelch {
|
||||||
|
enabled,
|
||||||
|
threshold_db,
|
||||||
|
},
|
||||||
RigCommand::SetWfmDeemphasis(deemphasis_us) => {
|
RigCommand::SetWfmDeemphasis(deemphasis_us) => {
|
||||||
ClientCommand::SetWfmDeemphasis { deemphasis_us }
|
ClientCommand::SetWfmDeemphasis { deemphasis_us }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ pub enum ClientCommand {
|
|||||||
SetBandwidth { bandwidth_hz: u32 },
|
SetBandwidth { bandwidth_hz: u32 },
|
||||||
SetFirTaps { taps: u32 },
|
SetFirTaps { taps: u32 },
|
||||||
SetSdrGain { gain_db: f64 },
|
SetSdrGain { gain_db: f64 },
|
||||||
|
SetSdrSquelch { enabled: bool, threshold_db: f64 },
|
||||||
SetWfmDeemphasis { deemphasis_us: u32 },
|
SetWfmDeemphasis { deemphasis_us: u32 },
|
||||||
SetWfmStereo { enabled: bool },
|
SetWfmStereo { enabled: bool },
|
||||||
SetWfmDenoise { level: WfmDenoiseLevel },
|
SetWfmDenoise { level: WfmDenoiseLevel },
|
||||||
|
|||||||
Reference in New Issue
Block a user