Sets a switch controller device to the specified state, true or false.

Namespace: ASCOM.DeviceInterface
Assembly: ASCOM.DeviceInterfaces (in ASCOM.DeviceInterfaces.dll) Version: 6.0.0.0 (6.1.1.2619)

Syntax

C#
void SetSwitch(
	short id,
	bool state
)
Visual Basic
Sub SetSwitch ( _
	id As Short, _
	state As Boolean _
)
Visual C++
void SetSwitch(
	short id, 
	bool state
)

Parameters

id
Type: System..::..Int16
The device number (0 to MaxSwitch - 1)
state
Type: System..::..Boolean
The required control state

Remarks

Can throw a MethodNotImplementedException if CanWrite(Int16) is False.

GetSwitchValue(Int16) must return MaxSwitchValue(Int16) if the set state is true and MinSwitchValue(Int16) if the set state is false.

Devices are numbered from 0 to MaxSwitch - 1

Exceptions

ExceptionCondition
ASCOM..::..InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
ASCOM..::..MethodNotImplementedExceptionIf CanWrite(Int16) is false.

See Also