Struct stm32wlxx_hal::subghz::LoRaPacketStatus
source · pub struct LoRaPacketStatus { /* private fields */ }
Expand description
LoRa packet status.
Returned by lora_packet_status
.
Implementations§
source§impl LoRaPacketStatus
impl LoRaPacketStatus
sourcepub const fn status(&self) -> Status
pub const fn status(&self) -> Status
Get the status.
Example
use stm32wlxx_hal::subghz::{CmdStatus, LoRaPacketStatus, Status, StatusMode};
let example_data_from_radio: [u8; 4] = [0x54, 0, 0, 0];
let pkt_status: LoRaPacketStatus = LoRaPacketStatus::from(example_data_from_radio);
let status: Status = pkt_status.status();
assert_eq!(status.mode(), Ok(StatusMode::Rx));
assert_eq!(status.cmd(), Ok(CmdStatus::Available));
sourcepub fn rssi_pkt(&self) -> Ratio<i16>
pub fn rssi_pkt(&self) -> Ratio<i16>
Average RSSI level over the received packet.
Units are in dBm.
Example
use stm32wlxx_hal::{subghz::LoRaPacketStatus, Ratio};
let example_data_from_radio: [u8; 4] = [0, 80, 0, 0];
let pkt_status: LoRaPacketStatus = LoRaPacketStatus::from(example_data_from_radio);
assert_eq!(pkt_status.rssi_pkt().to_integer(), -40);
sourcepub fn snr_pkt(&self) -> Ratio<i16>
pub fn snr_pkt(&self) -> Ratio<i16>
Estimation of SNR over the received packet.
Units are in dB.
Example
use stm32wlxx_hal::{subghz::LoRaPacketStatus, Ratio};
let example_data_from_radio: [u8; 4] = [0, 0, 40, 0];
let pkt_status: LoRaPacketStatus = LoRaPacketStatus::from(example_data_from_radio);
assert_eq!(pkt_status.snr_pkt().to_integer(), 10);
sourcepub fn signal_rssi_pkt(&self) -> Ratio<i16>
pub fn signal_rssi_pkt(&self) -> Ratio<i16>
Estimation of RSSI level of the LoRa signal after despreading.
Units are in dBm.
Example
use stm32wlxx_hal::{subghz::LoRaPacketStatus, Ratio};
let example_data_from_radio: [u8; 4] = [0, 0, 0, 80];
let pkt_status: LoRaPacketStatus = LoRaPacketStatus::from(example_data_from_radio);
assert_eq!(pkt_status.signal_rssi_pkt().to_integer(), -40);
Trait Implementations§
source§impl Clone for LoRaPacketStatus
impl Clone for LoRaPacketStatus
source§fn clone(&self) -> LoRaPacketStatus
fn clone(&self) -> LoRaPacketStatus
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LoRaPacketStatus
impl Debug for LoRaPacketStatus
source§impl PartialEq for LoRaPacketStatus
impl PartialEq for LoRaPacketStatus
source§fn eq(&self, other: &LoRaPacketStatus) -> bool
fn eq(&self, other: &LoRaPacketStatus) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for LoRaPacketStatus
impl Eq for LoRaPacketStatus
impl StructuralEq for LoRaPacketStatus
impl StructuralPartialEq for LoRaPacketStatus
Auto Trait Implementations§
impl RefUnwindSafe for LoRaPacketStatus
impl Send for LoRaPacketStatus
impl Sync for LoRaPacketStatus
impl Unpin for LoRaPacketStatus
impl UnwindSafe for LoRaPacketStatus
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