feat(export): add hop start and relay node columns to CSV export#5822
Merged
Conversation
The packet CSV dump only exposed `hop limit`, which is enough to map whole-network coverage but not to tell which repeater relayed a given packet. Surface the relaying repeater so users can map the coverage of individual repeaters. - Add a `relay node` column carrying the `relay_node` byte (the last byte of the relaying node's NodeNum), emitted as a 2-digit hex value so it matches the tail of a node id (e.g. !a1b2c3d4 -> "d4"); blank when unset (0). - Add a `hop start` column alongside the existing `hop limit` so a reader can derive hops-away (hop_start - hop_limit). - Insert both columns before `payload` to keep the free-text payload last and leave every existing column index unchanged. Fixes #5801 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3b6d028 to
84ab12e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The packet CSV dump only exposed
hop limit, which is enough to map whole-network coverage but not to tell which repeater relayed a given packet. This surfaces the relaying repeater (and the original hop count) so users can map the coverage of individual repeaters.Resolves #5801
🌟 New Features
relay nodecolumn carrying therelay_nodebyte fromMeshPacket— the last byte of the relaying node'sNodeNum. It's emitted as a 2-digit hex value so it matches the tail of a node id (e.g.!a1b2c3d4→"d4"), and left blank when unset (0). This is the "last hop byte" requested in the issue: it identifies the repeater a packet was heard from.hop startcolumn alongside the existinghop limitso a reader can derive hops-away (hop_start - hop_limit) and confirm whether a packet was a direct vs. relayed reception.🛠️ Notes on column ordering
payload, keeping the free-textpayloadfield last (safest for CSV with embedded commas/quotes) and leaving every pre-existing column at its current index. Tools that read columns by header name are unaffected; tools that readpayloadby fixed position will need to shift it two columns right.Testing Performed
ExportDataUseCaseTest(core/domaincommonTest):invoke writes header to sinknow asserts the new"hop start","relay node","payload"header tail.invoke writes hop start and relay node columns— verifies a packet withhop_limit=2, hop_start=3, relay_node=77serializes as"2","3","4d","Hello".invoke leaves relay node blank when unset— verifiesrelay_node=0produces a blank field../gradlew spotlessApply spotlessCheck detekt assembleDebug test allTests— all pass.