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:
1 file changed
+5
-2
+5
-2
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user