Interface ISwitchAsync
Defines the capabilities supported by an ASCOM Alpaca Switch device
Inherited Members
Namespace: ES.Ascom.Alpaca.Devices
Assembly: ES.Ascom.Alpaca.Shared.dll
Syntax
public interface ISwitchAsync : IDeviceAsync
Methods
| Improve this Doc View SourceCanWriteAsync(Int32)
Reports if the specified switch device can be written to, default true. This is false if the device cannot be written to, for example a limit switch or a sensor. Devices are numbered from 0 to MaxSwitch - 1
Declaration
Task<bool> CanWriteAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |
GetMaxSwitchAsync()
Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1
Declaration
Task<int> GetMaxSwitchAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> |
GetMaxSwitchValueAsync(Int32)
Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Declaration
Task<double> GetMaxSwitchValueAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Double> |
GetMinSwitchValueAsync(Int32)
Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Declaration
Task<double> GetMinSwitchValueAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Double> |
GetSwitchAsync(Int32)
Return the state of switch device id as a boolean. Devices are numbered from 0 to MaxSwitch - 1
Declaration
Task<bool> GetSwitchAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |
GetSwitchDescriptionAsync(Int32)
Gets the description of the specified switch device. This is to allow a fuller description of the device to be returned, for example for a tool tip. Devices are numbered from 0 to MaxSwitch - 1
Declaration
Task<string> GetSwitchDescriptionAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |
GetSwitchNameAsync(Int32)
Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1
Declaration
Task<string> GetSwitchNameAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |
GetSwitchStepAsync(Int32)
Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.
Declaration
Task<double> GetSwitchStepAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Double> |
GetSwitchValueAsync(Int32)
Gets the value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1, The value of this switch is expected to be between MinSwitchValue and MaxSwitchValue.
Declaration
Task<double> GetSwitchValueAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Double> |
SetSwitchAsync(Int32, Boolean)
Sets a switch controller device to the specified state, true or false.
Declaration
Task SetSwitchAsync(int id, bool state)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.Boolean | state | The required control state (True or False) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SetSwitchNameAsync(Int32, String)
Sets a switch device name to the specified value.
Declaration
Task SetSwitchNameAsync(int id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.String | name | The name of the device |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SetSwitchValueAsync(Int32, Double)
Sets a switch device value to the specified value.
Declaration
Task SetSwitchValueAsync(int id, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.Double | value | The value to be set, between MinSwitchValue and MaxSwitchValue |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |