pub struct Fsk {
pub offset_hz: i32,
pub chain: Chain,
pub bitrate: u32,
pub sync_word: u64,
pub sync_word_len: u8,
}Expand description
The receiver that hears frequency shift keying rather than LoRa.
A LoRaWAN network carries one such channel, faster than any of its LoRa rates and with none of their reach. It is the tenth receiver, beside the eight and the fixed-rate one, and like them it is switched on whatever a plan says.
Fields§
§offset_hz: i32How far from the carrier it listens, in hertz, which is signed.
chain: ChainWhich radio it takes its samples from.
bitrate: u32The bit rate, in bits per second.
sync_word: u64The sync word it matches, in its low bytes.
sync_word_len: u8How many bytes of that sync word there are.
Implementations§
Source§impl Fsk
impl Fsk
Sourcepub const fn at(offset_hz: i32) -> Fsk
pub const fn at(offset_hz: i32) -> Fsk
A channel on the first radio, at the rate and sync word a LoRaWAN network uses.
§Arguments
offset_hz- how far from the carrier it listens, which is signed.
§Returns
The channel.
§Examples
use pamoja_radios::sx1302::channel::{Fsk, FSK_DEFAULT_BITRATE};
let channel = Fsk::at(600_000);
assert_eq!(channel.bitrate, FSK_DEFAULT_BITRATE);
assert_eq!(channel.sync_word_len, 3);Sourcepub const fn pattern(&self) -> u64
pub const fn pattern(&self) -> u64
The pattern the receiver is programmed with.
§Returns
The sync word moved into the top of the pattern, which is where the receiver reads it from however few bytes it has.
§Examples
use pamoja_radios::sx1302::channel::Fsk;
// Three bytes sit at the top, not the bottom.
assert_eq!(Fsk::at(0).pattern(), 0xc194_c100_0000_0000);Sourcepub const fn supported(&self) -> bool
pub const fn supported(&self) -> bool
Whether the concentrator can be set to this channel at all.
§Returns
Whether the offset is one the radio hears, the sync word is between one and eight bytes, and the bit rate is one the counter can hold.
§Examples
use pamoja_radios::sx1302::channel::Fsk;
assert!(Fsk::at(600_000).supported());
assert!(!Fsk::at(900_000).supported(), "past what the radio hears");
assert!(!Fsk::at(0).bitrate(100).supported(), "too slow to count");
assert!(!Fsk::at(0).matching(0, 9).supported(), "longer than the pattern");