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
impl JoinAccept
Sourcepub fn dl_settings(&self) -> u8
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.
Sourcepub fn rx_delay(&self) -> u8
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.
Sourcepub fn rx1_dr_offset(&self) -> u8
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.
Sourcepub fn rx2_data_rate(&self) -> u8
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.
Sourcepub fn receive_delay_us(&self) -> u32
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");Trait Implementations§
Source§impl Clone for JoinAccept
impl Clone for JoinAccept
Source§fn clone(&self) -> JoinAccept
fn clone(&self) -> JoinAccept
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more