wpan/mac: use slice view to avoid copy
This commit is contained in:
@ -85,12 +85,7 @@ impl Mac {
|
||||
where
|
||||
T: MacCommand,
|
||||
{
|
||||
let mut payload = [0u8; MAX_PACKET_SIZE];
|
||||
cmd.copy_into_slice(&mut payload);
|
||||
|
||||
let response = self
|
||||
.tl_write_and_get_response(T::OPCODE as u16, &payload[..T::SIZE])
|
||||
.await;
|
||||
let response = self.tl_write_and_get_response(T::OPCODE as u16, cmd.payload()).await;
|
||||
|
||||
if response == 0x00 {
|
||||
Ok(())
|
||||
@ -107,8 +102,6 @@ impl Mac {
|
||||
}
|
||||
}
|
||||
|
||||
const MAX_PACKET_SIZE: usize = 255;
|
||||
|
||||
impl evt::MemoryManager for Mac {
|
||||
/// SAFETY: passing a pointer to something other than a managed event packet is UB
|
||||
unsafe fn drop_event_packet(_: *mut EvtPacket) {
|
||||
|
Reference in New Issue
Block a user