Table of Contents

Class LorawanDevice

Namespace
Pamoja.Lorawan
Assembly
Pamoja.Lorawan.dll

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

devEui ReadOnlySpan<byte>

The 8-byte device EUI.

appEui ReadOnlySpan<byte>

The 8-byte application (join) EUI.

appKey ReadOnlySpan<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

bytes ReadOnlySpan<byte>

The join accept exactly as it arrived.

devNonce ushort

The 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

devNonce ushort

A 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.