From ac586418fcd70abda0bad162f8a105d3169aad53 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sun, 8 Mar 2026 20:26:23 +0100 Subject: [PATCH] [fix](trx-rs): add AUDIO_MSG_HF_APRS_DECODE wire type for HF APRS Assigns message type 0x09 to HF APRS decoded frames on the binary audio TCP channel and wires it up in all three layers: - trx-core: AUDIO_MSG_HF_APRS_DECODE = 0x09 - trx-server: emit 0x09 in the live dispatch match and include hf_aprs history in the connection-open replay blob - trx-client: recognise 0x09 and forward to the decode broadcast Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Stan Grams --- src/trx-client/src/audio_client.rs | 5 +++-- src/trx-core/src/audio.rs | 1 + src/trx-server/src/audio.rs | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/trx-client/src/audio_client.rs b/src/trx-client/src/audio_client.rs index 70c80b6..b14f273 100644 --- a/src/trx-client/src/audio_client.rs +++ b/src/trx-client/src/audio_client.rs @@ -19,8 +19,8 @@ use trx_frontend::RemoteRigEntry; use trx_core::audio::{ read_audio_msg, write_audio_msg, AudioStreamInfo, AUDIO_MSG_AIS_DECODE, AUDIO_MSG_APRS_DECODE, - AUDIO_MSG_CW_DECODE, AUDIO_MSG_FT8_DECODE, AUDIO_MSG_RX_FRAME, AUDIO_MSG_STREAM_INFO, - AUDIO_MSG_TX_FRAME, AUDIO_MSG_VDES_DECODE, AUDIO_MSG_WSPR_DECODE, + AUDIO_MSG_CW_DECODE, AUDIO_MSG_FT8_DECODE, AUDIO_MSG_HF_APRS_DECODE, AUDIO_MSG_RX_FRAME, + AUDIO_MSG_STREAM_INFO, AUDIO_MSG_TX_FRAME, AUDIO_MSG_VDES_DECODE, AUDIO_MSG_WSPR_DECODE, }; use trx_core::decode::DecodedMessage; @@ -151,6 +151,7 @@ async fn handle_audio_connection( AUDIO_MSG_VDES_DECODE | AUDIO_MSG_AIS_DECODE | AUDIO_MSG_APRS_DECODE + | AUDIO_MSG_HF_APRS_DECODE | AUDIO_MSG_CW_DECODE | AUDIO_MSG_FT8_DECODE | AUDIO_MSG_WSPR_DECODE, diff --git a/src/trx-core/src/audio.rs b/src/trx-core/src/audio.rs index 73e577d..20dde47 100644 --- a/src/trx-core/src/audio.rs +++ b/src/trx-core/src/audio.rs @@ -17,6 +17,7 @@ pub const AUDIO_MSG_FT8_DECODE: u8 = 0x05; pub const AUDIO_MSG_WSPR_DECODE: u8 = 0x06; pub const AUDIO_MSG_AIS_DECODE: u8 = 0x07; pub const AUDIO_MSG_VDES_DECODE: u8 = 0x08; +pub const AUDIO_MSG_HF_APRS_DECODE: u8 = 0x09; /// Maximum payload size (1 MB) to reject bogus frames early. const MAX_PAYLOAD_SIZE: u32 = 1_048_576; diff --git a/src/trx-server/src/audio.rs b/src/trx-server/src/audio.rs index 08c4ca1..8ff9cd3 100644 --- a/src/trx-server/src/audio.rs +++ b/src/trx-server/src/audio.rs @@ -22,8 +22,8 @@ use trx_aprs::AprsDecoder; use trx_core::audio::{ read_audio_msg, write_audio_msg, AudioStreamInfo, AUDIO_MSG_AIS_DECODE, AUDIO_MSG_APRS_DECODE, AUDIO_MSG_CW_DECODE, AUDIO_MSG_FT8_DECODE, - AUDIO_MSG_RX_FRAME, AUDIO_MSG_STREAM_INFO, AUDIO_MSG_TX_FRAME, AUDIO_MSG_VDES_DECODE, - AUDIO_MSG_WSPR_DECODE, + AUDIO_MSG_HF_APRS_DECODE, AUDIO_MSG_RX_FRAME, AUDIO_MSG_STREAM_INFO, AUDIO_MSG_TX_FRAME, + AUDIO_MSG_VDES_DECODE, AUDIO_MSG_WSPR_DECODE, }; use trx_core::decode::{ AisMessage, AprsPacket, CwEvent, DecodedMessage, Ft8Message, VdesMessage, WsprMessage, @@ -1847,6 +1847,7 @@ async fn handle_audio_client( push_history!(histories.snapshot_ais_history(), DecodedMessage::Ais, AUDIO_MSG_AIS_DECODE); push_history!(histories.snapshot_vdes_history(), DecodedMessage::Vdes, AUDIO_MSG_VDES_DECODE); push_history!(histories.snapshot_aprs_history(), DecodedMessage::Aprs, AUDIO_MSG_APRS_DECODE); + push_history!(histories.snapshot_hf_aprs_history(), DecodedMessage::HfAprs, AUDIO_MSG_HF_APRS_DECODE); push_history!(histories.snapshot_ft8_history(), DecodedMessage::Ft8, AUDIO_MSG_FT8_DECODE); push_history!(histories.snapshot_wspr_history(), DecodedMessage::Wspr, AUDIO_MSG_WSPR_DECODE); push_history!(histories.snapshot_cw_history(), DecodedMessage::Cw, AUDIO_MSG_CW_DECODE); @@ -1895,6 +1896,7 @@ async fn handle_audio_client( DecodedMessage::Ais(_) => AUDIO_MSG_AIS_DECODE, DecodedMessage::Vdes(_) => AUDIO_MSG_VDES_DECODE, DecodedMessage::Aprs(_) => AUDIO_MSG_APRS_DECODE, + DecodedMessage::HfAprs(_) => AUDIO_MSG_HF_APRS_DECODE, DecodedMessage::Cw(_) => AUDIO_MSG_CW_DECODE, DecodedMessage::Ft8(_) => AUDIO_MSG_FT8_DECODE, DecodedMessage::Wspr(_) => AUDIO_MSG_WSPR_DECODE,