Skip to content

Update IEEE 802.15.4 receive example to show packets decode as data packets with appropriate frame control fields and header - #601

Open
potto216 wants to merge 3 commits into
tock:masterfrom
potto216:599-Update-IEEE-802.15.4-receive-example-match-pr-598
Open

Update IEEE 802.15.4 receive example to show packets decode as data packets with appropriate frame control fields and header#601
potto216 wants to merge 3 commits into
tock:masterfrom
potto216:599-Update-IEEE-802.15.4-receive-example-match-pr-598

Conversation

@potto216

Copy link
Copy Markdown
Contributor

Overview

This closes #599 by modifying the existing receive example to show packets decode as data packets with appropriate frame control fields and header. My design decision for decoded receive output to be one line per decoded piece of information where the description terminated with a colon is before the value, is to make it both readable and machine decodable. The disadvantage is that it is somewhat voluminous with 20 lines per packet. I tested it by having the program decode packets from the PR #598 version of examples/ieee802154_tx_raw.rs. An example for sequence numbers 92 and 93 is shown below.
From the TX (examples/ieee802154_tx_raw.rs) output:

TX broadcast: src=0x1001, sequence=92, count=92
TX broadcast: src=0x1001, sequence=93, count=93

From the RX (examples/ieee802154_rx_raw.rs.) output:

Received frame (18 bytes)
Frame control: 0x9841
Frame type: Data (1)
Security enabled: false
Frame pending: false
Acknowledgment requested: false
PAN ID compression: true
Sequence number suppression: false
Information elements present: false
Destination address mode: Short (2)
Frame version: IEEE 802.15.4-2006 (1)
Source address mode: Short (2)
Sequence number: 92
Destination PAN ID: 0xcafe
Destination address: 0xffff
Source PAN ID: 0xcafe (compressed)
Source address: 0x1001
MAC header length: 9 bytes
Payload (9 bytes) hex: 626561636f6e20005c
Payload UTF-8: "beacon \0\\"

Received frame (18 bytes)
Frame control: 0x9841
Frame type: Data (1)
Security enabled: false
Frame pending: false
Acknowledgment requested: false
PAN ID compression: true
Sequence number suppression: false
Information elements present: false
Destination address mode: Short (2)
Frame version: IEEE 802.15.4-2006 (1)
Source address mode: Short (2)
Sequence number: 93
Destination PAN ID: 0xcafe
Destination address: 0xffff
Source PAN ID: 0xcafe (compressed)
Source address: 0x1001
MAC header length: 9 bytes
Payload (9 bytes) hex: 626561636f6e20005d
Payload UTF-8: "beacon \0]"

Analyzer capture was used for confirmation of over the air packets. Specifically sequence number 93 is shown below (the error is from the analyzer decoding as 6LoWPAN).

image

AI Usage

I used OpenAI Codex for both code generation and evaluation. I reviewed all AI generated code and compared the received decoded output from the program with the decoded packets on the Wireless Protocol Suite analyzer software.

Testing

make test passed locally

Comment thread examples/ieee802154_rx_raw.rs Outdated
Comment thread examples/ieee802154_rx_raw.rs Outdated
Comment thread examples/ieee802154_rx_raw.rs
Comment thread examples/ieee802154_rx_raw.rs Outdated
let sequence_number = frame[2];
let mut offset = 3;
writeln!(Console::writer(), "Sequence number: {sequence_number}").unwrap();
let mut offset = 2;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jrvanwhy added support for if the sequence number is suppressed. I'll need to fix the matching tx file to match these changes. I'll do that after the 31st.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, if I understand correctly you'd rather implement that in this PR before merging it. I'll approve (I'm happy with it as-is), but wait for your signal before merging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am planning to update the TX pull request to be in line with this PRs changes for comments, documentation, and code changes. I will then rerun the over the air tests and comment on the results on both PRs

If that doesn't work let me know.

let sequence_number = frame[2];
let mut offset = 3;
writeln!(Console::writer(), "Sequence number: {sequence_number}").unwrap();
let mut offset = 2;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, if I understand correctly you'd rather implement that in this PR before merging it. I'll approve (I'm happy with it as-is), but wait for your signal before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update IEEE 802.15.4 receive example to show packets decode as data packets with appropriate frame control fields and header

2 participants