Click or drag to resize
SwitchGetSwitch Method
Return the state of switch device id as a boolean.

Namespace: ASCOM.DriverAccess
Assembly: ASCOM.DriverAccess (in ASCOM.DriverAccess.dll) Version: 6.0.0.0 (6.3.0.2839)
Syntax
public bool GetSwitch(
	short id
)

Parameters

id
Type: SystemInt16
The switch number to return

Return Value

Type: Boolean
True or false

Implements

ISwitchV2GetSwitch(Int16)
Exceptions
ExceptionCondition
InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
InvalidOperationExceptionIf the state cannot be read. This is not recommended but it is not always possible to read the state from some hardware. Once the state has been set the last state set should be returned.
Remarks

Must be implemented, must not throw an ASCOM.MethodNotImplementedException

All devices must implement this. A multi-state device will return true if the device is at the maximum value, false if the value is at the minumum and either true or false as specified by the driver developer for intermediate values.

See Also