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.
This commit is contained in:
swaits committed 2026-03-29 22:22:43 -06:00
1 parent 9a13c4b951
commit ff8762b9e4
1 file changed
+5 -2
+5 -2
View File
@@ -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 { 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, Ok(()) => RadioState::Receiving,
Err(e) => { Err(e) => {
warn!("post-TX RX restart failed: {}", e); warn!("post-TX RX restart failed: {}", e);