pub struct JoinAcceptCreator<D, F> { /* private fields */ }
Expand description

JoinAcceptCreator serves for creating binary representation of Physical Payload of JoinAccept.

Implementations§

source§

impl<D: AsMut<[u8]>, F: CryptoFactory + Default> JoinAcceptCreator<D, F>

source

pub fn with_options(data: D, factory: F) -> Result<Self, Error>

Creates a well initialized JoinAcceptCreator with specific data and crypto functions.

TODO: Add more details & and example

source

pub fn set_app_nonce<H: AsRef<[u8]>, T: Into<AppNonce<H>>>( &mut self, app_nonce: T ) -> &mut Self

Sets the AppNonce of the JoinAccept to the provided value.

Argument
  • app_nonce - instance of lorawan::parser::AppNonce or anything that can be converted into it.
source

pub fn set_net_id<H: AsRef<[u8]>, T: Into<NwkAddr<H>>>( &mut self, net_id: T ) -> &mut Self

Sets the network ID of the JoinAccept to the provided value.

Argument
  • net_id - instance of lorawan::parser::NwkAddr or anything that can be converted into it.
source

pub fn set_dev_addr<H: AsRef<[u8]>, T: Into<DevAddr<H>>>( &mut self, dev_addr: T ) -> &mut Self

Sets the device address of the JoinAccept to the provided value.

Argument
  • dev_addr - instance of lorawan::parser::DevAddr or anything that can be converted into it.
source

pub fn set_dl_settings<T: Into<DLSettings>>( &mut self, dl_settings: T ) -> &mut Self

Sets the DLSettings of the JoinAccept to the provided value.

Argument
  • dl_settings - instance of lorawan::maccommands::DLSettings or anything that can be converted into it.
source

pub fn set_rx_delay(&mut self, rx_delay: u8) -> &mut Self

Sets the RX delay of the JoinAccept to the provided value.

Argument
  • rx_delay - the rx delay for the first receive window.
source

pub fn set_c_f_list<'a, C: AsRef<[Frequency<'a>]>>( &mut self, list: C ) -> Result<&mut Self, Error>

Sets the CFList of the JoinAccept to the provided value.

Argument
  • ch_list - list of Frequences to be sent to the device.
source

pub fn build(&mut self, key: &AES128) -> Result<&[u8], Error>

Provides the binary representation of the encrypted join accept physical payload with the MIC set.

Argument
  • key - the key to be used for encryption and setting the MIC.

Trait Implementations§

source§

impl<D: Default, F: Default> Default for JoinAcceptCreator<D, F>

source§

fn default() -> JoinAcceptCreator<D, F>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D, F> RefUnwindSafe for JoinAcceptCreator<D, F>

§

impl<D, F> Send for JoinAcceptCreator<D, F>
where D: Send, F: Send,

§

impl<D, F> Sync for JoinAcceptCreator<D, F>
where D: Sync, F: Sync,

§

impl<D, F> Unpin for JoinAcceptCreator<D, F>
where D: Unpin, F: Unpin,

§

impl<D, F> UnwindSafe for JoinAcceptCreator<D, F>
where D: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.