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

Returns an empty packet (length = 0)

Fills the packet payload with given src data

Panics

This function panics if src is larger than Self::CAPACITY

Returns the size of this packet’s payload

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.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.