Skip to main content

Class ByteCommsSensorBase<UNIT>

ByteCommsSensorBase abstract class

Assembly: Meadow.Foundation.dll
View Source
Declaration
public abstract class ByteCommsSensorBase<UNIT> : PollingSensorBase<UNIT>, IObservable<IChangeResult<UNIT>>, ISamplingSensor<UNIT>, ISensor<UNIT>, ISensor, ISamplingSensor, IDisposable where UNIT : struct

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT>

Derived:

Expand

Implements:
System.IObservable<Meadow.IChangeResult<<UNIT>>>, Meadow.Peripherals.Sensors.ISamplingSensor<<UNIT>>, Meadow.Peripherals.Sensors.ISensor<<UNIT>>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable

Properties

BusComms

Bus communications object, i.e. an I2cCommunications or SpiCommunications

View Source
Declaration
protected IByteCommunications BusComms { get; set; }

ReadBuffer

The read buffer

View Source
Declaration
protected Memory<byte> ReadBuffer { get; }

WriteBuffer

The write buffer

View Source
Declaration
protected Memory<byte> WriteBuffer { get; }

Methods

Init(int, int)

Simple constructor for peripherals that don't use a bus and don't need an IByteCommunications

View Source
Declaration
protected virtual void Init(int readBufferSize = 8, int writeBufferSize = 8)
Parameters
TypeName
System.Int32readBufferSize
System.Int32writeBufferSize

Dispose(bool)

Dispose of the object

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Dispose()

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

View Source
Declaration
public virtual void Dispose()

Implements

  • System.IObservable<Meadow.IChangeResult<<UNIT>>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<<UNIT>>
  • Meadow.Peripherals.Sensors.ISensor<<UNIT>>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable