AWS IoT Device SDK C:
MQTT
MQTT 3.1.1 client library
|
Return to main page ↑ |
The MQTT demo demonstrates usage of the MQTT library.
The MQTT demo demonstrates the subscribe-publish workflow of MQTT. After subscribing to multiple topic filters, it publishes bursts of data to various topic names. The demo then waits for all messages in a burst to be received on a topic filter. As each message arrives, the demo publishes an acknowledgement message back to the MQTT server. It repeats this cycle IOT_DEMO_MQTT_PUBLISH_BURST_COUNT times.
Messages in this demo are sent at QoS 1, which the MQTT spec guarantees at least once delivery. However, for practical purposes, QoS 1 messages are subject to the retry policy described here. A QoS 1 message may fail to be delivered if all its retries are exhausted.
See Demo Configuration for configuration settings that change the behavior of the demo.
The main MQTT demo file is iot_demo_mqtt.c, which contains platform-independent code. See Building the demo applications for instructions on building the MQTT demo.