Crates.io | lora-modulation |
lib.rs | lora-modulation |
version | 0.1.5 |
source | src |
created_at | 2023-09-08 15:14:19.827044 |
updated_at | 2024-11-11 22:44:15.040836 |
description | A definition of LoRa modulation characteristics with minimal external dependencies. |
homepage | |
repository | https://github.com/lora-rs/lora-rs |
max_upload_size | |
id | 967227 |
size | 12,810 |
A minimal crate for providing LoRa modulation characteristics of:
Provides utility for calculating time on air.
use lora_modulation::{BaseBandModulationParams, SpreadingFactor, Bandwidth, CodingRate};
let length = 12;
let params = BaseBandModulationParams::new(SpreadingFactor::_9, Bandwidth::_125KHz, CodingRate::_4_5);
let time_on_air = params.time_on_air_us(
Some(8), // preamble
true, // explicit header
length); // length of payload
// Time on air is 144.384 ms
assert_eq!(time_on_air, 144384);
use lora_modulation::{BaseBandModulationParams, SpreadingFactor, Bandwidth, CodingRate};
let symbols = 14;
let params = BaseBandModulationParams::new(SpreadingFactor::_12, Bandwidth::_125KHz, CodingRate::_4_5);
let timeout = params.symbols_to_ms(symbols);
// Timeout is 458 ms
assert_eq!(timeout, 458);