Class LorawanDevice
The root credentials over-the-air activation is built on.
public sealed class LorawanDevice : IDisposable
- Inheritance
-
LorawanDevice
- Implements
- Inherited Members
Constructors
LorawanDevice(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Creates a device from its two EUIs and its application key.
public LorawanDevice(ReadOnlySpan<byte> devEui, ReadOnlySpan<byte> appEui, ReadOnlySpan<byte> appKey)
Parameters
devEuiReadOnlySpan<byte>The 8-byte device EUI.
appEuiReadOnlySpan<byte>The 8-byte application (join) EUI.
appKeyReadOnlySpan<byte>The 16-byte application key the join is secured with.
Exceptions
- PamojaException
A credential is the wrong length.
Methods
AcceptJoin(ReadOnlySpan<byte>, ushort)
Turns the join accept a network sent into the settings it grants.
public LorawanJoinAccept AcceptJoin(ReadOnlySpan<byte> bytes, ushort devNonce)
Parameters
bytesReadOnlySpan<byte>The join accept exactly as it arrived.
devNonceushortThe nonce the matching join request carried.
Returns
- LorawanJoinAccept
The accepted join, which grants a session.
Exceptions
- PamojaException
The MIC does not verify, or the frame is not a join accept.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
JoinRequest(ushort)
Builds the join request this device broadcasts to activate.
public byte[] JoinRequest(ushort devNonce)
Parameters
devNonceushortA nonce that must never repeat for this device, since the network rejects a replayed one.
Returns
- byte[]
The join request to transmit.
Exceptions
- PamojaException
The native call failed.