pub struct Settings { /* private fields */ }Expand description
What a device’s radio can do, and how it takes part.
Implementations§
Source§impl Settings
impl Settings
Sourcepub const fn new(min_output_dbm: i8, max_output_dbm: i8) -> Settings
pub const fn new(min_output_dbm: i8, max_output_dbm: i8) -> Settings
Settings for a radio with an output power range.
The rest start as a typical node: TS001-1.0.4, adaptive data rate on, an antenna with no gain over its cable, a radio that tunes 137 to 1020 MHz as an SX1276 does, the region’s duty cycle kept, and no repeater in the path.
§Arguments
min_output_dbm- the lowest power the radio puts out, conducted.max_output_dbm- the highest, conducted.
§Returns
The settings.
Sourcepub const fn with_crystal_ppm(self, crystal_ppm: u32) -> Settings
pub const fn with_crystal_ppm(self, crystal_ppm: u32) -> Settings
Sets how far the device’s own clock may drift.
It decides how much preamble a wake-on-radio frame needs to still cover a relay’s scan, TS011-1.0.1 appendix 1. The default is the 20 parts per million of a typical temperature-compensated crystal.
§Arguments
crystal_ppm- the accuracy in parts per million.
§Returns
The settings.
Sourcepub const fn with_version(self, version: Version) -> Settings
pub const fn with_version(self, version: Version) -> Settings
Sourcepub const fn with_adr(self, adr: bool) -> Settings
pub const fn with_adr(self, adr: bool) -> Settings
Turns adaptive data rate on or off.
With it on, the device sets the ADR bit, takes the data rate and power the network
chooses, and backs off when the network goes quiet. With it off, the device keeps its
own data rate and TS001-1.0.4 section 5.2 lets it accept a LinkADRReq one field at
a time.
§Arguments
adr- whether the network manages the data rate.
§Returns
The settings.
Sourcepub const fn with_antenna_gain(self, gain_db: i8) -> Settings
pub const fn with_antenna_gain(self, gain_db: i8) -> Settings
Accounts for the antenna and its feed.
Most regions limit radiated power, so a device with a 3 dBi antenna puts out 3 dB less than one with a 0 dBi antenna to radiate the same. US902-928 limits conducted power instead, and only the gain above the 6 dBi its limit allows for comes off.
§Arguments
gain_db- the antenna gain less the cable and connector losses, in dB.
§Returns
The settings.
Sourcepub const fn with_tuning_range(
self,
lowest_hz: u32,
highest_hz: u32,
) -> Settings
pub const fn with_tuning_range( self, lowest_hz: u32, highest_hz: u32, ) -> Settings
Sourcepub const fn without_regional_duty_cycle(self) -> Settings
pub const fn without_regional_duty_cycle(self) -> Settings
Stops holding the device to the region’s sub-band duty cycles.
The regional tables report a limit rather than enforce one, because the operator is
the one who knows whether a regulation applies where the device stands. The network’s
DutyCycleReq and the join back-off still hold.
§Returns
The settings.
Sourcepub const fn behind_repeater(self) -> Settings
pub const fn behind_repeater(self) -> Settings
Sizes payloads for a path through a relay, which costs a few bytes of each frame.
§Returns
The settings.