Class LorawanBlockMic
The code taken over a data block as it arrives, TS004-2.0.0 section 3.3.
public sealed class LorawanBlockMic : IDisposable
- Inheritance
-
LorawanBlockMic
- Implements
- Inherited Members
Constructors
LorawanBlockMic(ReadOnlySpan<byte>, ushort, byte, ReadOnlySpan<byte>, uint)
Starts a code over one session's block.
public LorawanBlockMic(ReadOnlySpan<byte> dataBlockIntKey, ushort sessionCnt, byte fragIndex, ReadOnlySpan<byte> descriptor, uint blockLen)
Parameters
dataBlockIntKeyReadOnlySpan<byte>What DataBlockIntKey(ReadOnlySpan<byte>) derived.
sessionCntushortThe session counter the setup carried.
fragIndexbyteWhich session.
descriptorReadOnlySpan<byte>The four bytes the server described the block with.
blockLenuintThe block's length in bytes, padding excluded.
Exceptions
- ArgumentException
The key or the descriptor was the wrong length.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Finish()
Finishes the code, returning the four bytes a session setup carries.
public byte[] Finish()
Returns
- byte[]
The code.
Exceptions
- PamojaException
The code was already finished.
Update(ReadOnlySpan<byte>)
Adds a piece of the block, in order, without any padding.
public void Update(ReadOnlySpan<byte> data)
Parameters
dataReadOnlySpan<byte>The piece.
Exceptions
- PamojaException
The code was already finished.