Struct lorawan::maccommandcreator::LinkADRReqCreator
source · pub struct LinkADRReqCreator { /* private fields */ }
Expand description
LinkADRReqCreator serves for creating LinkADRReq MacCommand.
Examples
let mut creator = lorawan::maccommandcreator::LinkADRReqCreator::new();
let channel_mask_bytes = [0xc7, 0x0b];
let res = creator
.set_data_rate(0x05)
.unwrap()
.set_tx_power(0x03)
.unwrap()
.set_channel_mask(channel_mask_bytes)
.set_redundancy(0x37)
.build();
Implementations§
source§impl LinkADRReqCreator
impl LinkADRReqCreator
sourcepub fn set_data_rate(&mut self, data_rate: u8) -> Result<&mut Self, Error>
pub fn set_data_rate(&mut self, data_rate: u8) -> Result<&mut Self, Error>
Sets the data rate of the LinkADRReq to the provided value.
Argument
- data_rate - data rate index of the ADR request. The value must be between 0 and 15.
sourcepub fn set_tx_power(&mut self, tx_power: u8) -> Result<&mut Self, Error>
pub fn set_tx_power(&mut self, tx_power: u8) -> Result<&mut Self, Error>
Sets the tx power of the LinkADRReq to the provided value.
Argument
- tx_power - TX power index. The value must be between 0 and 15.
sourcepub fn set_channel_mask<T: Into<ChannelMask<2>>>(
&mut self,
channel_mask: T
) -> &mut Self
pub fn set_channel_mask<T: Into<ChannelMask<2>>>( &mut self, channel_mask: T ) -> &mut Self
Sets the channel mask of the LinkADRReq to the provided value.
Argument
- channel_mask - instance of maccommands::ChannelMask or anything that can be converted into it.
sourcepub fn set_redundancy<T: Into<Redundancy>>(
&mut self,
redundancy: T
) -> &mut Self
pub fn set_redundancy<T: Into<Redundancy>>( &mut self, redundancy: T ) -> &mut Self
Sets the redundancy of the LinkADRReq to the provided value.
Argument
- redundancy - instance of maccommands::Redundancy or anything that can be converted into it.
Trait Implementations§
source§impl Debug for LinkADRReqCreator
impl Debug for LinkADRReqCreator
source§impl Default for LinkADRReqCreator
impl Default for LinkADRReqCreator
Auto Trait Implementations§
impl RefUnwindSafe for LinkADRReqCreator
impl Send for LinkADRReqCreator
impl Sync for LinkADRReqCreator
impl Unpin for LinkADRReqCreator
impl UnwindSafe for LinkADRReqCreator
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