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
1. Install [Visual Studio (Community, Professional, or Enterprise)](https://visualstudio.microsoft.com/downloads). Be sure to enable the **Desktop development with C++** workload.
@@ -228,13 +230,13 @@ Got message for devices/mqtt-dev-01/messages/# topic
228
230
229
231
The following snippets are taken from the _mosquitto/src/mosquitto_subscribe.cpp_ file.
230
232
231
-
The following statement defines the topic the device uses to receive cloud to device messages:
233
+
The following statement defines the topic filter the device uses to receive cloud to device messages. The `#` is a multi-level wildcard:
The `main`functionuses the `mosquitto_message_callback_set`functiontoset a callback to handle messages sent from your IoT hub and uses the `mosquitto_subscribe`functionto subscribe to the `#` topic. The following snippet shows the callback function:
239
+
The `main`functionuses the `mosquitto_message_callback_set`functiontoset a callback to handle messages sent from your IoT hub and uses the `mosquitto_subscribe`functionto subscribe to all messages. The following snippet shows the callback function:
The device subscribes to the `$iothub/twin/res/#` topic and when it receives a message from your IoT hub, the `message_callback` function handles it. When you run the sample, the `message_callback` function gets called twice. The first time, the device receives a response from the IoT hub to the reported property update and then requests the device twin. The second time, the device receives the requested device twin. The following snippet shows the `message_callback` function:
314
+
The device subscribes to the `$iothub/twin/res/#` topic and when it receives a message from your IoT hub, the `message_callback` function handles it. When you run the sample, the `message_callback` function gets called twice. The first time, the device receives a response from the IoT hub to the reported property update. The device then requests the device twin. The second time, the device receives the requested device twin. The following snippet shows the `message_callback` function:
0 commit comments