Repository navigation
Fix simple-receiver example for short frames and row layout - #89
Open
stewartadam wants to merge 1 commit into
Open
stewartadam wants to merge 1 commit into
stewartadam wants to merge 1 commit into
Conversation
The example indexed data.values directly, so it panicked as soon as a source sent fewer than 273 slots. It also used a row stride of 16 with 32 columns, so rows overlapped and only slots 1 to 272 were shown. Show all 512 slots in 16 rows of 32, treating missing trailing slots as 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzaQVPkrkczgX2g7wGkip5
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
simple-receiverexample had two display bugs:data.values[...]directly, so it panicked withindex out of boundsas soon as a source sent fewer than 273 slots. E1.31 allows short frames, andDMXDatadocuments missing trailing slots as 0.y * 16 + xas the index. The rows overlapped, and only slots 1 to 272 were ever shown.The example now uses
y * 32 + x + 1, so the grid shows all 512 slots, and reads values with.get(..).unwrap_or(0).Checked by sending five 3-slot frames by unicast to
127.0.0.1:5568. Onmainthe example panics atexamples/simple-receiver.rs:89. With this change it displays all five.