Skip to main content

LinkBudget

Struct LinkBudget 

Source
pub struct LinkBudget {
    pub transmit_power_dbm: Decibels,
    pub transmit_antenna_gain_dbi: Decibels,
    pub transmit_cable_loss_db: Decibels,
    pub receive_antenna_gain_dbi: Decibels,
    pub receive_cable_loss_db: Decibels,
    pub noise_figure_db: Decibels,
}
Expand description

The gains and losses of a link, from the transmitting radio to the receiving one.

The fields are the parts of a deployment a maker chooses: how hard the radio drives, which antenna goes on each end, and how much cable sits between each antenna and its radio. The methods add them up against a path and a receiver. The default is 0 dBm between two isotropic antennas with no cable, heard with RADIO_NOISE_FIGURE_DB.

§Examples

use pamoja_lora::budget::{Decibels, LinkBudget};

// 14 dBm into a 2.15 dBi antenna through half a decibel of pigtail.
let budget = LinkBudget {
    transmit_power_dbm: Decibels::from_db(14),
    transmit_antenna_gain_dbi: Decibels::from_hundredths(215),
    transmit_cable_loss_db: Decibels::from_tenths(5),
    ..LinkBudget::default()
};
assert_eq!(budget.eirp_dbm().to_string(), "15.65");

// Under a 16 dBm EIRP ceiling, that antenna and cable leave 14.35 dBm for the radio.
let most = budget.max_transmit_power_dbm(Decibels::from_db(16));
assert_eq!(most.to_string(), "14.35");

Fields§

§transmit_power_dbm: Decibels

The power the transmitting radio delivers at its antenna port, in dBm.

§transmit_antenna_gain_dbi: Decibels

The gain of the transmitting antenna over an isotropic antenna, in dBi.

§transmit_cable_loss_db: Decibels

The loss in the cable and connectors between the transmitting radio and its antenna, in dB.

§receive_antenna_gain_dbi: Decibels

The gain of the receiving antenna over an isotropic antenna, in dBi.

§receive_cable_loss_db: Decibels

The loss in the cable and connectors between the receiving antenna and its radio, in dB.

§noise_figure_db: Decibels

The noise figure of the receiver, in dB, such as RADIO_NOISE_FIGURE_DB for a node or GATEWAY_NOISE_FIGURE_DB for a gateway.

Implementations§

Source§

impl LinkBudget

Source

pub fn eirp_dbm(&self) -> Decibels

Returns the equivalent isotropically radiated power, in dBm.

§Returns

The transmit power plus the transmitting antenna gain, less the transmitting cable loss. This is the figure regional power ceilings limit.

Source

pub fn received_dbm(&self, path_loss_db: Decibels) -> Decibels

Returns the power that reaches the receiving radio across a path, in dBm.

§Arguments
§Returns

The EIRP less the path loss, plus the receiving antenna gain, less the receiving cable loss.

Source

pub fn sensitivity_dbm(&self, link: LinkSettings) -> Decibels

Returns the weakest signal the receiver can demodulate on a link, in dBm.

§Arguments
  • link - the link settings, whose spreading factor and bandwidth set the floor.
§Returns

The sensitivity at this budget’s noise figure.

Source

pub fn max_path_loss_db(&self, link: LinkSettings) -> Decibels

Returns the most path loss the link survives, in dB.

§Arguments
  • link - the link settings, whose spreading factor and bandwidth set the sensitivity.
§Returns

How far the power reaching the receiver with no path loss sits above the sensitivity. A path that loses more than this does not close.

Source

pub fn margin_db(&self, link: LinkSettings, path_loss_db: Decibels) -> Decibels

Returns how far above the sensitivity a signal arrives across a path, in dB.

§Arguments
  • link - the link settings, whose spreading factor and bandwidth set the sensitivity.
  • path_loss_db - the loss between the two antennas.
§Returns

The link margin, which is negative where the path loses more than the link survives.

Source

pub fn max_transmit_power_dbm(&self, eirp_ceiling_dbm: Decibels) -> Decibels

Returns the most transmit power that keeps the EIRP at or under a ceiling, in dBm.

§Arguments
  • eirp_ceiling_dbm - the EIRP limit, such as the max_eirp_dbm a channel plan publishes for a frequency.
§Returns

The ceiling less the transmitting antenna gain, plus the transmitting cable loss. A higher-gain antenna leaves less power for the radio.

Trait Implementations§

Source§

impl Clone for LinkBudget

Source§

fn clone(&self) -> LinkBudget

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 LinkBudget

Source§

impl Debug for LinkBudget

Source§

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

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

impl Default for LinkBudget

Source§

fn default() -> Self

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

impl Eq for LinkBudget

Source§

impl Hash for LinkBudget

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 LinkBudget

Source§

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

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.