Share via


DeviceClient.GetTwinAsync Method

Definition

Overloads

GetTwinAsync(CancellationToken)

Retrieve the device twin properties for the current device. For the complete device twin object, use Microsoft.Azure.Devices.RegistryManager.GetTwinAsync(string deviceId).

GetTwinAsync()

Retrieve the device twin properties for the current device. For the complete device twin object, use Microsoft.Azure.Devices.RegistryManager.GetTwinAsync(string deviceId).

GetTwinAsync(CancellationToken)

Retrieve the device twin properties for the current device. For the complete device twin object, use Microsoft.Azure.Devices.RegistryManager.GetTwinAsync(string deviceId).

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin> GetTwinAsync(System.Threading.CancellationToken cancellationToken);
member this.GetTwinAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin>
Public Function GetTwinAsync (cancellationToken As CancellationToken) As Task(Of Twin)

Parameters

cancellationToken
System.Threading.CancellationToken

A cancellation token to cancel the operation.

Returns

System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin>

The device twin object for the current device

Exceptions

System.OperationCanceledException

Thrown when the operation has been canceled.

Applies to

GetTwinAsync()

Retrieve the device twin properties for the current device. For the complete device twin object, use Microsoft.Azure.Devices.RegistryManager.GetTwinAsync(string deviceId).

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin> GetTwinAsync();
member this.GetTwinAsync : unit -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin>
Public Function GetTwinAsync () As Task(Of Twin)

Returns

System.Threading.Tasks.Task<Microsoft.Azure.Devices.Shared.Twin>

The device twin object for the current device

Applies to