The revert-RPC (RRPC) feature of IoT Platform provides a synchronous request-response mechanism based on the MQTT protocol without requiring protocol changes. Configure Link SDK for C to receive a synchronous message, process the command, and send a response to IoT Platform.
Prerequisites
- Set up the development environment.
- Obtain the C Link SDK.
When you customize the SDK, on the SDK Customization page, select MQTT 3.1.1 in the Connect To IoT Platform Protocol section.
- You have the device authentication information.
Background information
- For more information about the RRPC feature, see What is RRPC?.
- You can use basic communication topics and custom topics to call the RRpc operation of IoT Platform and send messages to devices. For more information, see the following articles:
How it works
An application establishes a connection with the IoT Platform by calling the C Link SDK APIs based on the connect to IoT Platform over MQTT, receive a synchronous message, and send a response.
The following time series chart uses the device applicationdemos/mqtt_rrpc_demo.c as an example to illustrate the implementation flow.
This feature requires an MQTT connection. For the related API operations, see aiot_mqtt_api.h.
Examples
- For a code sample of the MQTT connection feature, see Example.
- For error codes related to the MQTT connection feature, see Common error codes.