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>
impl<D: AsMut<[u8]>, F: CryptoFactory> JoinRequestCreator<D, F>
Sourcepub fn with_options(data: D, factory: F) -> Result<Self, Error>
pub fn with_options(data: D, factory: F) -> Result<Self, Error>
Creates a well initialized JoinRequestCreator with specific crypto functions.
Sourcepub fn set_app_eui<H: AsRef<[u8]>, T: Into<EUI64<H>>>(
&mut self,
app_eui: T,
) -> &mut Self
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.
Sourcepub fn set_dev_eui<H: AsRef<[u8]>, T: Into<EUI64<H>>>(
&mut self,
dev_eui: T,
) -> &mut Self
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§impl JoinRequestCreator<[u8; 23], DefaultFactory>
impl JoinRequestCreator<[u8; 23], DefaultFactory>
Sourcepub fn new() -> Self
Available on crate feature default-crypto only.
pub fn new() -> Self
default-crypto only.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§
Auto Trait Implementations§
impl<D, F> Freeze for JoinRequestCreator<D, F>
impl<D, F> RefUnwindSafe for JoinRequestCreator<D, F>where
D: RefUnwindSafe,
F: RefUnwindSafe,
impl<D, F> Send for JoinRequestCreator<D, F>
impl<D, F> Sync for JoinRequestCreator<D, F>
impl<D, F> Unpin for JoinRequestCreator<D, F>
impl<D, F> UnsafeUnpin for JoinRequestCreator<D, F>where
D: UnsafeUnpin,
F: UnsafeUnpin,
impl<D, F> UnwindSafe for JoinRequestCreator<D, F>where
D: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more