Class LoraChannelPlan
A regional channel plan, published or private.
public sealed class LoraChannelPlan : IDisposable
- Inheritance
-
LoraChannelPlan
- Implements
- Inherited Members
Remarks
A channel plan is what a regulator and the LoRa Alliance publish about one band: which data rates exist, what each carries, how much of the time a node may hold a frequency, and where it listens for a downlink. The plan reports those facts and costs a transmission out against them; it never refuses one, because a deployment may hold licensed spectrum or be working under emergency provisions and only the operator knows which.
A plan assembled by LoraPlanBuilder is the same kind of thing as a published region, not a lesser one, and answers every question it does.
Properties
Name
The specification's name for the band, such as EU863-870.
public string Name { get; }
Property Value
Methods
ChannelBlocks(LoraChannelSet)
Returns the plan's channel blocks.
public IReadOnlyList<LoraChannelBlock> ChannelBlocks(LoraChannelSet which = LoraChannelSet.Default)
Parameters
whichLoraChannelSetThe join set or the default set.
Returns
- IReadOnlyList<LoraChannelBlock>
The blocks, in the order the plan lists them.
ChannelFrequencyHz(ushort)
Returns the centre frequency of one of the plan's default channels.
public uint? ChannelFrequencyHz(ushort channel)
Parameters
channelushortThe channel number, counting across the default blocks.
Returns
- uint?
The centre frequency in hertz, or
nullpast the last channel the plan starts a device with.
DataRate(byte, LoraDirection)
Returns the data rate a number selects.
public LoraDataRate? DataRate(byte dataRate, LoraDirection direction = LoraDirection.Uplink)
Parameters
dataRatebyteThe data-rate number.
directionLoraDirectionWhich table to read; the 900 MHz plans differ.
Returns
- LoraDataRate?
The data rate, or
nullpast the end of the plan's table. A number the region reserves is a rate of kind Reserved, which is different from one the plan never defines.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DutyCyclePermille(uint)
Returns the share of time a transmitter may hold a frequency.
public uint? DutyCyclePermille(uint frequencyHz)
Parameters
frequencyHzuintThe frequency in hertz.
Returns
- uint?
The limit in parts per thousand, where
1000means unrestricted, ornullif the frequency falls in no sub-band this plan describes.
Remarks
This reports the limit; it does not impose it. Pair it with MinOffTimeMicros(int, uint) to turn the limit into the silence a frame costs.
ForRegion(LoraRegion)
Returns the published plan for a region.
public static LoraChannelPlan ForRegion(LoraRegion region)
Parameters
regionLoraRegionThe band to describe.
Returns
- LoraChannelPlan
The plan, which answers every question about that band.
Exceptions
- PamojaException
The region is not one this build of the native library carries.
Info()
Returns the scalar facts of the plan.
public LoraPlanInfo Info()
Returns
- LoraPlanInfo
The plan's scalars.
IsAvailable(LoraRegion)
Reports whether a region is compiled into this build.
public static bool IsAvailable(LoraRegion region)
Parameters
regionLoraRegionThe band to check.
Returns
- bool
trueif the region is available.
Remarks
A library trimmed for a device carries only the bands it operates in, so a host offering a choice asks this before offering one.
LinkSettings(byte)
Returns the radio settings an uplink data rate selects.
public LoraLink? LinkSettings(byte dataRate)
Parameters
dataRatebyteThe uplink data-rate number.
Returns
- LoraLink
The settings, ready to hand to AirtimeMicros(int), or
nullif the number is reserved or not carried by LoRa.
MaxEirpDbm(uint)
Returns the power ceiling that applies at a frequency, in dBm EIRP.
public sbyte MaxEirpDbm(uint frequencyHz)
Parameters
frequencyHzuintThe frequency in hertz.
Returns
- sbyte
The ceiling, falling back to the plan's default where no sub-band says otherwise.
MaxPayload(byte, LoraPayloadTable)
Returns what a data rate may carry in one frame.
public LoraMaxPayload? MaxPayload(byte dataRate, LoraPayloadTable table = LoraPayloadTable.UplinkDirect)
Parameters
dataRatebyteThe data-rate number.
tableLoraPayloadTableWhich of the plan's payload tables to read.
Returns
- LoraMaxPayload?
The limits, or
nullwhere the plan publishes none.
NextBackoffDataRate(byte)
Returns the next lower data rate for adaptive back-off.
public byte? NextBackoffDataRate(byte dataRate)
Parameters
dataRatebyteThe data rate currently in use.
Returns
- byte?
The next lower data rate, or
nullat the slowest the plan has.
Remarks
A device that has lost the network steps down this chain, trading airtime for range until it is heard again.
Rx1DataRate(byte, byte, bool)
Returns the downlink data rate the first receive window listens at.
public byte? Rx1DataRate(byte uplinkDataRate, byte offset, bool dwellLimited = false)
Parameters
uplinkDataRatebyteThe data rate the uplink was sent at.
offsetbyteThe RX1 data-rate offset the network assigned.
dwellLimitedboolWhether to use the dwell-limited mapping.
Returns
- byte?
The downlink data rate, or
nullif the uplink data rate or offset is outside what the plan defines.
Rx2()
Returns where the second receive window listens.
public LoraRx2 Rx2()
Returns
- LoraRx2
The frequency and data rate.
SubBands()
Returns the plan's sub-bands and the transmit limits inside each.
public IReadOnlyList<LoraSubBand> SubBands()
Returns
- IReadOnlyList<LoraSubBand>
The sub-bands, in the order the plan lists them.
TxPowerDbm(byte, sbyte)
Returns the radiated power a transmit-power index selects, in dBm.
public sbyte? TxPowerDbm(byte index, sbyte maxEirpDbm)
Parameters
indexbyteThe transmit-power index, where zero is the ceiling.
maxEirpDbmsbyteThe ceiling the index steps down from.
Returns
- sbyte?
The radiated power, or
nullpast the highest index the plan defines.