From ff8762b9e40271834926860564f6e25b8ccd45cf Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 29 Mar 2026 22:22:43 -0600 Subject: [PATCH] fix: use stored RX config for post-TX restart, not per-packet TX override If Transmit included a per-packet config with different bandwidth/SF, the radio would silently switch parameters when resuming RX. Now uses state.config (the config from SetConfig) for post-TX RX restart. --- src/radio/task.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/radio/task.rs b/src/radio/task.rs index 86cf7727..75ba00ca 100644 --- a/src/radio/task.rs +++ b/src/radio/task.rs @@ -244,9 +244,12 @@ async fn handle_cmd( } } - // Restore previous state. If we were receiving, restart RX. + // Restore previous state. If we were receiving, restart RX + // using the stored config — NOT the per-packet TX override. state.state = if was_receiving { - match start_rx(lora, &cfg).await { + // state.config is always Some when was_receiving (invariant). + let rx_cfg = state.config.unwrap_or(cfg); + match start_rx(lora, &rx_cfg).await { Ok(()) => RadioState::Receiving, Err(e) => { warn!("post-TX RX restart failed: {}", e);