pub struct ModemStatus {
pub coding_rate_denominator: Option<u8>,
pub clear: bool,
pub header_valid: bool,
pub rx_ongoing: bool,
pub signal_synchronized: bool,
pub signal_detected: bool,
}Expand description
The live state of the LoRa modem, from RegModemStat.
§Examples
use pamoja_radios::sx127x::status::ModemStatus;
// 0x0F: a signal detected and synchronized, a reception under way with a valid header.
let modem = ModemStatus::from_byte(0x0F);
assert!(modem.signal_detected && modem.header_valid && modem.rx_ongoing);
assert!(!modem.clear);Fields§
§coding_rate_denominator: Option<u8>The coding rate the last header announced, as the denominator of 4/5 to 4/8, or
None for a reserved value.
clear: boolBit 4: the modem is clear.
header_valid: boolBit 3: the header of the packet under way is valid.
rx_ongoing: boolBit 2: a reception is under way.
signal_synchronized: boolBit 1: the modem has synchronized on the end of the preamble.
signal_detected: boolBit 0: a LoRa preamble has been detected.
Implementations§
Source§impl ModemStatus
impl ModemStatus
Trait Implementations§
Source§impl Clone for ModemStatus
impl Clone for ModemStatus
Source§fn clone(&self) -> ModemStatus
fn clone(&self) -> ModemStatus
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 ModemStatus
Source§impl Debug for ModemStatus
impl Debug for ModemStatus
impl Eq for ModemStatus
Source§impl Hash for ModemStatus
impl Hash for ModemStatus
Source§impl PartialEq for ModemStatus
impl PartialEq for ModemStatus
Source§fn eq(&self, other: &ModemStatus) -> bool
fn eq(&self, other: &ModemStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ModemStatus
Auto Trait Implementations§
impl Freeze for ModemStatus
impl RefUnwindSafe for ModemStatus
impl Send for ModemStatus
impl Sync for ModemStatus
impl Unpin for ModemStatus
impl UnsafeUnpin for ModemStatus
impl UnwindSafe for ModemStatus
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