From acf715b3f0d6df9f79d89f08f1e6dd7ada2707cb Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Wed, 22 Apr 2026 11:44:23 -0600 Subject: [PATCH] feat: auto-resume RX across SET_CONFIG (no more re-issue of RX_START) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spec §3.5 and §6.3 (SET_CONFIG side effects) previously required the host to re-issue RX_START after any successful SET_CONFIG, because the radio was unconditionally left in idle. That chore is hostile to scanner, time-division, and dynamic-modulation use cases and violates the principle of least surprise. Update the normative text so that SET_CONFIG applied while the radio is in continuous RX auto-re-arms RX with the new parameters once reconfiguration completes. RX ring is still cleared (stale packets from the old modulation are not semantically meaningful). The OK response is still held until the radio is ready, so hosts may TX / RX immediately after it. Behavior when RX was not active on SET_CONFIG is unchanged: radio lands in idle. No wire-format change. Old hosts that re-issue RX_START after SET_CONFIG keep working (the redundant call is a no-op OK on a radio already in Receiving). --- PROTOCOL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index f22385c..b97e359 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -200,7 +200,7 @@ A client whose inactivity timer has fired is considered disconnected. Transport- ### 3.5 Operations Spanning Reconfiguration -**`SET_CONFIG` while a TX is on the air**: the in-progress TX is allowed to physically complete. Its `TX_DONE` is emitted normally. Any queued-but-not-yet-started TXs are cancelled and emit `TX_DONE(result=CANCELLED)`. Continuous RX, if active, is aborted. RX ring is cleared. New configuration takes effect after the in-flight TX finishes. +**`SET_CONFIG` while a TX is on the air**: the in-progress TX is allowed to physically complete. Its `TX_DONE` is emitted normally. Any queued-but-not-yet-started TXs are cancelled and emit `TX_DONE(result=CANCELLED)`. The RX ring is cleared. If the radio was in continuous RX when `SET_CONFIG` was issued, RX is automatically re-armed with the new parameters once the in-flight TX finishes and the radio has completed reconfiguration; the host does **not** need to re-issue `RX_START`. New configuration takes effect after the in-flight TX finishes. **`SET_CONFIG` validation failure (`ERR(EPARAM)`, `ERR(ELENGTH)`, `ERR(EMODULATION)`)**: the chip is not touched. All parameters are validated before any SPI write to the radio. If validation fails, the radio and state machine are unchanged. @@ -381,9 +381,8 @@ Offset Size Field Description **Side effects on `APPLIED`**: - Any in-progress TX is allowed to finish; its `TX_DONE` is emitted normally. - All queued (not yet started) TXs are cancelled with `TX_DONE(result=CANCELLED)`. -- Any continuous RX is stopped. - RX ring is cleared. -- Radio is reconfigured, calibrated if required, and left in idle. The `OK` response is not emitted until this sequence completes. +- Radio is reconfigured and calibrated if required. If the radio was in continuous RX when `SET_CONFIG` was issued, RX is automatically re-armed with the new parameters once reconfiguration completes; otherwise the radio is left in idle. Either way, the `OK` response is not emitted until this sequence finishes, so the host may issue TX / RX commands immediately after `OK`. **Notes**: - **Auto-LDRO**: For LoRa, the device automatically enables Low Data Rate Optimization when `(2^SF) / BW_Hz > 16 ms` (the Semtech-recommended threshold). The host does not specify LDRO and is not informed of its state.