The revert-RPC (RRPC) feature of IoT Platform provides a synchronous request-response mechanism based on the MQTT protocol. You can achieve synchronous communication without changing the MQTT protocol. This article describes how to configure Link SDK for C to receive a synchronous message, process the command, and then send a response to IoT Platform.

Prerequisites

Background information

  • For more information about the RRPC feature, see What is RRPC?.
  • The RRPC feature allows you to 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:

Process

The application program calls the API operations of Link SDK for C to connect with IoT Platform over MQTT, receive a synchronous message, and then send a response to IoT Platform.

The following figure shows the process. In this example, the demos/mqtt_rrpc_demo.c application program is used.

Process

To use this feature, you must establish an MQTT connection. For more information about the related API operations, see aiot_mqtt_api.h.

Examples