Skip to main content

PamojaLorawanHeader

Struct PamojaLorawanHeader 

Source
#[repr(C)]
pub struct PamojaLorawanHeader { pub payload_len: usize, pub dev_addr: u32, pub fcnt: u16, pub message_type: PamojaLorawanMessageType, pub fport: u8, pub is_data: u8, pub has_fport: u8, pub confirmed: u8, pub adr: u8, pub ack: u8, pub fpending: u8, pub fopts_len: u8, }
Expand description

What a frame says about itself before any key is involved.

Every field is a scalar, so this crosses the boundary by value. is_data is 1 when dev_addr and fcnt are meaningful, which is every message type except the two join frames, and has_fport is 1 when fport is.

Nothing here is authenticated, since checking the MIC needs the session key. Treat it as a routing hint until pamoja_lorawan_session_decode has verified the frame.

Fields§

§payload_len: usize

The length of the still-encrypted payload, in bytes.

§dev_addr: u32

The device address, meaningful only when is_data is 1.

§fcnt: u16

The low 16 bits of the frame counter, meaningful only when is_data is 1.

§message_type: PamojaLorawanMessageType

What kind of message the frame is.

§fport: u8

The port the frame was sent on, meaningful only when has_fport is 1.

§is_data: u8

1 for a data frame, 0 for one of the two join frames.

§has_fport: u8

1 when the frame carries a port rather than only frame options.

§confirmed: u8

1 when the frame asks to be acknowledged.

§adr: u8

1 when the frame takes part in adaptive data rate.

§ack: u8

1 when the frame acknowledges the last confirmed one.

§fpending: u8

1 when the network has more downlink data waiting.

§fopts_len: u8

How many bytes of frame options the header carries, from 0 to 15.

Trait Implementations§

Source§

impl Clone for PamojaLorawanHeader

Source§

fn clone(&self) -> PamojaLorawanHeader

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 Copy for PamojaLorawanHeader

Source§

impl Debug for PamojaLorawanHeader

Source§

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

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

impl Eq for PamojaLorawanHeader

Source§

impl PartialEq for PamojaLorawanHeader

Source§

fn eq(&self, other: &PamojaLorawanHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PamojaLorawanHeader

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.