[][src]Struct lorawan::parser::JoinRequestPayload

pub struct JoinRequestPayload<T, F>(_, _);

JoinAcceptPayload represents a JoinRequest.

It can be built either directly through the new or using the parse function.

Implementations

impl<T: AsRef<[u8]>, F: CryptoFactory> JoinRequestPayload<T, F>[src]

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

Creates a new JoinRequestPayload if the provided data is acceptable.

Argument

  • data - the bytes for the payload.

Examples

let data = vec![0x00, 0x04, 0x03, 0x02, 0x01, 0x04, 0x03, 0x02, 0x01, 0x05, 0x04, 0x03,
    0x02, 0x05, 0x04, 0x03, 0x02, 0x2d, 0x10, 0x6a, 0x99, 0x0e, 0x12];
let phy = lorawan::parser::JoinRequestPayload::new_with_factory(data,
    lorawan::default_crypto::DefaultFactory);

pub fn app_eui(&self) -> EUI64<&[u8]>[src]

Gives the APP EUI of the JoinRequest.

pub fn dev_eui(&self) -> EUI64<&[u8]>[src]

Gives the DEV EUI of the JoinRequest.

pub fn dev_nonce(&self) -> DevNonce<&[u8]>[src]

Gives the DEV Nonce of the JoinRequest.

pub fn validate_mic(&self, key: &AES128) -> bool[src]

Verifies that the JoinRequest has correct MIC.

impl<T: AsRef<[u8]>> JoinRequestPayload<T, DefaultFactory>[src]

pub fn new<'a>(data: T) -> Result<Self, &'a str>[src]

Creates a new JoinRequestPayload if the provided data is acceptable.

Argument

  • data - the bytes for the payload.

Examples

let data = vec![0x00, 0x04, 0x03, 0x02, 0x01, 0x04, 0x03, 0x02, 0x01, 0x05, 0x04, 0x03,
    0x02, 0x05, 0x04, 0x03, 0x02, 0x2d, 0x10, 0x6a, 0x99, 0x0e, 0x12];
let phy = lorawan::parser::JoinRequestPayload::new(data);

Trait Implementations

impl<T: AsRef<[u8]>, F> AsPhyPayloadBytes for JoinRequestPayload<T, F>[src]

impl<T: Debug, F: Debug> Debug for JoinRequestPayload<T, F>[src]

impl<T: PartialEq, F: PartialEq> PartialEq<JoinRequestPayload<T, F>> for JoinRequestPayload<T, F>[src]

impl<T, F> StructuralPartialEq for JoinRequestPayload<T, F>[src]

Auto Trait Implementations

impl<T, F> RefUnwindSafe for JoinRequestPayload<T, F> where
    F: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, F> Send for JoinRequestPayload<T, F> where
    F: Send,
    T: Send

impl<T, F> Sync for JoinRequestPayload<T, F> where
    F: Sync,
    T: Sync

impl<T, F> Unpin for JoinRequestPayload<T, F> where
    F: Unpin,
    T: Unpin

impl<T, F> UnwindSafe for JoinRequestPayload<T, F> where
    F: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

impl<T> AsPhyPayloadBytes for T where
    T: DataHeader
[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> MHDRAble for T where
    T: AsPhyPayloadBytes
[src]

impl<T> MICAble for T where
    T: AsPhyPayloadBytes
[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.