From a3b1702710c1ad2e73617a816f0df1d12ff15091 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Sun, 8 Feb 2026 10:32:12 +0100 Subject: [PATCH] [feat](trx-client): preserve server callsign/version and default to N0CALL Carry server_callsign and server_version through from received snapshots into the local RigState. Default client callsign is N0CALL when not configured. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stanislaw Grams --- src/trx-client/src/config.rs | 11 ++++++++++- src/trx-client/src/main.rs | 2 ++ src/trx-client/src/remote_client.rs | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/trx-client/src/config.rs b/src/trx-client/src/config.rs index 7d2b222..8383521 100644 --- a/src/trx-client/src/config.rs +++ b/src/trx-client/src/config.rs @@ -28,7 +28,7 @@ pub struct ClientConfig { } /// General application settings. -#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(default)] pub struct GeneralConfig { /// Callsign or owner label to display in frontends @@ -37,6 +37,15 @@ pub struct GeneralConfig { pub log_level: Option, } +impl Default for GeneralConfig { + fn default() -> Self { + Self { + callsign: Some("N0CALL".to_string()), + log_level: None, + } + } +} + /// Remote connection configuration. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(default)] diff --git a/src/trx-client/src/main.rs b/src/trx-client/src/main.rs index 46e957d..a40c534 100644 --- a/src/trx-client/src/main.rs +++ b/src/trx-client/src/main.rs @@ -267,6 +267,8 @@ async fn async_init() -> DynResult { clar_on: None, enabled: Some(false), }, + server_callsign: None, + server_version: None, }; let (state_tx, state_rx) = watch::channel(initial_state); diff --git a/src/trx-client/src/remote_client.rs b/src/trx-client/src/remote_client.rs index a984221..0ebd8ff 100644 --- a/src/trx-client/src/remote_client.rs +++ b/src/trx-client/src/remote_client.rs @@ -180,6 +180,8 @@ pub fn state_from_snapshot(snapshot: trx_core::RigSnapshot) -> RigState { clar_on: None, enabled: snapshot.enabled, }, + server_callsign: snapshot.server_callsign, + server_version: snapshot.server_version, } }