pub struct FCtrl(pub u8);Expand description
FCtrl byte in a data-frame FHDR.
Bit layout (uplink and downlink differ on bit 4):
- Bit 7: ADR
- Bit 6:
ADRACKReq(uplink) / RFU (downlink) - Bit 5: ACK
- Bit 4:
ClassB(uplink) /FPending(downlink) - Bits 3..0:
FOptsLen
§Examples
use lora_packet::FCtrl;
let c = FCtrl(0b1010_0110);
assert!(c.adr());
assert!(c.ack());
assert_eq!(c.f_opts_len(), 6);Tuple Fields§
§0: u8Implementations§
Source§impl FCtrl
impl FCtrl
Sourcepub const fn adr_ack_req(&self) -> bool
pub const fn adr_ack_req(&self) -> bool
ADRACKReq bit (uplink only).
Sourcepub const fn f_pending(&self) -> bool
pub const fn f_pending(&self) -> bool
FPending bit (downlink only; same position as ClassB on uplink).
Sourcepub const fn class_b(&self) -> bool
pub const fn class_b(&self) -> bool
ClassB bit (uplink only; same position as FPending on downlink).
Sourcepub const fn f_opts_len(&self) -> u8
pub const fn f_opts_len(&self) -> u8
FOpts length in bytes (0..=15).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FCtrl
impl<'de> Deserialize<'de> for FCtrl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for FCtrl
impl Eq for FCtrl
impl StructuralPartialEq for FCtrl
Auto Trait Implementations§
impl Freeze for FCtrl
impl RefUnwindSafe for FCtrl
impl Send for FCtrl
impl Sync for FCtrl
impl Unpin for FCtrl
impl UnsafeUnpin for FCtrl
impl UnwindSafe for FCtrl
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