Skip to main content

MaskControl

Enum MaskControl 

Source
pub enum MaskControl {
    Group(u8),
    Banks,
    PairedBanks,
    All {
        on: bool,
        then_group: Option<u8>,
    },
    Reserved,
}
Expand description

What one value of a LinkADRReq command’s ChMaskCntl field does to a device’s channels.

TS001-1.0.4 section 5.3 leaves the meaning to the regional parameters, and RP002-1.0.5 gives each region a table of eight. A plan carries its table as ChannelPlan::mask_controls, indexed by the field’s value.

§Examples

use pamoja_lora::region::{MaskControl, Region};

// RP002-1.0.5 table 23: in US902-928, 7 turns every 125 kHz channel off and sets the
// 500 kHz channels from the mask.
assert_eq!(
    Region::Us915.plan().mask_controls[7],
    MaskControl::All { on: false, then_group: Some(4) }
);

Variants§

§

Group(u8)

The mask sets the sixteen channels of one group, channels 16 * group to 16 * group + 15.

§

Banks

Each of the mask’s ten low bits switches a bank of eight channels, bank b being channels 8 * b to 8 * b + 7. Channels a bank names but the device has not defined stay off.

§

PairedBanks

Each of the mask’s eight low bits switches a bank of eight channels together with the channel numbered 64 plus the bit, and bit 9 switches channels 72 to 79 where they are defined. This is the 900 MHz plans’ pairing of eight 125 kHz channels with one 500 kHz channel.

§

All

Every defined channel on, or every channel off, and then, where a group is named, the mask sets that group.

Fields

§on: bool

Whether the channels go on or off.

§then_group: Option<u8>

The group the mask then sets, if any.

§

Reserved

A value the region reserves, which a device refuses.

Implementations§

Source§

impl MaskControl

Source

pub const DYNAMIC: [MaskControl; 8]

The table every dynamic plan shares, RP002-1.0.5 table 14 for EU863-870 and its counterparts: groups 0 to 4, banks of eight, every defined channel on, and a reserved 7.

Trait Implementations§

Source§

impl Clone for MaskControl

Source§

fn clone(&self) -> MaskControl

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 MaskControl

Source§

impl Debug for MaskControl

Source§

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

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

impl Eq for MaskControl

Source§

impl Hash for MaskControl

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 MaskControl

Source§

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

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.