PhyProfile

Struct PhyProfile 

pub struct PhyProfile {
    pub id: &'static str,
    pub name: &'static str,
    pub freq_khz: u32,
    pub bw_hz: u32,
    pub sf: u8,
    pub cr_denom: u8,
    pub tx_power_dbm: Option<i8>,
    pub duty_limit: u16,
    pub sync_word: u16,
    pub tx_preamble_symbols: u16,
}
Expand description

A vetted PHY profile: the four parameters two nodes must agree on to hear each other, plus the local settings vetted alongside them.

Fields§

§id: &'static str

Stable identifier. meshcore- plus an ISO 3166-1 alpha-2 country code, or eu where the profile spans the union.

§name: &'static str

Display name, as an operator picking a profile sees it.

§freq_khz: u32

Center frequency in kHz (PROP_PHY_FREQ).

§bw_hz: u32

LoRa bandwidth in Hz (PROP_PHY_LORA_BW).

§sf: u8

LoRa spreading factor (PROP_PHY_LORA_SF).

§cr_denom: u8

Coding-rate denominator, 5 for 4/5 through 8 for 4/8 (PROP_PHY_LORA_CR).

§tx_power_dbm: Option<i8>

Transmit power vetted for this profile’s band and occupied bandwidth. None where no power has been vetted, in which case adopting the profile leaves a device’s configured power alone.

§duty_limit: u16

Duty-cycle limit in PROP_PHY_DUTY_LIMIT units.

§sync_word: u16

SX126x-style 16-bit sync word (PROP_PHY_LORA_SW).

§tx_preamble_symbols: u16

Preamble symbols to emit on transmit.

Implementations§

§

impl PhyProfile

pub const fn interoperates_with( &self, freq_khz: u32, bw_hz: u32, sf: u8, cr_denom: u8, ) -> bool

Whether a node on this profile and one on the given parameters can hear each other.

Transmit power and the duty-cycle limit are excluded. Neither changes what a receiver can decode, and a radio reports power clamped to what it can actually reach — comparing power would call two radios on the same profile different merely because one of them cannot transmit as hard as the other.

Trait Implementations§

§

impl Clone for PhyProfile

§

fn clone(&self) -> PhyProfile

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PhyProfile

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for PhyProfile

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Copy for PhyProfile

§

impl Eq for PhyProfile

§

impl StructuralPartialEq for PhyProfile

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.