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-develop/concepts-convention.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,15 @@ title: IoT Plug and Play conventions | Microsoft Docs
3
3
description: Description of the conventions IoT Plug and Play expects devices to use when they send telemetry and properties, and handle commands and property updates.
4
4
author: rido-min
5
5
ms.author: rmpablos
6
-
ms.date: 07/10/2020
6
+
ms.date: 04/06/2022
7
7
ms.topic: conceptual
8
8
ms.service: iot-develop
9
9
services: iot-develop
10
10
---
11
11
12
12
# IoT Plug and Play conventions
13
13
14
-
IoT Plug and Play devices should follow a set of conventions when they exchange messages with an IoT hub. IoT Plug and Play devices use the MQTT protocol to communicate with IoT Hub.
14
+
IoT Plug and Play devices should follow a set of conventions when they exchange messages with an IoT hub. IoT Plug and Play devices use the MQTT protocol to communicate with IoT Hub, AMQP is supported by IoT Hub and available in some device SDKs.
15
15
16
16
Devices can include [modules](../iot-hub/iot-hub-devguide-module-twins.md), or be implemented in an [IoT Edge module](../iot-edge/about-iot-edge.md) hosted by the IoT Edge runtime.
17
17
@@ -129,16 +129,29 @@ The device or module should confirm that it received the property by sending a r
129
129
-`av` - an acknowledgment version that refers to the `$version` of the desired property. You can find this value in the desired property JSON payload.
130
130
-`ad` - an optional acknowledgment description.
131
131
132
+
### Acknowledgment responses
133
+
134
+
When reporting writable properties the device should compose the acknowledgment message, using the four fields described above, to indicate the actual device state, as described in this table
|200|Desired version|Desired value|Desired property value accepted|
140
+
|202|Desired version|Value accepted by the device|Desired property value accepted, update in progress (should finish with 200)|
141
+
|203|0|Value set by the device|Property set from the device, not reflecting any desired|
142
+
|400|Desired version|Actual value used by the device|Desired property value not accepted|
143
+
|500|Desired version|Actual value used by the device|Exception when applying the property|
144
+
132
145
When a device starts up, it should request the device twin, and check for any writable property updates. If the version of a writable property increased while the device was offline, the device should send a reported property response to confirm that it received the update.
133
146
134
-
When a device starts up for the first time, it can send an initial value for a reported property if it doesn't receive an initial desired property from the hub. In this case, the device should set `av` to `1`. For example:
147
+
When a device starts up for the first time, it can send an initial value for a reported property if it doesn't receive an initial desired property from the hub. In this case, the device can send the default value with `av` to `0` and `ac` to `203`. For example:
135
148
136
149
```json
137
150
"reported": {
138
151
"targetTemperature": {
139
152
"value": 20.0,
140
-
"ac": 200,
141
-
"av": 1,
153
+
"ac": 203,
154
+
"av": 0,
142
155
"ad": "initialize"
143
156
}
144
157
}
@@ -164,7 +177,7 @@ When the device reaches the target temperature it sends the following message:
0 commit comments