[][src]Struct lorawan::maccommandcreator::NewChannelReqCreator

pub struct NewChannelReqCreator { /* fields omitted */ }

NewChannelReqCreator serves for creating NewChannelReq MacCommand.

Examples

let mut creator = lorawan::maccommandcreator::NewChannelReqCreator::new();
let res = creator
    .set_channel_index(0x0f)
    .set_frequency(&[0x12, 0x34, 0x56])
    .set_data_rate_range(0x53)
    .build();

Implementations

impl NewChannelReqCreator[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 NewChannelReqCreator[src]

pub fn set_channel_index(&mut self, channel_index: u8) -> &mut Self[src]

Sets the channel index of the NewChannelReq to the provided value.

Argument

  • channel_index - the value to be used as channel_index.

pub fn set_frequency<'a, T: Into<Frequency<'a>>>(
    &mut self,
    frequency: T
) -> &mut Self
[src]

Sets the frequency of the NewChannelReq to the provided value.

Argument

  • frequency - instance of maccommands::Frequency or anything that can be converted into it.

pub fn set_data_rate_range<T: Into<DataRateRange>>(
    &mut self,
    data_rate_range: T
) -> &mut Self
[src]

Sets the data rate range of the NewChannelReq to the provided value.

Argument

  • data_rate_range - instance of maccommands::DataRateRange or anything that can be converted into it.

Trait Implementations

impl Default for NewChannelReqCreator[src]

impl SerializableMacCommand for NewChannelReqCreator[src]

fn payload_bytes(&self) -> &[u8][src]

Bytes of the SerializableMacCommand without the cid.

fn cid(&self) -> u8[src]

The cid of the SerializableMacCommand.

fn payload_len(&self) -> usize[src]

Length of the SerializableMacCommand without the cid.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.