Skip to main content

JoinAccept

Struct JoinAccept 

Source
pub struct JoinAccept { /* private fields */ }
Expand description

A successful activation: the session to use, plus the network parameters the accept carried.

Implementations§

Source§

impl JoinAccept

Source

pub fn session(&self) -> Session

Returns the activated session, ready to secure data frames.

§Returns

The Session.

Source

pub fn dev_addr(&self) -> u32

Returns the device address the network assigned.

§Returns

The device address.

Source

pub fn net_id(&self) -> u32

Returns the network identifier, a 24-bit value.

§Returns

The NetID.

Source

pub fn dl_settings(&self) -> u8

Returns the downlink settings byte, which selects the downlink data rates.

rx1_dr_offset and rx2_data_rate read the two fields out of it.

§Returns

The DLSettings byte.

Source

pub fn rx_delay(&self) -> u8

Returns the delay byte before the first receive window, as it arrived.

receive_delay_us reads the delay out of it.

§Returns

The RxDelay byte.

Source

pub fn rx1_dr_offset(&self) -> u8

Returns the offset between an uplink’s data rate and the first window’s.

TS001-1.0.4 table 55 carries it in bits 6 to 4 of DLSettings. What an offset means is regional, and ChannelPlan::rx1_data_rate in pamoja-lora reads it.

§Returns

The RX1DROffset, from 0 to 7.

Source

pub fn rx2_data_rate(&self) -> u8

Returns the data rate the second receive window listens at.

§Returns

The RX2DataRate, from the low four bits of DLSettings.

Source

pub fn receive_delay_us(&self) -> u32

Returns the delay from the end of an uplink to the first receive window.

TS001-1.0.4 table 44 keeps the delay in seconds in the low four bits, with the upper four reserved, and has a zero there mean one second.

§Returns

The delay in microseconds, from one to fifteen seconds.

§Examples
use pamoja_lorawan::{Device, JoinGrant};

let device = Device::new([1; 8], [2; 8], [3; 16]);
let accept = JoinGrant::new(0x01, 0x13, 0x2601_2E43).with_rx_delay(0).accept(&[3; 16], 7);
let joined = device.accept_join(accept.as_bytes(), 7)?;
assert_eq!(joined.receive_delay_us(), 1_000_000, "zero is one second");
Source

pub fn cflist(&self) -> Option<CfList>

Returns the channel list the network attached, if it attached one.

§Returns

The list, or None for a join accept of the shorter, seventeen-byte form.

Trait Implementations§

Source§

impl Clone for JoinAccept

Source§

fn clone(&self) -> JoinAccept

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 JoinAccept

Source§

impl Debug for JoinAccept

Source§

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

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

impl Eq for JoinAccept

Source§

impl PartialEq for JoinAccept

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for JoinAccept

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
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> 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.