C# Class CyrusBuilt.MonoPi.Components.Sensors.SensorComponent

A component that is an abstraction of a sensor device. This is an implementation of CyrusBuilt.MonoPi.Components.Sensors.SensorBase.
Inheritance: SensorBase
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent object.

Call CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent. The CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose method leaves the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent in an unusable state. After calling CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent was occupying.

InterruptPoll ( ) : void

Interrupts the poll cycle.

Poll ( ) : void

Polls the input pin status.

SensorComponent ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent class. This is the default constructor.

SensorComponent ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent class with the CyrusBuilt.MonoPi.IO.GpioMem I/O pin to use.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releaseses all resources used this object.

Private Methods

Method Description
BackgroundExecutePoll ( ) : void

Executes the poll cycle on a background thread.

ExecutePoll ( ) : void

Executes the poll cycle. Does not return until CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.InterruptPoll is called.

Method Details

Dispose() public method

Releases all resource used by the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent object.
Call CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent. The CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose method leaves the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent in an unusable state. After calling CyrusBuilt.MonoPi.Components.Sensors.SensorComponent.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent was occupying.
public Dispose ( ) : void
return void

Dispose() protected method

Releaseses all resources used this object.
protected Dispose ( bool disposing ) : void
disposing bool /// Set true if disposing managed resources in addition to unmanaged. ///
return void

InterruptPoll() public method

Interrupts the poll cycle.
public InterruptPoll ( ) : void
return void

Poll() public method

Polls the input pin status.
/// This instance has been disposed. /// /// The specified pin is configured for output instead of input. ///
public Poll ( ) : void
return void

SensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent class. This is the default constructor.
public SensorComponent ( ) : System
return System

SensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorComponent class with the CyrusBuilt.MonoPi.IO.GpioMem I/O pin to use.
/// cannot null. ///
public SensorComponent ( IGpio pin ) : System
pin IGpio /// The I/O pin to use. ///
return System