Class LoraPlanBuilder
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
namestringWhat 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
lowerbyte?The data rate to fall back to, or
nullat 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
beaconLoraBeaconThe beacon settings.
hasDwellTimeLimitboolWhether 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
blockLoraChannelBlockThe channels to add.
whichLoraChannelSetThe 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
rateLoraDataRateThe data rate to add.
directionLoraDirectionWhich 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
payloadLoraMaxPayload?The limits, or
nullfor a data rate that carries nothing.tableLoraPayloadTableWhich 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
defaultMaxEirpDbmsbyteThe ceiling where no sub-band says otherwise.
stepDbbyteThe step between power settings, in decibels.
maxIndexbyteThe 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
rx2FrequencyHzuintThe frequency the second window listens on.
rx2DataRatebyteThe data rate the second window listens at.
maxRx1OffsetbyteThe 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
offsetsReadOnlySpan<byte>The downlink data rate at each offset, in order.
dwellLimitedboolWhether 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
bandLoraSubBandThe 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.