Dedup stream-status helpers, annotate m_daxTxClientHandle, document TCI receiver-index policy (#2142)#2145
Conversation
…CI receiver-index policy (#2142) - Lift parseStatusHandle() and streamStatusBelongsToUs() into shared StreamStatus.h; remove duplicate copies from MainWindow.cpp and TciServer.cpp. Alias parseStreamToken() in RadioModel.cpp to call the shared parseStatusHandle(). - Move tciTrxForSlice() to TciProtocol as a public static method, unifying the two slightly different signatures from TciServer.cpp and TciProtocol.cpp. - Annotate m_daxTxClientHandle as diagnostics-only (set but never consulted in routing logic). - Add docs/tci-receivers.md documenting the contiguous 0..N-1 receiver-index policy introduced in #2140. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Review — PR #2145
Clean deduplication PR. Three copies of parseStatusHandle / streamStatusBelongsToUs and two copies of tciTrxForSlice collapsed into shared locations. The new docs/tci-receivers.md is a welcome addition for the TCI receiver-index policy that was introduced in #2140.
Looks good
- StreamStatus.h: The shared
inlinehelpers in theAetherSDRnamespace are a clean fit. The parse logic is identical to the three copies it replaces (verified againstMainWindow.cpp:233,TciServer.cpp:52,RadioModel.cpp:89). - tciTrxForSlice promotion: Moving it from a file-local anonymous namespace in both
TciProtocol.cppandTciServer.cppintoTciProtocol::tciTrxForSlice(public static) is the right call —TciServerwas already depending on the same logic and this makes the coupling explicit. - RadioModel.cpp: The
parseStreamTokenalias viainlineforwarding toparseStatusHandlepreserves the call site at line 126 without a noisy rename. Fine for this PR scope. - m_daxTxClientHandle annotation: Helpful clarification.
- docs/tci-receivers.md: Good documentation of the contiguous indexing policy and the legacy fallback path.
Minor items (non-blocking)
-
Missing space in call sites — Several
TciServer.cppcall sites haveTciProtocol::tciTrxForSlice(m_model,s)(no space after comma). The rest of the codebase consistently uses a space after commas in argument lists. Not a blocker but would be nice to fix if you're touching this again. -
parseStreamTokenwrapper in RadioModel.cpp — Theinlineforwarding function passestextby value and thenstd::moves it intoparseStatusHandle, which also takes by value. This is correct (move from the by-value parameter), but sinceparseStatusHandlealready takes by value, a simpler alias or just renaming the call site toparseStatusHandledirectly would be cleaner. Again, not a blocker — the current approach works fine and avoids a wider diff. -
parseStatusHandlereturns 0 on failure — This is inherited behavior, not new to this PR, but worth noting: 0 is also a potentially valid stream handle (though unlikely in practice from FlexRadio firmware). The existing callers all treat 0 as "no match" so this is consistent, just something to be aware of.
No bugs, no null-pointer risks, no scope creep. All changes are within the stated issue scope (#2142). LGTM overall — thanks for the cleanup, @aethersdr-agent!
Summary
Fixes #2142
What was changed
Dedup stream-status helpers, annotate m_daxTxClientHandle, document TCI receiver-index policy (#2142)
Files modified
docs/tci-receivers.mdsrc/core/StreamStatus.hsrc/core/TciProtocol.cppsrc/core/TciProtocol.hsrc/core/TciServer.cppsrc/gui/MainWindow.cppsrc/models/RadioModel.cppsrc/models/RadioModel.hGenerated by AetherClaude (automated agent for AetherSDR)