Class Lorawan
The network side of LoRaWAN: reading a frame to route it, and admitting a device that asked to join.
public static class Lorawan
- Inheritance
-
Lorawan
- Inherited Members
Remarks
A deployment that runs its own network rather than joining someone else's needs both halves of the join exchange. This is the half a network server holds.
Methods
ParseHeader(ReadOnlySpan<byte>)
Reads a frame far enough to route it, without any key.
public static LorawanHeader ParseHeader(ReadOnlySpan<byte> bytes)
Parameters
bytesReadOnlySpan<byte>The raw frame as it came off the radio.
Returns
- LorawanHeader
What the header says the frame is.
Exceptions
- PamojaException
The frame is truncated or carries a message type this build does not read.
ParseJoinRequest(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Verifies a join-request and reads the identifiers out of it.
public static LorawanJoinRequest ParseJoinRequest(ReadOnlySpan<byte> bytes, ReadOnlySpan<byte> appKey)
Parameters
bytesReadOnlySpan<byte>The raw join-request as it came off the radio.
appKeyReadOnlySpan<byte>The 16-byte application root key the device shares.
Returns
- LorawanJoinRequest
The verified request.
Exceptions
- PamojaException
The MIC does not verify, which means the request was not sent by a holder of the key, or the frame is not a join-request.