pub enum SyncWord {
Public,
Private,
Custom(u8),
}Expand description
The LoRa sync word, which keeps one network’s frames apart from another’s.
Both families carry it as one byte. The SX127x writes the byte to RegSyncWord. The SX126x
spreads its two nibbles over its two sync word registers with a 4 after each, so 0x34 is
written as 0x3444 and 0x12 as 0x1424, which are the chip’s own public and private values,
and any other byte takes the same layout, the one RadioLib’s setSyncWord writes.
§Examples
use pamoja_radios::radio::SyncWord;
use pamoja_radios::sx126x::config::SyncWord as Sx126xSyncWord;
assert_eq!(SyncWord::from_byte(0x34), SyncWord::Public);
assert_eq!(SyncWord::Custom(0x2B).sx126x(), Sx126xSyncWord::Custom(0x24B4));Variants§
Public
0x34, for a public network such as LoRaWAN.
Private
0x12, for a private network, and both families’ reset value.
Custom(u8)
Another byte.
Implementations§
Source§impl SyncWord
impl SyncWord
Sourcepub const fn from_byte(byte: u8) -> SyncWord
pub const fn from_byte(byte: u8) -> SyncWord
Names a byte.
§Arguments
byte- the sync word byte.
§Returns
SyncWord::Public for 0x34, SyncWord::Private for 0x12, and a custom word for
any other byte.
Trait Implementations§
impl Copy for SyncWord
impl Eq for SyncWord
impl StructuralPartialEq for SyncWord
Auto Trait Implementations§
impl Freeze for SyncWord
impl RefUnwindSafe for SyncWord
impl Send for SyncWord
impl Sync for SyncWord
impl Unpin for SyncWord
impl UnsafeUnpin for SyncWord
impl UnwindSafe for SyncWord
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