pub struct LoraPacket {
pub preamble_symbols: u16,
pub explicit_header: bool,
pub payload_len: u8,
pub crc: bool,
pub invert_iq: bool,
}Expand description
The LoRa parameters of a SetPacketParams command, from Tables 13-66 to 13-70.
§Examples
use pamoja_lora::LinkSettings;
use pamoja_radios::sx126x::config::LoraPacket;
// An eight-symbol preamble, an explicit header, a 20-byte payload, CRC on, standard IQ.
let packet = LoraPacket::from_link(&LinkSettings::new(7, 125_000), 20, false);
assert_eq!(packet.to_params(), [0x00, 0x08, 0x00, 0x14, 0x01, 0x00]);Fields§
§preamble_symbols: u16The preamble length in symbols.
explicit_header: boolWhether the frame carries an explicit header; implicit when false.
payload_len: u8The payload length to send, or the most a receiver accepts.
crc: boolWhether the frame carries a CRC.
invert_iq: boolWhether the IQ polarity is inverted, as LoRaWAN downlinks use.
Implementations§
Source§impl LoraPacket
impl LoraPacket
Sourcepub fn from_link(
link: &LinkSettings,
payload_len: u8,
invert_iq: bool,
) -> LoraPacket
pub fn from_link( link: &LinkSettings, payload_len: u8, invert_iq: bool, ) -> LoraPacket
Trait Implementations§
Source§impl Clone for LoraPacket
impl Clone for LoraPacket
Source§fn clone(&self) -> LoraPacket
fn clone(&self) -> LoraPacket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LoraPacket
Source§impl Debug for LoraPacket
impl Debug for LoraPacket
impl Eq for LoraPacket
Source§impl Hash for LoraPacket
impl Hash for LoraPacket
Source§impl PartialEq for LoraPacket
impl PartialEq for LoraPacket
Source§fn eq(&self, other: &LoraPacket) -> bool
fn eq(&self, other: &LoraPacket) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LoraPacket
Auto Trait Implementations§
impl Freeze for LoraPacket
impl RefUnwindSafe for LoraPacket
impl Send for LoraPacket
impl Sync for LoraPacket
impl Unpin for LoraPacket
impl UnsafeUnpin for LoraPacket
impl UnwindSafe for LoraPacket
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