Skip to main content

Packet

Struct Packet 

Source
pub struct Packet<'a> {
Show 15 fields pub payload: &'a [u8], pub channel: u8, pub modem: Modem, pub datarate: u8, pub coding_rate: u8, pub crc_enabled: bool, pub quality: Quality, pub frequency_offset: i32, pub snr_average: i8, pub rssi_channel: u8, pub rssi_signal: u8, pub timestamp: u32, pub payload_crc: u16, pub timing_metrics: u8, pub checksum_ok: bool,
}
Expand description

A packet as the concentrator wrote it into the buffer.

Fields§

§payload: &'a [u8]

The payload, exactly as it arrived.

§channel: u8

Which of the concentrator channels heard it.

§modem: Modem

Which demodulator heard it.

§datarate: u8

The spreading factor, for a LoRa packet.

§coding_rate: u8

The coding rate, for a LoRa packet.

§crc_enabled: bool

Whether the sender asked for a payload check at all.

§quality: Quality

What the receiver made of it.

§frequency_offset: i32

How far off the carrier was, signed, in the units the chip counts.

§snr_average: i8

The average signal-to-noise ratio, in dB, which is negative for a weak signal.

§rssi_channel: u8

The average channel power, as the chip reports it.

§rssi_signal: u8

The average signal power, as the chip reports it.

§timestamp: u32

The concentrator counter the packet is stamped against.

§payload_crc: u16

The check the sender put over the payload.

§timing_metrics: u8

How many fine timestamp metrics follow the packet.

§checksum_ok: bool

Whether the chip’s own sum over the packet matches what the bus delivered.

Trait Implementations§

Source§

impl<'a> Clone for Packet<'a>

Source§

fn clone(&self) -> Packet<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Packet<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for Packet<'a>

Source§

impl<'a> PartialEq for Packet<'a>

Source§

fn eq(&self, other: &Packet<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Packet<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Packet<'a>

§

impl<'a> RefUnwindSafe for Packet<'a>

§

impl<'a> Send for Packet<'a>

§

impl<'a> Sync for Packet<'a>

§

impl<'a> Unpin for Packet<'a>

§

impl<'a> UnsafeUnpin for Packet<'a>

§

impl<'a> UnwindSafe for Packet<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.