Table of Contents

Class LorawanCfList

Namespace
Pamoja.Lorawan
Assembly
Pamoja.Lorawan.dll

The optional channel list at the end of a join accept.

public sealed class LorawanCfList : IEquatable<LorawanCfList>
Inheritance
LorawanCfList
Implements
Inherited Members

Remarks

A network that wants a device on more channels than its region's defaults says so in sixteen bytes: five frequencies for a dynamic plan such as EU868, or six groups of channel mask bits for a fixed plan such as US915. The list keeps the bytes as they arrived and reads either form out of them.

Properties

Bytes

The sixteen bytes, as a join accept carries them.

public byte[] Bytes { get; }

Property Value

byte[]

Kind

Which form the list takes.

public LorawanCfListKind Kind { get; }

Property Value

LorawanCfListKind

TypeByte

The CFListType byte the list ends with.

public byte TypeByte { get; }

Property Value

byte

Methods

ChannelMaskGroups()

Reads the mask groups out of a type 1 list.

public ushort[]? ChannelMaskGroups()

Returns

ushort[]

Six groups, or null for a list of any other type.

EnabledChannels()

Lists the channels a type 1 list enables.

public IReadOnlyList<int> EnabledChannels()

Returns

IReadOnlyList<int>

The channel numbers, lowest first, which is empty for a list of any other type.

Enables(int)

Reports whether a type 1 list enables a channel.

public bool? Enables(int channel)

Parameters

channel int

The channel number, group * 16 + bit.

Returns

bool?

Whether its bit is set, or null for a list of any other type or a channel past the 96 the groups cover.

Equals(LorawanCfList?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(LorawanCfList? other)

Parameters

other LorawanCfList

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FrequenciesHz()

Reads the frequencies out of a type 0 list.

public uint[]? FrequenciesHz()

Returns

uint[]

Five frequencies in hertz, 0 for an unused slot, or null for a list of any other type.

FromBytes(ReadOnlySpan<byte>)

Keeps a channel list exactly as it arrived, whatever its type byte says.

public static LorawanCfList FromBytes(ReadOnlySpan<byte> bytes)

Parameters

bytes ReadOnlySpan<byte>

The sixteen CFList bytes.

Returns

LorawanCfList

The channel list.

Exceptions

PamojaException

There are not sixteen bytes.

FromChannelMasks(IReadOnlyList<ushort>)

Builds a type 1 list from channel mask groups.

public static LorawanCfList FromChannelMasks(IReadOnlyList<ushort> masks)

Parameters

masks IReadOnlyList<ushort>

Six groups, where bit n of group g enables channel g * 16 + n.

Returns

LorawanCfList

The channel list.

Exceptions

PamojaException

There are not six groups.

FromFrequencies(IReadOnlyList<uint>)

Builds a type 0 list from frequencies.

public static LorawanCfList FromFrequencies(IReadOnlyList<uint> frequenciesHz)

Parameters

frequenciesHz IReadOnlyList<uint>

Five frequencies in hertz, with 0 for a slot left unused.

Returns

LorawanCfList

The channel list.

Exceptions

PamojaException

There are not five, or a frequency is not a whole number of hundreds of hertz from 100 MHz to just under 1.678 GHz.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.