Table of Contents

Class LorawanDefragmenter

Namespace
Pamoja.Lorawan
Assembly
Pamoja.Lorawan.dll

A fragmentation session being put back together, TS004-2.0.0 appendix A.2.

public sealed class LorawanDefragmenter : IDisposable
Inheritance
LorawanDefragmenter
Implements
Inherited Members

Remarks

The uncoded fragments go straight into the block. A coded fragment is reduced against everything already known and kept only if it says something new, so the working memory is sized by the losses rather than by the block.

Constructors

LorawanDefragmenter(ushort, byte, ushort)

Opens a session for a block of nbFrag fragments.

public LorawanDefragmenter(ushort nbFrag, byte fragSize, ushort maxLost)

Parameters

nbFrag ushort

How many uncoded fragments the block was cut into.

fragSize byte

How many bytes each fragment carries.

maxLost ushort

The most uncoded fragments to be able to solve for, which decides how much working memory the session takes.

Exceptions

PamojaException

The session is not one this build runs.

Properties

Done

Whether the whole block is there.

public bool Done { get; }

Property Value

bool

Missing

How many uncoded fragments are still missing.

public ushort Missing { get; }

Property Value

ushort

Received

How many fragments arrived, coded, uncoded and repeated.

public ushort Received { get; }

Property Value

ushort

Methods

Block()

The block, as far as it has been put back together, padding and all.

public byte[] Block()

Returns

byte[]

The block.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Fragment(ushort, ReadOnlySpan<byte>)

Takes one fragment of the session, counting from one.

public bool Fragment(ushort n, ReadOnlySpan<byte> data)

Parameters

n ushort

Which fragment.

data ReadOnlySpan<byte>

Its bytes.

Returns

bool

true once the block is whole.

Exceptions

PamojaException

The fragment is not one of this session, or the session ran out of memory to solve with.

MatrixLength(ushort, ushort)

The working memory a session of this shape takes, in bytes.

public static int MatrixLength(ushort nbFrag, ushort maxLost)

Parameters

nbFrag ushort

How many uncoded fragments the block was cut into.

maxLost ushort

How many of them the session can solve for.

Returns

int

The byte count the session allocates for itself.