Struct stm32wlxx_hal::subghz::FskPacketStatus
source · pub struct FskPacketStatus { /* private fields */ }
Expand description
(G)FSK packet status.
Returned by fsk_packet_status
.
Implementations§
source§impl FskPacketStatus
impl FskPacketStatus
sourcepub const fn status(&self) -> Status
pub const fn status(&self) -> Status
Get the status.
Example
use stm32wlxx_hal::subghz::{CmdStatus, FskPacketStatus, Status, StatusMode};
let example_data_from_radio: [u8; 4] = [0x54, 0, 0, 0];
let pkt_status: FskPacketStatus = FskPacketStatus::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 const fn preamble_err(&self) -> bool
pub const fn preamble_err(&self) -> bool
Returns true
if a preamble error occurred.
sourcepub const fn length_err(&self) -> bool
pub const fn length_err(&self) -> bool
Returns true
if a length error occurred.
sourcepub const fn pkt_received(&self) -> bool
pub const fn pkt_received(&self) -> bool
Returns true
if a packet is received.
sourcepub fn rssi_sync(&self) -> Ratio<i16>
pub fn rssi_sync(&self) -> Ratio<i16>
RSSI level when the synchronization address is detected.
Units are in dBm.
Example
use stm32wlxx_hal::{subghz::FskPacketStatus, Ratio};
let example_data_from_radio: [u8; 4] = [0, 0, 80, 0];
let pkt_status: FskPacketStatus = FskPacketStatus::from(example_data_from_radio);
assert_eq!(pkt_status.rssi_sync().to_integer(), -40);
sourcepub fn rssi_avg(&self) -> Ratio<i16>
pub fn rssi_avg(&self) -> Ratio<i16>
Return the RSSI level over the received packet.
Units are in dBm.
Example
use stm32wlxx_hal::{subghz::FskPacketStatus, Ratio};
let example_data_from_radio: [u8; 4] = [0, 0, 0, 100];
let pkt_status: FskPacketStatus = FskPacketStatus::from(example_data_from_radio);
assert_eq!(pkt_status.rssi_avg().to_integer(), -50);
Trait Implementations§
source§impl Clone for FskPacketStatus
impl Clone for FskPacketStatus
source§fn clone(&self) -> FskPacketStatus
fn clone(&self) -> FskPacketStatus
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 FskPacketStatus
impl Debug for FskPacketStatus
source§impl PartialEq for FskPacketStatus
impl PartialEq for FskPacketStatus
source§fn eq(&self, other: &FskPacketStatus) -> bool
fn eq(&self, other: &FskPacketStatus) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for FskPacketStatus
impl Eq for FskPacketStatus
impl StructuralEq for FskPacketStatus
impl StructuralPartialEq for FskPacketStatus
Auto Trait Implementations§
impl RefUnwindSafe for FskPacketStatus
impl Send for FskPacketStatus
impl Sync for FskPacketStatus
impl Unpin for FskPacketStatus
impl UnwindSafe for FskPacketStatus
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