Struct nrf52840_hal::ieee802154::Packet [−][src]
pub struct Packet { /* fields omitted */ }
Expand description
An IEEE 802.15.4 packet
This Packet
is a PHY layer packet. It’s made up of the physical header (PHR) and the PSDU
(PHY service data unit). The PSDU of this Packet
will always include the MAC level CRC, AKA
the FCS (Frame Control Sequence) – the CRC is fully computed in hardware and automatically
appended on transmission and verified on reception.
The API lets users modify the usable part (not the CRC) of the PSDU via the deref
and
copy_from_slice
methods. These methods will automatically update the PHR.
See figure 119 in the Product Specification of the nRF52840 for more details
Implementations
Maximum amount of usable payload (CRC excluded) a single packet can contain, in bytes
Fills the packet payload with given src
data
Panics
This function panics if src
is larger than Self::CAPACITY
Changes the size of the packet’s payload
Panics
This function panics if len
is larger than Self::CAPACITY
Returns the LQI (Link Quality Indicator) of the received packet
Note that the LQI is stored in the Packet
’s internal buffer by the hardware so the value
returned by this method is only valid after a Radio.recv
operation. Operations that
modify the Packet
, like copy_from_slice
or set_len
+deref_mut
, will overwrite the
stored LQI value.
Also note that the hardware will not compute a LQI for packets smaller than 3 bytes so this method will return an invalid value for those packets.