Struct lorawan::maccommands::DutyCycleReqPayload
source · pub struct DutyCycleReqPayload<'a>(/* private fields */);
Expand description
DutyCycleReqPayload represents the DutyCycleReq LoRaWAN MACCommand.
Implementations§
source§impl<'a> DutyCycleReqPayload<'a>
impl<'a> DutyCycleReqPayload<'a>
sourcepub fn new(data: &'a [u8]) -> Result<DutyCycleReqPayload<'a>, Error>
pub fn new(data: &'a [u8]) -> Result<DutyCycleReqPayload<'a>, Error>
Creates a new instance of the MAC command if there is enought data.
sourcepub fn new_from_raw(data: &'a [u8]) -> DutyCycleReqPayload<'a>
pub fn new_from_raw(data: &'a [u8]) -> DutyCycleReqPayload<'a>
Constructs a new instance of the MAC command from the provided data, without verifying the data length.
Improper use of this method could lead to panic during runtime!
source§impl<'a> DutyCycleReqPayload<'a>
impl<'a> DutyCycleReqPayload<'a>
sourcepub fn max_duty_cycle_raw(&self) -> u8
pub fn max_duty_cycle_raw(&self) -> u8
Integer value of the max duty cycle field.
sourcepub fn max_duty_cycle(&self) -> f32
pub fn max_duty_cycle(&self) -> f32
Value of the max duty cycle field as portion of time (ex: 0.5).
Trait Implementations§
source§impl<'a> Debug for DutyCycleReqPayload<'a>
impl<'a> Debug for DutyCycleReqPayload<'a>
source§impl<'a> Format for DutyCycleReqPayload<'a>
impl<'a> Format for DutyCycleReqPayload<'a>
source§impl<'a> PartialEq for DutyCycleReqPayload<'a>
impl<'a> PartialEq for DutyCycleReqPayload<'a>
impl<'a> Eq for DutyCycleReqPayload<'a>
impl<'a> StructuralPartialEq for DutyCycleReqPayload<'a>
Auto Trait Implementations§
impl<'a> Freeze for DutyCycleReqPayload<'a>
impl<'a> RefUnwindSafe for DutyCycleReqPayload<'a>
impl<'a> Send for DutyCycleReqPayload<'a>
impl<'a> Sync for DutyCycleReqPayload<'a>
impl<'a> Unpin for DutyCycleReqPayload<'a>
impl<'a> UnwindSafe for DutyCycleReqPayload<'a>
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