Share via


DeviceClient.GetTwinAsync Method

Definition

Overloads

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).

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

The device twin object for the current device

Applies to

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
CancellationToken

A cancellation token to cancel the operation.

Returns

The device twin object for the current device

Exceptions

Thrown when the operation has been canceled.

Thrown when the operation has been canceled. The inner exception will be OperationCanceledException.

Applies to