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 to transmit messages in the publish/subscribe model. You can configure Link SDK for C to connect devices that use the MQTT protocol to IoT Platform.
Prerequisites
When you customize an SDK, set the Connect to IoT platform protocol parameter to MQTT 3.1.1 on the SDK customization page.
The verification information of a device is obtained.
The device is verified by using the device certificate that is issued by IoT Platform. For more information, see Obtain device verification information.
The device is verified by using custom device verification information. For more information, see Add devices to an MQTT gateway product.
Background information
For more information about how to connect a non-cloud gateway device to IoT Platform over MQTT, see MQTT protocol.
For more information about how to connect a cloud gateway device to IoT Platform over MQTT, see MQTT gateways.
How it works
The application calls the API operations of Link SDK for C to establish a connection to IoT Platform over MQTT. The following figure shows how the device-side application connects to IoT Platform for communication.
For more information about MQTT connection-specific API operations, see aiot_mqtt_api.h.
Examples
For more information about examples, see Example.
For more information about error codes, see Common error codes.