[feat](trx-core): add SetSdrLnaGain command and sdr_lna_gain_db state
Add RigCommand::SetSdrLnaGain(f64), the corresponding default RigCat trait method set_sdr_lna_gain, and an sdr_lna_gain_db: Option<f64> field to RigFilterState for backends that expose a named LNA gain element. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -41,6 +41,7 @@ pub enum RigCommand {
|
||||
SetBandwidth(u32),
|
||||
SetFirTaps(u32),
|
||||
SetSdrGain(f64),
|
||||
SetSdrLnaGain(f64),
|
||||
SetSdrAgc(bool),
|
||||
SetSdrSquelch { enabled: bool, threshold_db: f64 },
|
||||
SetWfmDeemphasis(u32),
|
||||
|
||||
@@ -523,6 +523,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
|
||||
| RigCommand::SetBandwidth(_)
|
||||
| RigCommand::SetFirTaps(_)
|
||||
| RigCommand::SetSdrGain(_)
|
||||
| RigCommand::SetSdrLnaGain(_)
|
||||
| RigCommand::SetSdrAgc(_)
|
||||
| RigCommand::SetSdrSquelch { .. }
|
||||
| RigCommand::SetWfmDeemphasis(_)
|
||||
|
||||
@@ -190,6 +190,16 @@ pub trait RigCat: Rig + Send {
|
||||
)))
|
||||
}
|
||||
|
||||
fn set_sdr_lna_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_lna_gain"))
|
||||
as Box<dyn std::error::Error + Send + Sync>,
|
||||
)))
|
||||
}
|
||||
|
||||
fn set_sdr_agc<'a>(
|
||||
&'a mut self,
|
||||
_enabled: bool,
|
||||
|
||||
@@ -313,6 +313,8 @@ pub struct RigFilterState {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_gain_db: Option<f64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_lna_gain_db: Option<f64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_agc_enabled: Option<bool>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_squelch_enabled: Option<bool>,
|
||||
|
||||
Reference in New Issue
Block a user