Skip to content

Commit

Permalink
fix(dot15d4-cat): fix compilation with frame api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thvdveld committed Mar 6, 2024
1 parent fca8750 commit 2dfae06
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions dot15d4/src/bin/dot15d4-cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn main() {
);
}

if let Some(_) = frame.auxiliary_security_header() {
if frame.auxiliary_security_header().is_some() {
println!("{}", "Auxiliary Security Header".underline().bold());
println!(" unimplementec");
}
Expand All @@ -139,7 +139,11 @@ fn main() {

match id {
HeaderElementId::TimeCorrection => {
println!(" {}", TimeCorrection::new(header.content()));
if let Ok(tc) = TimeCorrection::new(header.content()) {
println!(" {}", tc);
} else {
println!(" invalid");
}
}
_ => println!(" unimplemented"),
}
Expand All @@ -155,7 +159,8 @@ fn main() {
for payload in payloads {
match payload.group_id() {
PayloadGroupId::Mlme => {
println!(" {}", "Mlme");
println!(" MLME");

for nested in payload.nested_information_elements() {
println!(
" {}",
Expand All @@ -167,25 +172,37 @@ fn main() {

match nested.sub_id() {
NestedSubId::Short(NestedSubIdShort::TschSynchronization) => {
println!(
" {}",
TschSynchronization::new(nested.content())
);
if let Ok(sync) = TschSynchronization::new(nested.content())
{
println!(" {sync}");
} else {
println!(" invalid");
}
}
NestedSubId::Short(NestedSubIdShort::TschTimeslot) => {
println!(" {}", TschTimeslot::new(nested.content()));
if let Ok(timeslot) = TschTimeslot::new(nested.content()) {
println!(" {timeslot}");
} else {
println!(" invalid");
}
}
NestedSubId::Short(NestedSubIdShort::TschSlotframeAndLink) => {
println!(
" {}",
if let Ok(slotframe_and_link) =
TschSlotframeAndLink::new(nested.content())
);
{
println!(" {slotframe_and_link}");
} else {
println!(" invalid");
}
}
NestedSubId::Long(NestedSubIdLong::ChannelHopping) => {
println!(
" {}",
if let Ok(channel_hopping) =
ChannelHopping::new(nested.content())
);
{
println!(" {channel_hopping}");
} else {
println!(" invalid");
}
}
_ => println!(" unimplemented"),
}
Expand Down

0 comments on commit 2dfae06

Please sign in to comment.