[][src]Struct lorawan::creator::JoinRequestCreator

pub struct JoinRequestCreator<D, F> { /* fields omitted */ }

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

Implementations

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

pub fn with_options<'a>(data: D, factory: F) -> Result<Self, &'a str>[src]

Creates a well initialized JoinRequestCreator with specific crypto functions.

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

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.

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

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.

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

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.

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

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

Argument

  • key - the key to be used for setting the MIC.

impl JoinRequestCreator<[u8; 23], DefaultFactory>[src]

pub fn new() -> Self[src]

Creates a well initialized JoinRequestCreator.

Examples

let mut phy = lorawan::creator::JoinRequestCreator::new();
let key = lorawan::keys::AES128([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).unwrap();

Trait Implementations

impl<D: Default, F: Default> Default for JoinRequestCreator<D, F>[src]

Auto Trait Implementations

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

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

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.