Class GpioPinServiceBase
Provides a base implementation of a GPIO Pin Service.
Inheritance
GpioPinServiceBase
Inherited Members
Namespace: Unosquare.PiGpio.ManagedModel
Syntax
public abstract class GpioPinServiceBase
Constructors
GpioPinServiceBase(GpioPin)
Initializes a new instance of the GpioPinServiceBase class.
Declaration
protected GpioPinServiceBase(GpioPin pin)
Parameters
Type | Name | Description |
---|---|---|
GpioPin | pin | The pin. |
Properties
IsAvailable
Gets a value indicating whether this service is available on the associated pin.
Declaration
public bool IsAvailable { get; }
Property Value
Type | Description |
---|---|
Boolean |
Pin
Gets the associated pin.
Declaration
protected GpioPin Pin { get; }
Property Value
Type | Description |
---|---|
GpioPin |
Methods
ResolveAvailable()
Resolves the availability of this service for the associated pin.
Declaration
protected abstract bool ResolveAvailable()
Returns
Type | Description |
---|---|
Boolean | True when the service is deemed as available. |
ValidateAvailable()
Validates that this service is available. Otherwise, a NotSupportedException is thrown.
Declaration
protected void ValidateAvailable()
Exceptions
Type | Condition |
---|---|
NotSupportedException | Only pins marked as IsUserGpio support this service. |