Message Queuing Telemetry Transport (MQTT) is an asynchronous communication protocol based on the TCP/IP protocol stack. MQTT is a lightweight protocol that is used for message transmission in the publish/subscribe model. IoT Platform supports MQTT 5.0. This improves the performance, stability, and scalability of your system. You can configure Link SDK for C to connect a device to IoT Platform.
Prerequisites
Link SDK for C is obtained. When you customize an SDK, set Connect to IoT platform protocol to MQTT 5.0.0 on the SDK customization page.
MQTT 5.0 features that are supported by IoT Platform are familiarized.
How it works
An application program calls the API operations of Link SDK for C to establish a connection to IoT Platform over MQTT.
The following figure shows the process. In this example, the ./demos/mqtt_v5_basic_demo.c application program is used.
For more information about MQTT 5.0 connection-specific API operations, see aiot_mqtt_api.h.
For more information about MQTT 5.0 API operations that can be called to manage properties, see aiot_mqtt_props_api.h.
Examples
For more information about the examples on how to connect devices to IoT Platform over MQTT 5.0, see Examples.
For more information about the error codes that can be returned when you connect devices to IoT Platform over MQTT 5.0, see Common error codes.