pub struct LoRaPacketStatus { /* private fields */ }
Expand description

LoRa packet status.

Returned by lora_packet_status.

Implementations§

source§

impl LoRaPacketStatus

source

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));
source

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);
source

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);
source

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

source§

fn clone(&self) -> LoRaPacketStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LoRaPacketStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<[u8; 4]> for LoRaPacketStatus

source§

fn from(buf: [u8; 4]) -> Self

Converts to this type from the input type.
source§

impl PartialEq for LoRaPacketStatus

source§

fn eq(&self, other: &LoRaPacketStatus) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for LoRaPacketStatus

source§

impl Eq for LoRaPacketStatus

source§

impl StructuralEq for LoRaPacketStatus

source§

impl StructuralPartialEq for LoRaPacketStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.