You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/how-to-device-twins.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ This article shows you how to:
70
70
71
71
***IoT Hub service connection string**
72
72
73
-
In this article you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
73
+
In this article, you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
74
74
75
75
To create a shared access policy that grants **service connect** and **registry read** permissions and get a connection string for this policy, follow these steps:
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-device-twins-java.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,15 +102,15 @@ System.out.println("Successfully set property \"HomeTemp(F)\" to value " + newTe
102
102
103
103
### Subscribe to desired property changes
104
104
105
-
Call [subscribeToDesiredProperties](/java/api/com.microsoft.azure.sdk.iot.device.internalclient?#com-microsoft-azure-sdk-iot-device-internalclient-subscribetodesiredproperties(java-util-map(com-microsoft-azure-sdk-iot-device-devicetwin-property-com-microsoft-azure-sdk-iot-device-devicetwin-pair(com-microsoft-azure-sdk-iot-device-devicetwin-propertycallback(java-lang-string-java-lang-object)-java-lang-object)))) to subscribe to desired properties. This client will receive a callback with a `Twin` object each time a desired property is updated. That callback will either contain the full desired properties set, or only the updated desired property depending on how the desired property was changed.
105
+
Call [subscribeToDesiredProperties](/java/api/com.microsoft.azure.sdk.iot.device.internalclient?#com-microsoft-azure-sdk-iot-device-internalclient-subscribetodesiredproperties(java-util-map(com-microsoft-azure-sdk-iot-device-devicetwin-property-com-microsoft-azure-sdk-iot-device-devicetwin-pair(com-microsoft-azure-sdk-iot-device-devicetwin-propertycallback(java-lang-string-java-lang-object)-java-lang-object)))) to subscribe to desired properties. This client receives a callback with a `Twin` object each time a desired property is updated. That callback either contains the full desired properties set, or only the updated desired property depending on how the desired property was changed.
106
106
107
-
This example subscribes to desired propery changes. Any desired property changes will be passed to a handler named `DesiredPropertiesUpdatedHandler`.
107
+
This example subscribes to desired property changes. Any desired property changes are passed to a handler named `DesiredPropertiesUpdatedHandler`.
In this example, the `DesiredPropertiesUpdatedHandler` desired property change callback handler calls [getDesiredProperties](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.devicetwindevice?#com-microsoft-azure-sdk-iot-service-devicetwin-devicetwindevice-getdesiredproperties()) to retrieve the property changes, then prints out the updated twin properties.
113
+
In this example, the `DesiredPropertiesUpdatedHandler` desired property change callback handler calls [getDesiredProperties](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.devicetwindevice?#com-microsoft-azure-sdk-iot-service-devicetwin-devicetwindevice-getdesiredproperties()) to retrieve the property changes, then prints the updated twin properties.
This section demonstrates two device twin queries. Device twin queries are SQL-like queries that return a result set of device twins.
233
233
234
-
The [Query](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.query) classcontains methods that can be used to create SQL-style queries to IoT Hub for twins, jobs, device jobs or raw data.
234
+
The [Query](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.query) classcontains methods that can be used to create SQL-style queries to IoT Hub for twins, jobs, device jobs, or raw data.
Call [fromConnectionString](/javascript/api/azure-iot-device/client?#azure-iot-device-client-fromconnectionstring) to supply device connection parameters:
81
81
82
-
***connStr** - A connection string which encapsulates "device connect" permissions for an IoT hub. The connection string contains Hostname, Device ID & Shared Access Key in this format:
82
+
***connStr** - A connection string that encapsulates "device connect" permissions for an IoT hub. The connection string contains Hostname, Device ID & Shared Access Key in this format:
1. This code sets up a desired properties change event listener that triggers for any changes within the `properties.desired.climate` property grouping. If there is a desired property change within this group, min and max temperature change messages will be displayed to the console:
179
+
1. This code sets up a desired properties change event listener that triggers for any changes within the `properties.desired.climate` property grouping. If there is a desired property change within this group, min and max temperature change messages that are displayed to the console:
180
180
181
181
```javascript
182
182
twin.on('properties.desired.climate', function (delta) {
0 commit comments