ServiceClient.InvokeDeviceMethodAsync Method

Definition

Overloads

InvokeDeviceMethodAsync(String, CloudToDeviceMethod, CancellationToken)

Interactively invokes a method on a device. Additional 15s is added to the timeout in cloudToDeviceMethod to account for time taken to wire a request

InvokeDeviceMethodAsync(String, String, CloudToDeviceMethod, CancellationToken)

Interactively invokes a method on a module.

InvokeDeviceMethodAsync(String, CloudToDeviceMethod, CancellationToken)

Interactively invokes a method on a device. Additional 15s is added to the timeout in cloudToDeviceMethod to account for time taken to wire a request

C#
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Devices.CloudToDeviceMethodResult> InvokeDeviceMethodAsync(string deviceId, Microsoft.Azure.Devices.CloudToDeviceMethod cloudToDeviceMethod, System.Threading.CancellationToken cancellationToken = default);

Parameters

deviceId
String

The device identifier for the target device.

cloudToDeviceMethod
CloudToDeviceMethod

Parameters to execute a direct method on the device.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The CloudToDeviceMethodResult.

Exceptions

When cloudToDeviceMethod is null.

Applies to

Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest

InvokeDeviceMethodAsync(String, String, CloudToDeviceMethod, CancellationToken)

Interactively invokes a method on a module.

C#
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Devices.CloudToDeviceMethodResult> InvokeDeviceMethodAsync(string deviceId, string moduleId, Microsoft.Azure.Devices.CloudToDeviceMethod cloudToDeviceMethod, System.Threading.CancellationToken cancellationToken = default);

Parameters

deviceId
String

The device identifier for the target device.

moduleId
String

The module identifier for the target module.

cloudToDeviceMethod
CloudToDeviceMethod

Parameters to execute a direct method on the module.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The CloudToDeviceMethodResult.

Exceptions

When cloudToDeviceMethod is null.

Applies to

Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest