pub struct PacketStatus {
pub rssi_dbm: Decibels,
pub snr_db: Decibels,
pub signal_rssi_dbm: Decibels,
}Expand description
The signal levels of the last LoRa packet received.
§Examples
use pamoja_radios::sx127x::status::{PacketStatus, Port};
// RegPktSnrValue 0xF6 and RegPktRssiValue 0x30, heard at 868.1 MHz.
let packet = PacketStatus::from_bytes([0xF6, 0x30], Port::High);
assert_eq!(packet.snr_db.to_string(), "-2.50");
assert_eq!(packet.rssi_dbm.to_string(), "-109.00");
assert_eq!(packet.signal_rssi_dbm.to_string(), "-111.50");Fields§
§rssi_dbm: DecibelsThe RSSI averaged over the packet, in dBm: the port’s offset plus PacketRssi.
snr_db: DecibelsThe estimated signal-to-noise ratio, in dB: PacketSnr, a two’s complement byte, divided by 4.
signal_rssi_dbm: DecibelsThe strength of the packet itself, in dBm: the RSSI, lowered by the SNR when the packet arrived below the noise floor, as the datasheet computes it.
Implementations§
Source§impl PacketStatus
impl PacketStatus
Sourcepub const fn from_bytes(bytes: [u8; 2], port: Port) -> PacketStatus
pub const fn from_bytes(bytes: [u8; 2], port: Port) -> PacketStatus
Trait Implementations§
Source§impl Clone for PacketStatus
impl Clone for PacketStatus
Source§fn clone(&self) -> PacketStatus
fn clone(&self) -> PacketStatus
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 PacketStatus
Source§impl Debug for PacketStatus
impl Debug for PacketStatus
impl Eq for PacketStatus
Source§impl Hash for PacketStatus
impl Hash for PacketStatus
Source§impl PartialEq for PacketStatus
impl PartialEq for PacketStatus
Source§fn eq(&self, other: &PacketStatus) -> bool
fn eq(&self, other: &PacketStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PacketStatus
Auto Trait Implementations§
impl Freeze for PacketStatus
impl RefUnwindSafe for PacketStatus
impl Send for PacketStatus
impl Sync for PacketStatus
impl Unpin for PacketStatus
impl UnsafeUnpin for PacketStatus
impl UnwindSafe for PacketStatus
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