Table of Contents

Class SimulatedLoraChip

Namespace
Pamoja.Radios
Assembly
Pamoja.Radios.dll

A simulated SX126x or SX127x, which a LoraRadio drives with no radio attached.

public sealed class SimulatedLoraChip : IDisposable
Inheritance
SimulatedLoraChip
Implements
Inherited Members

Remarks

The program says what arrives on the air with Hear(ReadOnlySpan<byte>, double, double), and reads back what the chip was tuned to and what it sent with Tuning() and Sent(). Nothing is timed: a transmission is done as soon as it starts, and a reception with a timeout ends at once when nothing is waiting.

Properties

Family

The family of the chip.

public LoraRadioFamily Family { get; }

Property Value

LoraRadioFamily

Waiting

How many frames wait on the air for the chip to receive.

public int Waiting { get; }

Property Value

int

Methods

Dispose()

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

public void Dispose()

Hear(ReadOnlySpan<byte>, double, double)

Puts a frame on the air for the chip to receive the next time it listens.

public void Hear(ReadOnlySpan<byte> payload, double rssiDbm, double snrDb)

Parameters

payload ReadOnlySpan<byte>

The frame's payload; past 255 bytes it is cut to 255.

rssiDbm double

The strength the chip hears the frame at, in dBm.

snrDb double

The signal-to-noise ratio it hears it with, in dB.

Exceptions

ArgumentOutOfRangeException

A level is not a finite number.

HearCorrupt(double, double)

Puts a frame on the air whose CRC fails, which the chip reports and drops.

public void HearCorrupt(double rssiDbm, double snrDb)

Parameters

rssiDbm double

The strength the chip hears the frame at, in dBm.

snrDb double

The signal-to-noise ratio it hears it with, in dB.

Exceptions

ArgumentOutOfRangeException

A level is not a finite number.

Radio()

Returns a radio wired to the chip, reset as opening a module resets it.

public LoraRadio Radio()

Returns

LoraRadio

The radio, in standby and ready for Configure(LoraRadioConfig).

Sent()

Returns every frame the chip has put on the air, oldest first.

public IReadOnlyList<LoraSentFrame> Sent()

Returns

IReadOnlyList<LoraSentFrame>

The frames, each with what the chip was tuned to when it went out.

Sx126x(Sx126xBoard)

A simulated SX1261, SX1262, SX1268, or LLCC68, out of reset.

public static SimulatedLoraChip Sx126x(Sx126xBoard board)

Parameters

board Sx126xBoard

How the module wires the chip.

Returns

SimulatedLoraChip

The chip.

Exceptions

ArgumentOutOfRangeException

DIO3 cannot supply the TCXO voltage.

Sx127x(Sx127xBoard)

A simulated SX1276, SX1277, SX1278, or SX1279, out of reset.

public static SimulatedLoraChip Sx127x(Sx127xBoard board)

Parameters

board Sx127xBoard

How the module wires the chip.

Returns

SimulatedLoraChip

The chip.

Tuning()

Returns what the chip is tuned to now.

public LoraTuning Tuning()

Returns

LoraTuning

The tuning.