DeviceMethod.invoke Method

定义

重载

invoke(String deviceId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)

Directly invokes a method on the device and return its result.

invoke(String deviceId, String moduleId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)

Directly invokes a method on the module and return its result.

invoke(String deviceId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)

Directly invokes a method on the device and return its result.

public synchronized MethodResult invoke(String deviceId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)
参数
deviceId
String

is the device where the request is send to.

methodName
String

is the name of the method that shall be invoked on the device.

responseTimeoutInSeconds
Long

is the maximum waiting time for a response from the device in seconds.

connectTimeoutInSeconds
Long

is the maximum waiting time for a response from the connection in seconds.

payload
Object

is the the method parameter

返回
synchronized MethodResult

the status and payload resulted from the method invoke

异常
IotHubException

This exception is thrown if the response verification failed

IOException

This exception is thrown if the IO operation failed

invoke(String deviceId, String moduleId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)

Directly invokes a method on the module and return its result.

public synchronized MethodResult invoke(String deviceId, String moduleId, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload)
参数
deviceId
String

is the device where the module is related to.

moduleId
String

is the module where the request is sent to.

methodName
String

is the name of the method that shall be invoked on the device.

responseTimeoutInSeconds
Long

is the maximum waiting time for a response from the device in seconds.

connectTimeoutInSeconds
Long

is the maximum waiting time for a response from the connection in seconds.

payload
Object

is the the method parameter

返回
synchronized MethodResult

the status and payload resulted from the method invoke

异常
IotHubException

This exception is thrown if the response verification failed

IOException

This exception is thrown if the IO operation failed

适用于