Skip to content

Commit ec8f012

Browse files
committed
Address feedback
1 parent cec2c9a commit ec8f012

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/iot-develop/tutorial-use-mqtt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Tutorial - Use the MQTT protocol directly to create an IoT device c
44
titleSuffix: Azure IoT
55
author: ryanwinter
66
ms.author: rywinter
7-
ms.date: 03/10/2023
7+
ms.date: 03/15/2023
88
ms.topic: tutorial
99
ms.service: iot-develop
1010
services: iot-develop
@@ -78,13 +78,13 @@ az iot hub device-identity create --hub-name my-hub --device-id mqtt-dev-01
7878
Use the following command to create a SAS token that grants the device access to your IoT hub. Be sure to use the name of your IoT hub:
7979
8080
```dotnetcli
81-
az iot hub generate-sas-token --device-id mqtt-dev-01 --hub-name my-hub
81+
az iot hub generate-sas-token --device-id mqtt-dev-01 --hub-name my-hub --du 7200
8282
```
8383
8484
Make a note of the SAS token the command outputs as you need it later. The SAS token looks like `SharedAccessSignature sr=my-hub.azure-devices.net%2Fdevices%2Fmqtt-dev-01&sig=%2FnM...sNwtnnY%3D&se=1677855761`
8585
8686
> [!TIP]
87-
> By default, the SAS token is valid for 60 minutes. If it expires before you're ready to use it, generate a new one. You can also create a token with a longer duration. To learn more, see [az iot hub generate-sas-token](/cli/azure/iot/hub#az-iot-hub-generate-sas-token).
87+
> By default, the SAS token is valid for 60 minutes. The `--du 7200` option in the previous command extends the token duration to two hours. If it expires before you're ready to use it, generate a new one. You can also create a token with a longer duration. To learn more, see [az iot hub generate-sas-token](/cli/azure/iot/hub#az-iot-hub-generate-sas-token).
8888

8989
## Clone the sample repository
9090

@@ -291,7 +291,7 @@ The following statements define the topics the device uses to subscribe to devic
291291
292292
The `main` function uses the `mosquitto_connect_callback_set` function to set a callback to handle messages sent from your IoT hub and uses the `mosquitto_subscribe` function to subscribe to the `$iothub/twin/res/#` topic.
293293
294-
The following snippet shows the `connect_callback` function that uses `mosquitto_publish` to set a reported property in the device twin. The device publishes the message to the `$iothub/twin/PATCH/properties/reported/?$rid=patch_temp` topic:
294+
The following snippet shows the `connect_callback` function that uses `mosquitto_publish` to set a reported property in the device twin. The device publishes the message to the `$iothub/twin/PATCH/properties/reported/?$rid=%d` topic. The `%d` value is incremented each time the device publishes a message to the topic:
295295
296296
```c
297297
void connect_callback(struct mosquitto* mosq, void* obj, int result)

0 commit comments

Comments
 (0)