pub struct LoRaConfig {
pub frequency_mhz: f32,
pub spreading_factor: SpreadingFactor,
pub bandwidth: Bandwidth,
pub coding_rate: CodingRate,
pub tx_power_dbm: i8,
pub rx_timeout_ms: u32,
pub preamble_length: u16,
pub crc_enabled: bool,
}Expand description
LoRa configuration
Fields§
§frequency_mhz: f32Center frequency in MHz (e.g., 868.0 for EU, 915.0 for US)
spreading_factor: SpreadingFactorSpreading factor
bandwidth: BandwidthBandwidth
coding_rate: CodingRateCoding rate
tx_power_dbm: i8TX power in dBm (2-20, hardware dependent)
rx_timeout_ms: u32RX timeout in milliseconds
preamble_length: u16Preamble length (symbols)
crc_enabled: boolEnable CRC
Implementations§
Source§impl LoRaConfig
impl LoRaConfig
Sourcepub fn from_profile(profile: LoRaProfile, frequency_mhz: f32) -> Self
pub fn from_profile(profile: LoRaProfile, frequency_mhz: f32) -> Self
Create configuration from profile
Sourcepub fn eu868(profile: LoRaProfile) -> Self
pub fn eu868(profile: LoRaProfile) -> Self
EU 868 MHz band (863-870 MHz)
Sourcepub fn us915(profile: LoRaProfile) -> Self
pub fn us915(profile: LoRaProfile) -> Self
US 915 MHz band (902-928 MHz)
Sourcepub fn time_on_air_ms(&self, payload_bytes: usize) -> u32
pub fn time_on_air_ms(&self, payload_bytes: usize) -> u32
Calculate time on air for a packet (in milliseconds)
Based on Semtech LoRa modem designer’s guide formulas.
Trait Implementations§
Source§impl Clone for LoRaConfig
impl Clone for LoRaConfig
Source§fn clone(&self) -> LoRaConfig
fn clone(&self) -> LoRaConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoRaConfig
impl Debug for LoRaConfig
Auto Trait Implementations§
impl Freeze for LoRaConfig
impl RefUnwindSafe for LoRaConfig
impl Send for LoRaConfig
impl Sync for LoRaConfig
impl Unpin for LoRaConfig
impl UnsafeUnpin for LoRaConfig
impl UnwindSafe for LoRaConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more