You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine and prints the packet as expected. However, if I change set_dst_pan_id to 0xabce, the program panics with the following error:
thread 'main' panicked at /home/aebrahimi/Projects/dot15d4/dot15d4-frame/src/lib.rs:469:40:
source slice length (4) does not match destination slice length (2)
stack backtrace:
0: rust_begin_unwind
at /builddir/build/BUILD/rust-1.83.0-build/rustc-1.83.0-src/library/std/src/panicking.rs:665:5
1: core::panicking::panic_fmt
at /builddir/build/BUILD/rust-1.83.0-build/rustc-1.83.0-src/library/core/src/panicking.rs:74:14
2: core::slice::<impl [T]>::copy_from_slice::len_mismatch_fail
at /builddir/build/BUILD/rust-1.83.0-build/rustc-1.83.0-src/library/core/src/slice/mod.rs:3685:13
3: core::slice::<impl [T]>::copy_from_slice
at /builddir/build/BUILD/rust-1.83.0-build/rustc-1.83.0-src/library/core/src/slice/mod.rs:3692:13
4: dot15d4_frame::Frame<T>::set_payload
at /home/aebrahimi/Projects/dot15d4/dot15d4-frame/src/lib.rs:469:9
5: dot15d4_frame::repr::FrameRepr::emit
at /home/aebrahimi/Projects/dot15d4/dot15d4-frame/src/repr/mod.rs:93:13
6: test_app::main
at ./src/main.rs:16:5
7: core::ops::function::FnOnce::call_once
at /builddir/build/BUILD/rust-1.83.0-build/rustc-1.83.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full`for a verbose backtrace.
Analysis:
Based on the error, it seems that the buffer length mismatch occurs because frame.buffer_len() reports the wrong size. This results in an incorrect buffer length during the emission, leading to the panic.
Could you please confirm if this is the expected behavior, or if there's something else causing the issue?
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
I encountered a panic when modifying the
set_dst_pan_id
value in the following packet creation example:This works fine and prints the packet as expected. However, if I change
set_dst_pan_id
to0xabce
, the program panics with the following error:Analysis:
Based on the error, it seems that the buffer length mismatch occurs because
frame.buffer_len()
reports the wrong size. This results in an incorrect buffer length during the emission, leading to the panic.Could you please confirm if this is the expected behavior, or if there's something else causing the issue?
Thank you!
The text was updated successfully, but these errors were encountered: