[feat](trx-reporting): add callsign field to AprsFiConfig

Allow specifying the IGate callsign directly in [aprsfi] instead of
relying on [general].callsign. The aprsfi-specific callsign takes
precedence; [general].callsign is used as fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-14 09:35:32 +01:00
parent fed8948a61
commit 872e086763
2 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -45,8 +45,10 @@ pub struct AprsFiConfig {
pub host: String, pub host: String,
/// APRS-IS server port /// APRS-IS server port
pub port: u16, pub port: u16,
/// APRS-IS passcode. -1 = auto-compute from [general].callsign. /// APRS-IS passcode. -1 = auto-compute from callsign.
pub passcode: i32, pub passcode: i32,
/// IGate callsign. Overrides [general].callsign when set.
pub callsign: Option<String>,
} }
impl Default for AprsFiConfig { impl Default for AprsFiConfig {
@@ -56,6 +58,7 @@ impl Default for AprsFiConfig {
host: "rotate.aprs.net".to_string(), host: "rotate.aprs.net".to_string(),
port: 14580, port: 14580,
passcode: -1, passcode: -1,
callsign: None,
} }
} }
} }
+8 -2
View File
@@ -502,10 +502,16 @@ fn spawn_rig_audio_stack(
} }
if rig_cfg.aprsfi.enabled { if rig_cfg.aprsfi.enabled {
let cs = callsign.clone().unwrap_or_default(); let cs = rig_cfg
.aprsfi
.callsign
.clone()
.or_else(|| callsign.clone())
.unwrap_or_default();
if cs.trim().is_empty() { if cs.trim().is_empty() {
warn!( warn!(
"[{}] APRS-IS IGate enabled but [general].callsign is empty; uplink disabled", "[{}] APRS-IS IGate enabled but callsign is not set \
(set [aprsfi].callsign or [general].callsign); uplink disabled",
rig_cfg.id rig_cfg.id
); );
} else { } else {