Show / Hide Table of Contents

Interface ISwitchAsync

Defines the capabilities supported by an ASCOM Alpaca Switch device

Inherited Members
IDeviceAsync.DeviceNumber
IDeviceAsync.InvokeActionAsync(String, String)
IDeviceAsync.SendCommandBlindAsync(String, Boolean)
IDeviceAsync.SendCommandBoolAsync(String, Boolean)
IDeviceAsync.SendCommandStringAsync(String, Boolean)
IDeviceAsync.IsConnectedAsync()
IDeviceAsync.SetConnectedAsync(Boolean)
IDeviceAsync.GetDescriptionAsync()
IDeviceAsync.GetDriverInfoAsync()
IDeviceAsync.GetDriverVersionAsync()
IDeviceAsync.GetInterfaceVersionAsync()
IDeviceAsync.GetNameAsync()
IDeviceAsync.GetSupportedActionsAsync()
Namespace: ES.Ascom.Alpaca.Devices
Assembly: ES.Ascom.Alpaca.Shared.dll
Syntax
public interface ISwitchAsync : IDeviceAsync

Methods

| Improve this Doc View Source

CanWriteAsync(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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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

See Also

ISwitch
  • Improve this Doc
  • View Source
Back to top Generated by DocFX