Table of Contents

Class LoraPlanBuilder

Namespace
Pamoja.Lora
Assembly
Pamoja.Lora.dll

A channel plan under construction.

public sealed class LoraPlanBuilder : IDisposable
Inheritance
LoraPlanBuilder
Implements
Inherited Members

Remarks

Tables are indexed by position, so entries are added in data-rate order and a number the plan does not use is added as a reserved data rate. What a region would share between directions is filled in by Build(): an empty downlink data-rate table mirrors the uplink one, an empty downlink payload table mirrors its uplink counterpart, and an empty back-off chain steps down one data rate at a time.

A plan built here is the same kind of thing as a published region. A deployment holding licensed spectrum, or one working somewhere no published plan describes, gets every answer a named band gives.

Constructors

LoraPlanBuilder(string)

Starts an empty plan.

public LoraPlanBuilder(string name)

Parameters

name string

What to call the plan, such as the band it covers.

Remarks

The plan begins with no data rates, channels, or sub-bands, a two-decibel power ladder, and no dwell-time limit.

Exceptions

PamojaException

The native core rejected the name.

Methods

Backoff(byte?)

Adds the next entry of the adaptive back-off chain.

public LoraPlanBuilder Backoff(byte? lower)

Parameters

lower byte?

The data rate to fall back to, or null at the slowest, which has nothing below it.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Beacon(LoraBeacon, bool)

Sets the Class B beacon and whether the plan limits dwell time.

public LoraPlanBuilder Beacon(LoraBeacon beacon, bool hasDwellTimeLimit = false)

Parameters

beacon LoraBeacon

The beacon settings.

hasDwellTimeLimit bool

Whether the plan caps how long one transmission may hold a channel.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Build()

Finishes the plan.

public LoraChannelPlan Build()

Returns

LoraChannelPlan

The plan, which answers what a published region does.

Remarks

The builder is spent once this returns, whether the plan was accepted or refused.

Exceptions

PamojaException

The builder has already been built, or the plan would answer a question wrongly: an RX1 row narrower than the plan's offsets allow, a table whose length disagrees with the data rates it indexes, or a second receive window listening at a data rate the plan does not define.

ChannelBlock(LoraChannelBlock, LoraChannelSet)

Adds a run of evenly spaced channels.

public LoraPlanBuilder ChannelBlock(LoraChannelBlock block, LoraChannelSet which = LoraChannelSet.Default)

Parameters

block LoraChannelBlock

The channels to add.

which LoraChannelSet

The join set or the default set.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

DataRate(LoraDataRate, LoraDirection)

Adds the next data rate in a direction.

public LoraPlanBuilder DataRate(LoraDataRate rate, LoraDirection direction = LoraDirection.Uplink)

Parameters

rate LoraDataRate

The data rate to add.

direction LoraDirection

Which table to extend.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Dispose()

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

public void Dispose()

MaxPayload(LoraMaxPayload?, LoraPayloadTable)

Adds the next entry of one payload table.

public LoraPlanBuilder MaxPayload(LoraMaxPayload? payload, LoraPayloadTable table = LoraPayloadTable.UplinkDirect)

Parameters

payload LoraMaxPayload?

The limits, or null for a data rate that carries nothing.

table LoraPayloadTable

Which table to extend.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Power(sbyte, byte, byte)

Sets the transmit-power ladder.

public LoraPlanBuilder Power(sbyte defaultMaxEirpDbm, byte stepDb = 2, byte maxIndex = 7)

Parameters

defaultMaxEirpDbm sbyte

The ceiling where no sub-band says otherwise.

stepDb byte

The step between power settings, in decibels.

maxIndex byte

The highest power index the plan defines.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Rx(uint, byte, byte)

Sets the receive windows.

public LoraPlanBuilder Rx(uint rx2FrequencyHz, byte rx2DataRate = 0, byte maxRx1Offset = 0)

Parameters

rx2FrequencyHz uint

The frequency the second window listens on.

rx2DataRate byte

The data rate the second window listens at.

maxRx1Offset byte

The highest RX1 offset the plan allows, which fixes how wide every RX1 row must be.

Returns

LoraPlanBuilder

This builder, so calls chain.

Exceptions

PamojaException

The builder has already been built.

Rx1Row(ReadOnlySpan<byte>, bool)

Adds the RX1 downlink data rates for the next uplink data rate.

public LoraPlanBuilder Rx1Row(ReadOnlySpan<byte> offsets, bool dwellLimited = false)

Parameters

offsets ReadOnlySpan<byte>

The downlink data rate at each offset, in order.

dwellLimited bool

Whether this extends the dwell-limited mapping.

Returns

LoraPlanBuilder

This builder, so calls chain.

Remarks

Every row must be as wide as the plan's highest RX1 offset allows.

Exceptions

PamojaException

The builder has already been built.

SubBand(LoraSubBand)

Adds a sub-band and the transmit limits inside it.

public LoraPlanBuilder SubBand(LoraSubBand band)

Parameters

band LoraSubBand

The sub-band to add.

Returns

LoraPlanBuilder

This builder, so calls chain.

Remarks

A deployment on licensed spectrum gives its sub-band a duty cycle of 1000, which reports as unrestricted.

Exceptions

PamojaException

The builder has already been built.