update IEEE 802.15.4 example to have packets decode as data packets with appropriate frame control fields and header - #598
Open
potto216 wants to merge 1 commit into
Conversation
This was referenced Aug 13, 2026
jrvanwhy
approved these changes
Aug 25, 2026
jrvanwhy
left a comment
Collaborator
There was a problem hiding this comment.
Sorry about the delayed review, I was busy and this one slipped through the cracks.
Comment on lines
+103
to
+109
| match Ieee802154::transmit_frame_raw(&tx_frame) { | ||
| Ok(()) => {} | ||
| Err(error) => { | ||
| writeln!(Console::writer(), "TX failed: {:?}", error).unwrap(); | ||
| continue; | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Alternatively, this could be an if let:
Suggested change
| match Ieee802154::transmit_frame_raw(&tx_frame) { | |
| Ok(()) => {} | |
| Err(error) => { | |
| writeln!(Console::writer(), "TX failed: {:?}", error).unwrap(); | |
| continue; | |
| } | |
| } | |
| if let Err(error) = Ieee802154::transmit_frame_raw(&tx_frame) { | |
| writeln!(Console::writer(), "TX failed: {:?}", error).unwrap(); | |
| continue; | |
| } |
It's totally up to stylistic preference though.
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.
Overview
This closes issue #586 and updates the IEEE 802.15.4 tx example to have packets decode as data packets with appropriate frame control fields and header. The packet now decodes as an 802.15.4 data packet as shown below (The 6LoWPAN reference can be ignored since 802.15.4 packets don't have a payload protocol field so the analyzer has to guess at it)
Two issues to note, neither I think related to the libtock-rs code.
transmit_frame_rawchecks the status code, sometimes it is busy as seen in the tock console outputCodex thinks this is because:
This is something I need to investigate in a separate issue, but I don't feel it is relevant to the code being committed in this PR.
I generated 621 packets and the sequence number rolled over multiple times correctly. I did not see any missing packets.
AI usage
I used OpenAI Codex for help with code generation and evaluation. I reviewed any code it generated.
Testing
make testpassed