Skip to main content

Windows

Struct Windows 

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

When and where a network answers, and at what rate.

The defaults are the values recommended for every region in RP002-1.0.5 section 3.3: one second to the first receive window, five to the first join window, and no offset between the uplink data rate and the downlink one.

Implementations§

Source§

impl Windows

Source

pub const fn new() -> Windows

Returns the recommended windows: one second, five seconds, no offset, answering on the frequency the uplink arrived on.

§Returns

The windows.

Source

pub const fn with_receive_delay_us(self, micros: u32) -> Windows

Sets the delay before the first receive window, in microseconds.

§Arguments
  • micros - the delay.
§Returns

The updated windows, for chaining.

Source

pub const fn with_join_delay_us(self, micros: u32) -> Windows

Sets the delay before the window a join accept is sent in, in microseconds.

§Arguments
  • micros - the delay.
§Returns

The updated windows, for chaining.

Source

pub const fn with_rx1_data_rate_offset(self, offset: u8) -> Windows

Sets the offset between the uplink data rate and the one the first window answers at.

§Arguments
  • offset - the RX1DROffset the plan allows.
§Returns

The updated windows, for chaining.

Source

pub const fn with_rx1_channels(self, channels: Rx1Channels) -> Windows

Sets the channels the first window answers on.

§Arguments
  • channels - the regional rule.
§Returns

The updated windows, for chaining.

Source

pub const fn receive_delay_us(&self) -> u32

Returns the delay before the first receive window, in microseconds.

§Returns

The delay.

Source

pub const fn join_delay_us(&self) -> u32

Returns the delay before the join accept window, in microseconds.

§Returns

The delay.

Source

pub const fn rx1_data_rate_offset(&self) -> u8

Returns the offset the first window answers at.

§Returns

The offset.

Source

pub const fn rx1_channels(&self) -> Rx1Channels

Returns the channels the first window answers on.

§Returns

The regional rule.

Source

pub const fn rx_delay_byte(&self) -> u8

Returns the RXDelay byte a join accept carries.

TS001-1.0.4 table 44 puts the delay in the low four bits, in seconds, and states that a zero there means one second, so a sub-second delay cannot be expressed and rounds down to the same one second the device already assumes.

§Returns

The byte.

Source

pub const fn dl_settings_byte(&self, rx2_data_rate: u8) -> u8

Returns the DLSettings byte a join accept carries.

TS001-1.0.4 table 55 lays it out as a reserved top bit, the RX1DROffset in bits 6 to 4, and the second window’s data rate in the low four bits.

§Arguments
  • rx2_data_rate - the data rate the second window listens at, from the plan.
§Returns

The byte.

Trait Implementations§

Source§

impl Clone for Windows

Source§

fn clone(&self) -> Windows

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 Windows

Source§

impl Debug for Windows

Source§

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

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

impl Default for Windows

Source§

fn default() -> Windows

Returns the “default value” for a type. Read more
Source§

impl Eq for Windows

Source§

impl PartialEq for Windows

Source§

fn eq(&self, other: &Windows) -> 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 Windows

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.