Skip to content

Commit a3a0c2d

Browse files
committed
Updated Java article
1 parent 7a65104 commit a3a0c2d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

includes/iot-hub-howto-device-management-java.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ This article describes how to use the [Azure IoT SDK for Java](https://github.co
1919

2020
## Create a device application
2121

22-
This section describes how to use device application code to:
23-
24-
* Respond to a direct method called by the cloud
25-
* Trigger a simulated device reboot
22+
This section describes how to use device application code to create a direct method callback listener.
2623

2724
[!INCLUDE [iot-authentication-device-connection-string.md](iot-authentication-device-connection-string.md)]
2825

@@ -59,7 +56,7 @@ To connect to a device:
5956
client.open(true);
6057
```
6158

62-
### Create a direct method callback
59+
### Create a direct method callback listener
6360

6461
Call [subscribeToMethods](https://azure.github.io/azure-iot-sdk-java/master/device/com/microsoft/azure/sdk/iot/device/InternalClient.html#subscribeToMethods-com.microsoft.azure.sdk.iot.device.twin.MethodCallback-java.lang.Object-int-) to initialize a direct method callback listener. `subscribeToMethods` listens for incoming direct methods until the connection is terminated. The method name and payload is received for each direct method call.
6562

@@ -111,7 +108,7 @@ Call [invoke](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.devicemet
111108
This example calls the "reboot" method to initiate a reboot on the device. The "reboot" method is mapped to a listener on the device as described in the **Create a direct method callback** section of this article.
112109

113110
```java
114-
public static final String deviceId = "myFirstDevice2";
111+
public static final String deviceId = "myFirstDevice";
115112
private static final String methodName = "reboot";
116113
private static final Long responseTimeout = TimeUnit.SECONDS.toSeconds(30);
117114
private static final Long connectTimeout = TimeUnit.SECONDS.toSeconds(5);

0 commit comments

Comments
 (0)