Skip to main content

FixedChannelList

Enum FixedChannelList 

Source
pub enum FixedChannelList {
    Mhz800,
    Mhz900,
}
Expand description

A published list that gives every channel number a frequency.

RP002-1.0.5 section 3.3.1 fixes a frequency for each number, so a network can enable channels on a device with a bit each rather than spelling their frequencies out. A join accept’s type 1 channel list is read this way in a dynamic channel plan: each bit set creates the channel its number stands for.

§Examples

use pamoja_lora::region::FixedChannelList;

assert_eq!(FixedChannelList::Mhz800.frequency_hz(0), Some(863_100_000));
assert_eq!(FixedChannelList::Mhz800.frequency_hz(39), Some(865_985_000));
assert_eq!(FixedChannelList::Mhz900.frequency_hz(95), Some(924_600_000));
assert_eq!(FixedChannelList::Mhz900.frequency_hz(96), None);

Variants§

§

Mhz800

Section 3.3.1.1: forty channels, from 863.1 MHz in 200 kHz steps to 869.9 MHz at channel 34, then five at 865.0625, 865.4025, 865.6025, 865.785 and 865.985 MHz. It covers the channels EU868, IN865 and RU864 networks run.

§

Mhz900

Section 3.3.1.2: ninety-six channels, from 915.1 MHz in 100 kHz steps to 924.6 MHz. It covers the channels AS923 and KR920 networks run.

Implementations§

Source§

impl FixedChannelList

Source

pub const fn frequency_hz(self, channel: u8) -> Option<u32>

Returns the frequency a channel number stands for.

§Arguments
  • channel - the channel number.
§Returns

The frequency in hertz, or None for a number the list does not define.

Source

pub const fn len(self) -> u8

Returns how many channels the list defines.

§Returns

Forty for the 800 MHz list, ninety-six for the 900 MHz one.

Source

pub const fn is_empty(self) -> bool

Reports whether the list defines no channels, which neither published list does.

§Returns

false.

Trait Implementations§

Source§

impl Clone for FixedChannelList

Source§

fn clone(&self) -> FixedChannelList

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 FixedChannelList

Source§

impl Debug for FixedChannelList

Source§

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

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

impl Eq for FixedChannelList

Source§

impl Hash for FixedChannelList

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FixedChannelList

Source§

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

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