Version bump to 0.5.3, formatting improvements

This commit is contained in:
Wouter Bokslag
2026-03-19 16:00:58 +01:00
parent 61601612bb
commit 9db59a9e97
6 changed files with 59 additions and 67 deletions

18
Cargo.lock generated
View File

@@ -170,7 +170,7 @@ dependencies = [
[[package]]
name = "bluestation-bs"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"clap",
"ctrlc",
@@ -787,7 +787,7 @@ dependencies = [
[[package]]
name = "net-tnmm-test"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"clap",
"tetra-config",
@@ -802,7 +802,7 @@ dependencies = [
[[package]]
name = "net-tnmm-test-quic"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"quinn",
"rcgen",
@@ -964,7 +964,7 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
[[package]]
name = "pdu-tool"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"clap",
"tetra-config",
@@ -1605,7 +1605,7 @@ dependencies = [
[[package]]
name = "tetra-config"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"chrono-tz",
"serde",
@@ -1615,7 +1615,7 @@ dependencies = [
[[package]]
name = "tetra-core"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"const_format",
"git-version",
@@ -1627,7 +1627,7 @@ dependencies = [
[[package]]
name = "tetra-entities"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"as-any",
"bitcode",
@@ -1657,7 +1657,7 @@ dependencies = [
[[package]]
name = "tetra-pdus"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"tetra-config",
"tetra-core",
@@ -1667,7 +1667,7 @@ dependencies = [
[[package]]
name = "tetra-saps"
version = "0.5.2"
version = "0.5.3"
dependencies = [
"tetra-core",
"tracing",

View File

@@ -17,7 +17,7 @@ members = [
]
[workspace.package]
version = "0.5.2"
version = "0.5.3"
edition = "2024"
authors = ["Wouter Bokslag / Midnight Blue"]
license = "MIT"

View File

@@ -3,7 +3,7 @@ use std::collections::HashMap;
use serde::Deserialize;
use toml::Value;
use crate::bluestation::{CfgLimeSdr, CfgSoapySdr, CfgSxCeiver, CfgUsrpB2xx, CfgPluto, SoapySdrDto, SoapySdrIoCfg};
use crate::bluestation::{CfgLimeSdr, CfgPluto, CfgSoapySdr, CfgSxCeiver, CfgUsrpB2xx, SoapySdrDto, SoapySdrIoCfg};
/// The PHY layer backend type
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]

View File

@@ -176,4 +176,3 @@ pub struct PlutoDto {
pub usb_direct: Option<bool>,
pub direct: Option<bool>,
}

View File

@@ -58,16 +58,19 @@ pub fn get_device_arguments(io_cfg: &SoapySdrIoCfg, _mode: Mode) -> Vec<(String,
// If cfg is None, use default which sets all optional fields to None.
let cfg_pluto = if let Some(cfg) = cfg { &cfg } else { &CfgPluto::default() };
args.push(("direct".to_string(), cfg_pluto.direct.map_or("1", |v| if v {"1"} else {"0"}).to_string()));
args.push((
"direct".to_string(),
cfg_pluto.direct.map_or("1", |v| if v { "1" } else { "0" }).to_string(),
));
args.push(("timestamp_every".to_string(), cfg_pluto.timestamp_every.unwrap_or(1500).to_string()));
if let Some(ref uri) = cfg_pluto.uri {
args.push(("uri".to_string(), uri.to_string()));
}
if let Some(loopback) = cfg_pluto.loopback {
args.push(("loopback".to_string(), (if loopback {"1"} else {"0"}).to_string()));
args.push(("loopback".to_string(), (if loopback { "1" } else { "0" }).to_string()));
}
},
_ => { },
}
_ => {}
}
args
@@ -75,23 +78,14 @@ pub fn get_device_arguments(io_cfg: &SoapySdrIoCfg, _mode: Mode) -> Vec<(String,
impl SdrSettings {
/// Get settings based on SDR type
pub fn get_settings(
io_cfg: &SoapySdrIoCfg,
driver_key: &str,
hardware_key: &str,
mode: Mode,
) -> Self {
pub fn get_settings(io_cfg: &SoapySdrIoCfg, driver_key: &str, hardware_key: &str, mode: Mode) -> Self {
match (driver_key, hardware_key) {
(_, "LimeSDR-USB") =>
Self::settings_limesdr(&io_cfg.iocfg_limesdr, mode, LimeSDRModel::LimeSDR),
(_, "LimeSDR-Mini_v2") =>
Self::settings_limesdr(&io_cfg.iocfg_limesdr, mode, LimeSDRModel::LimeSDRMini),
(_, "LimeSDR-USB") => Self::settings_limesdr(&io_cfg.iocfg_limesdr, mode, LimeSDRModel::LimeSDR),
(_, "LimeSDR-Mini_v2") => Self::settings_limesdr(&io_cfg.iocfg_limesdr, mode, LimeSDRModel::LimeSDRMini),
("sx", _) =>
Self::settings_sxceiver(&io_cfg.iocfg_sxceiver),
("sx", _) => Self::settings_sxceiver(&io_cfg.iocfg_sxceiver),
("uhd", _) | ("b200", _) =>
Self::settings_usrp_b2x0(&io_cfg.iocfg_usrpb2xx, mode),
("uhd", _) | ("b200", _) => Self::settings_usrp_b2x0(&io_cfg.iocfg_usrpb2xx, mode),
("PlutoSDR", _) => Self::settings_pluto(&io_cfg.iocfg_pluto, mode),
@@ -122,14 +116,24 @@ impl SdrSettings {
use_get_hardware_time: true,
fs: if mode == Mode::Mon { 16384e3 } else { 512e3 },
rx_ant: Some(cfg.rx_ant.clone().unwrap_or(match model {
LimeSDRModel::LimeSDR => "LNAL",
LimeSDRModel::LimeSDRMini => "LNAW",
}.to_string())),
tx_ant: Some(cfg.tx_ant.clone().unwrap_or(match model {
LimeSDRModel::LimeSDR => "BAND1",
LimeSDRModel::LimeSDRMini => "BAND2",
}.to_string())),
rx_ant: Some(
cfg.rx_ant.clone().unwrap_or(
match model {
LimeSDRModel::LimeSDR => "LNAL",
LimeSDRModel::LimeSDRMini => "LNAW",
}
.to_string(),
),
),
tx_ant: Some(
cfg.tx_ant.clone().unwrap_or(
match model {
LimeSDRModel::LimeSDR => "BAND1",
LimeSDRModel::LimeSDRMini => "BAND2",
}
.to_string(),
),
),
rx_gain: vec![
("LNA".to_string(), cfg.rx_gain_lna.unwrap_or(18.0)),
@@ -142,12 +146,8 @@ impl SdrSettings {
],
// Minimum latency for BS/MS, maximum throughput for monitor
rx_args: vec![
("latency".to_string(), if mode == Mode::Mon { "1" } else { "0" }.to_string()),
],
tx_args: vec![
("latency".to_string(), if mode == Mode::Mon { "1" } else { "0" }.to_string()),
],
rx_args: vec![("latency".to_string(), if mode == Mode::Mon { "1" } else { "0" }.to_string())],
tx_args: vec![("latency".to_string(), if mode == Mode::Mon { "1" } else { "0" }.to_string())],
}
}
@@ -159,7 +159,7 @@ impl SdrSettings {
SdrSettings {
name: "SXceiver".to_string(),
use_get_hardware_time: true,
fs: fs,
fs,
rx_ant: Some(cfg.rx_ant.clone().unwrap_or("RX".to_string())),
tx_ant: Some(cfg.tx_ant.clone().unwrap_or("TX".to_string())),
@@ -173,12 +173,8 @@ impl SdrSettings {
("MIXER".to_string(), cfg.tx_gain_mixer.unwrap_or(30.0)),
],
rx_args: vec![
("period".to_string(), block_size(fs).to_string()),
],
tx_args: vec![
("period".to_string(), block_size(fs).to_string()),
],
rx_args: vec![("period".to_string(), block_size(fs).to_string())],
tx_args: vec![("period".to_string(), block_size(fs).to_string())],
}
}
@@ -194,12 +190,8 @@ impl SdrSettings {
rx_ant: Some(cfg.rx_ant.clone().unwrap_or("TX/RX".to_string())),
tx_ant: Some(cfg.tx_ant.clone().unwrap_or("TX/RX".to_string())),
rx_gain: vec![
("PGA".to_string(), cfg.rx_gain_pga.unwrap_or(50.0)),
],
tx_gain: vec![
("PGA".to_string(), cfg.tx_gain_pga.unwrap_or(35.0)),
],
rx_gain: vec![("PGA".to_string(), cfg.rx_gain_pga.unwrap_or(50.0))],
tx_gain: vec![("PGA".to_string(), cfg.tx_gain_pga.unwrap_or(35.0))],
rx_args: vec![],
tx_args: vec![],
@@ -218,12 +210,8 @@ impl SdrSettings {
rx_ant: Some(cfg.rx_ant.clone().unwrap_or("A_BALANCED".to_string())),
tx_ant: Some(cfg.tx_ant.clone().unwrap_or("A".to_string())),
rx_gain: vec![
("PGA".to_string(), cfg.rx_gain_pga.unwrap_or(20.0)),
],
tx_gain: vec![
("PGA".to_string(), cfg.tx_gain_pga.unwrap_or(89.0)),
],
rx_gain: vec![("PGA".to_string(), cfg.rx_gain_pga.unwrap_or(20.0))],
tx_gain: vec![("PGA".to_string(), cfg.tx_gain_pga.unwrap_or(89.0))],
rx_args: vec![],
tx_args: vec![],
@@ -237,7 +225,6 @@ enum LimeSDRModel {
LimeSDRMini,
}
/// Get processing block size in samples for a given sample rate.
/// This can be used to optimize performance for some SDRs.
pub fn block_size(fs: f64) -> usize {

View File

@@ -5,8 +5,8 @@ use tetra_pdus::phy::traits::rxtx_dev::RxTxDevError;
use super::dsp_types::*;
use super::soapy_settings;
use super::soapy_settings::SdrSettings;
pub use super::soapy_settings::Mode;
use super::soapy_settings::SdrSettings;
use super::soapy_time::{ticks_to_time_ns, time_ns_to_ticks};
type StreamType = ComplexSample;
@@ -117,14 +117,20 @@ impl SoapyIo {
let mut rx_fs: f64 = 0.0;
if rx_enabled {
soapycheck!("set RX sample rate", dev.set_sample_rate(soapysdr::Direction::Rx, rx_ch, sdr_settings.fs));
soapycheck!(
"set RX sample rate",
dev.set_sample_rate(soapysdr::Direction::Rx, rx_ch, sdr_settings.fs)
);
// Read the actual sample rate obtained and store it
// to avoid having to read it again every time it is needed.
rx_fs = soapycheck!("get RX sample rate", dev.sample_rate(soapysdr::Direction::Rx, rx_ch));
}
let mut tx_fs: f64 = 0.0;
if tx_enabled {
soapycheck!("set TX sample rate", dev.set_sample_rate(soapysdr::Direction::Tx, tx_ch, sdr_settings.fs));
soapycheck!(
"set TX sample rate",
dev.set_sample_rate(soapysdr::Direction::Tx, tx_ch, sdr_settings.fs)
);
tx_fs = soapycheck!("get TX sample rate", dev.sample_rate(soapysdr::Direction::Tx, tx_ch));
}