Table of Contents

Class SimulatedSensor

Namespace
Pamoja.Sim
Assembly
Pamoja.Sim.dll

A sensor that invents plausible readings.

public sealed class SimulatedSensor : IDisposable
Inheritance
SimulatedSensor
Implements
Inherited Members

Remarks

Simulated devices matter more from a binding than from Rust: someone writing against the SDK in C# can put a sensor, an actuator, and a lossy link into a unit test and find out what their code does when a reading drifts or a packet vanishes, without owning the device.

Constructors

SimulatedSensor(float, float, float, uint)

Creates a sensor that reads around a baseline.

public SimulatedSensor(float baseline, float driftPerRead = 0, float noise = 0, uint seed = 0)

Parameters

baseline float

The value it reads before drift and noise.

driftPerRead float

How much the baseline moves each read.

noise float

The amplitude of the wobble around it.

seed uint

The seed for that wobble, so a run repeats.

Exceptions

PamojaException

The native sensor could not be created.

Methods

Dispose()

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

public void Dispose()

ReadAsync()

Takes the next reading.

public Task<float> ReadAsync()

Returns

Task<float>

The reading.

Exceptions

PamojaException

The native call failed.