### YamlMime:JavaType
uid: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod"
name: "DeviceMethod"
nameWithType: "DeviceMethod"
inheritances:
- ""
inheritedClassMethods:
- classRef: ""
methodsRef:
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- ""
syntax: "public final class **DeviceMethod**"
constructors:
- uid: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod.DeviceMethod(com.microsoft.azure.sdk.iot.device.DeviceIO,com.microsoft.azure.sdk.iot.device.DeviceClientConfig,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod.DeviceMethod(DeviceIO deviceIO, DeviceClientConfig config, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
name: "DeviceMethod(DeviceIO deviceIO, DeviceClientConfig config, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
nameWithType: "DeviceMethod.DeviceMethod(DeviceIO deviceIO, DeviceClientConfig config, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
summary: "This constructor creates an instance of device method class which helps facilitate the interation for device methods between the user and IotHub."
parameters:
- description: "Device client object for this connection instance for the device. Cannot be null
"
name: "deviceIO"
type: ""
- description: "Device client configuration Cannot be null
"
name: "config"
type: ""
- description: "Callback to provide status for device method state with IotHub. Cannot be null
."
name: "deviceMethodStatusCallback"
type: ""
- description: "Context to be passed when device method status is invoked. Can be null
"
name: "deviceMethodStatusCallbackContext"
type: ""
syntax: "public DeviceMethod(DeviceIO deviceIO, DeviceClientConfig config, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
exceptions:
- description: "This exception is thrown if either deviceIO or config or deviceMethodStatusCallback are null"
type: ""
desc: "This constructor creates an instance of device method class which helps facilitate the interation for device methods between the user and IotHub."
methods:
- uid: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod.subscribeToDeviceMethod(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethod.subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext)"
name: "subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext)"
nameWithType: "DeviceMethod.subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext)"
summary: "A method which subscribes to receive device method invocation for the user with the IotHub."
parameters:
- description: "Callback where upon receiving the request the\n invoke a method shall be triggered."
name: "deviceMethodCallback"
type: ""
- description: "Context to be passed on when invoking the\n callback."
name: "deviceMethodCallbackContext"
type: ""
syntax: "public void subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext)"
exceptions:
- description: "This exception is thrown when deviceMethodCallback is provided null."
type: ""
desc: "A method which subscribes to receive device method invocation for the user with the IotHub."
type: "class"
metadata: {}
package: "com.microsoft.azure.sdk.iot.device.DeviceTwin"
artifact: com.microsoft.azure.sdk.iot:iot-device-client:1.30.1