pub struct JoinRequestPayload<T, F>(/* private fields */);
Expand description

JoinAcceptPayload represents a JoinRequest.

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

Implementations§

source§

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

source

pub fn new_with_factory(data: T, factory: F) -> Result<Self, Error>

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);
source

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

Gives the APP EUI of the JoinRequest.

source

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

Gives the DEV EUI of the JoinRequest.

source

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

Gives the DEV Nonce of the JoinRequest.

source

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

Verifies that the JoinRequest has correct MIC.

source§

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

source

pub fn new(data: T) -> Result<Self, Error>

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§

source§

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

source§

fn as_bytes(&self) -> &[u8]

source§

impl<T: Debug, F: Debug> Debug for JoinRequestPayload<T, F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: PartialEq, F: PartialEq> PartialEq for JoinRequestPayload<T, F>

source§

fn eq(&self, other: &JoinRequestPayload<T, F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Eq, F: Eq> Eq for JoinRequestPayload<T, F>

source§

impl<T, F> StructuralEq for JoinRequestPayload<T, F>

source§

impl<T, F> StructuralPartialEq for JoinRequestPayload<T, F>

Auto Trait Implementations§

§

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

§

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§

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> MHDRAble for T

source§

fn mhdr(&self) -> MHDR

Gives the MIC of the PhyPayload.
source§

impl<T> MICAble for T

source§

fn mic(&self) -> MIC

Gives the MIC of the PhyPayload.
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.