pub fn symbol_timeout(link: &LinkSettings, timeout_us: u64) -> u16Expand description
Returns the single reception timeout for a duration, in the link’s symbols.
§Arguments
link- the link settings, whose symbol time counts the timeout.timeout_us- how long to listen for a preamble, in microseconds.
§Returns
The timeout rounded up to whole symbols, from SYMBOL_TIMEOUT_MIN to
SYMBOL_TIMEOUT_MAX.
§Examples
use pamoja_lora::LinkSettings;
use pamoja_radios::sx127x::config::symbol_timeout;
// SF7 at 125 kHz sends a symbol every 1.024 ms.
let link = LinkSettings::new(7, 125_000);
assert_eq!(symbol_timeout(&link, 100_000), 98);
assert_eq!(symbol_timeout(&link, 0), 4);
assert_eq!(symbol_timeout(&link, 10_000_000), 1023);