@jensenpat — minor follow-up nits from the review of #2140 (merged as e49875b2). None blocking; bundled here so you can pick them up in a future pass.
Context
These are minor nits from the review of #2140 (DAX/TCI multi-stream routing for firmware 4.2.18, merged as e49875b2). Bundled into one consolidated cleanup issue rather than blocking the merge.
Items
1. Lift duplicated stream-status helpers into a shared header
parseStatusHandle() and streamStatusBelongsToUs() exist in two copies — one in src/gui/MainWindow.cpp and one in src/core/TciServer.cpp — with identical bodies. Same applies to tciTrxForSlice() which is duplicated between src/core/TciProtocol.cpp and src/core/TciServer.cpp.
Suggested fix: lift these into a small shared header (e.g. src/core/StreamStatus.h for the parse helpers, and a static method or free function near TciProtocol for tciTrxForSlice). Also consider whether parseStreamToken() in RadioModel.cpp should share that header — same parsing semantics, near-identical body.
2. RadioModel::m_daxTxClientHandle is set but only logged
The field is updated in traceDaxStreamStatus() and in the dax_tx stream-create reply handler, but it isn't consulted by any routing or filtering logic — only printed in debug logs.
Two clean ways to handle this:
- If the field is intentionally observability-only for the upcoming firmware behavior, add a one-line comment at its declaration noting "tracked for diagnostics only — not currently consulted in routing."
- If it's leftover from a routing path that didn't ship, remove it.
3. Document the TCI receiver-index policy
#2140 changes TCI receiver indexes from raw Flex slice IDs to contiguous 0..N-1 owned-slice indexes. This is the right fix for WSJT-X TCI1/TCI2 multi-slice but is a behavioral shift worth documenting somewhere clients can find — the project README or a docs/tci-receivers.md note explaining:
- Receiver indexes are contiguous within owned slices (
0..N-1), not raw Flex slice IDs.
- A receiver index can shift if a lower-numbered slice is removed at runtime.
- Older clients that learned raw slice IDs are caught by the
sliceForTrx() fallback.
4. (Optional) Bound m_daxStreamDebug map size
The map grows with every new stream and is pruned on removal events. In normal operation this stays small (one entry per active DAX stream). As defense-in-depth, a sanity cap or LRU eviction would protect against pathological cases where the radio stops sending removed status — but this is theoretical and only worth doing if it's ever observed in the wild.
Out of scope
This issue is only for the cleanup nits. The behavioral changes in #2140 are working as intended and have been validated end-to-end with WSJT-X by @jensenpat.
cc @jensenpat (original author) — none of these are required, just notes from the review.
@jensenpat — minor follow-up nits from the review of #2140 (merged as
e49875b2). None blocking; bundled here so you can pick them up in a future pass.Context
These are minor nits from the review of #2140 (DAX/TCI multi-stream routing for firmware 4.2.18, merged as
e49875b2). Bundled into one consolidated cleanup issue rather than blocking the merge.Items
1. Lift duplicated stream-status helpers into a shared header
parseStatusHandle()andstreamStatusBelongsToUs()exist in two copies — one insrc/gui/MainWindow.cppand one insrc/core/TciServer.cpp— with identical bodies. Same applies totciTrxForSlice()which is duplicated betweensrc/core/TciProtocol.cppandsrc/core/TciServer.cpp.Suggested fix: lift these into a small shared header (e.g.
src/core/StreamStatus.hfor the parse helpers, and a static method or free function nearTciProtocolfortciTrxForSlice). Also consider whetherparseStreamToken()inRadioModel.cppshould share that header — same parsing semantics, near-identical body.2.
RadioModel::m_daxTxClientHandleis set but only loggedThe field is updated in
traceDaxStreamStatus()and in thedax_txstream-create reply handler, but it isn't consulted by any routing or filtering logic — only printed in debug logs.Two clean ways to handle this:
3. Document the TCI receiver-index policy
#2140changes TCI receiver indexes from raw Flex slice IDs to contiguous0..N-1owned-slice indexes. This is the right fix for WSJT-X TCI1/TCI2 multi-slice but is a behavioral shift worth documenting somewhere clients can find — the project README or adocs/tci-receivers.mdnote explaining:0..N-1), not raw Flex slice IDs.sliceForTrx()fallback.4. (Optional) Bound
m_daxStreamDebugmap sizeThe map grows with every new stream and is pruned on removal events. In normal operation this stays small (one entry per active DAX stream). As defense-in-depth, a sanity cap or LRU eviction would protect against pathological cases where the radio stops sending
removedstatus — but this is theoretical and only worth doing if it's ever observed in the wild.Out of scope
This issue is only for the cleanup nits. The behavioral changes in #2140 are working as intended and have been validated end-to-end with WSJT-X by @jensenpat.
cc @jensenpat (original author) — none of these are required, just notes from the review.