Struct nrf52833_hal::ieee802154::Packet [−][src]
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
impl Packet
[src]
pub const CAPACITY: u8
[src]
Maximum amount of usable payload (CRC excluded) a single packet can contain, in bytes
pub fn new() -> Packet
[src]
Returns an empty packet (length = 0)
pub fn copy_from_slice(&mut self, src: &[u8])
[src]
Fills the packet payload with given src
data
Panics
This function panics if src
is larger than Self::CAPACITY
pub fn len(&self) -> u8
[src]
Returns the size of this packet’s payload
pub fn set_len(&mut self, len: u8)
[src]
Changes the size of the packet’s payload
Panics
This function panics if len
is larger than Self::CAPACITY
pub fn lqi(&self) -> u8
[src]
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.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,