ClientExtensionsConnectAsync Method
Returns an awaitable, running,
Task that connects to the device. (Polls IAscomDeviceV2.Connecting)
Namespace: ASCOM.CommonAssembly: ASCOM.Common (in ASCOM.Common.dll) Version: 3.0.0-rc.1+86c25ce733aebb4d8b1b8a62e84770ea5e972bea
public static Task ConnectAsync(
this IAscomDeviceV2 device,
DeviceTypes deviceType,
int interfaceVersion,
CancellationToken cancellationToken = default,
int pollInterval = 1000,
ILogger logger = null
)
<ExtensionAttribute>
Public Shared Function ConnectAsync (
device As IAscomDeviceV2,
deviceType As DeviceTypes,
interfaceVersion As Integer,
Optional cancellationToken As CancellationToken = Nothing,
Optional pollInterval As Integer = 1000,
Optional logger As ILogger = Nothing
) As Task
- device IAscomDeviceV2
- A device that implements IAscomDeviceV2.
- deviceType DeviceTypes
- The device type
- interfaceVersion Int32
- The device's interface version
- cancellationToken CancellationToken (Optional)
- Cancellation token - Default: None
- pollInterval Int32 (Optional)
- Interval between polls of the completion variable (milliseconds) - Default: 1000 milliseconds.
- logger ILogger (Optional)
- ILogger instance that will receive operation messages from the method - Default: No logger
TaskAwaitable task that ends when the device has connected.In Visual Basic and C#, you can call this method as an instance method on any object of type
IAscomDeviceV2. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Works with both Platform 6 and Platform 7 interfaces.
Platform 7 Initiator: Connect - Complete when: Connecting is
Platform 6 Initiator: Connected = - Complete when: Connected is
The device type and interface version parameters are required in order to handle both Platform 6 interface devices that use the Connected property and
Platform 7 interface devices that use the Connect and Disconnectmethods.
Supported in: 2.0