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

JoinRequestCreator serves for creating binary representation of Physical Payload of JoinRequest.

Implementations§

source§

impl<D: AsMut<[u8]>, F: CryptoFactory> JoinRequestCreator<D, F>

source

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

Creates a well initialized JoinRequestCreator with specific crypto functions.

source

pub fn set_app_eui<H: AsRef<[u8]>, T: Into<EUI64<H>>>( &mut self, app_eui: T ) -> &mut Self

Sets the application EUI of the JoinRequest to the provided value.

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

pub fn set_dev_eui<H: AsRef<[u8]>, T: Into<EUI64<H>>>( &mut self, dev_eui: T ) -> &mut Self

Sets the device EUI of the JoinRequest to the provided value.

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

pub fn set_dev_nonce<H: AsRef<[u8]>, T: Into<DevNonce<H>>>( &mut self, dev_nonce: T ) -> &mut Self

Sets the device nonce of the JoinRequest to the provided value.

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

pub fn build(&mut self, key: &AppKey) -> &[u8]

Provides the binary representation of the JoinRequest physical payload with the MIC set.

Argument
  • key - the key to be used for setting the MIC.
source§

impl JoinRequestCreator<[u8; 23], DefaultFactory>

source

pub fn new() -> Self

Creates a well initialized JoinRequestCreator.

Examples
let mut phy = lorawan::creator::JoinRequestCreator::new();
let key = lorawan::keys::AppKey::from([7; 16]);
phy.set_app_eui(&[1; 8]);
phy.set_dev_eui(&[2; 8]);
phy.set_dev_nonce(&[3; 2]);
let payload = phy.build(&key);

Trait Implementations§

source§

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

source§

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

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<D, F> UnwindSafe for JoinRequestCreator<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.