[−][src]Struct lorawan::maccommandcreator::LinkADRReqCreator
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
impl LinkADRReqCreator
[src]
pub fn new() -> Self
[src]
Creates a new instance of the class.
pub fn build(&self) -> &[u8]
[src]
Returns the serialized version of the class as bytes.
impl LinkADRReqCreator
[src]
pub fn set_data_rate(&mut self, data_rate: u8) -> Result<&mut Self, &str>
[src]
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.
pub fn set_tx_power(&mut self, tx_power: u8) -> Result<&mut Self, &str>
[src]
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.
pub fn set_channel_mask<T: Into<ChannelMask>>(
&mut self,
channel_mask: T
) -> &mut Self
[src]
&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.
pub fn set_redundancy<T: Into<Redundancy>>(
&mut self,
redundancy: T
) -> &mut Self
[src]
&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
impl Default for LinkADRReqCreator
[src]
impl SerializableMacCommand for LinkADRReqCreator
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,