IoT Platform provides the remote configuration feature. You can upload the configuration file of a product to IoT Platform. After a device goes online, you can download the configuration file to the device and then parse the file for further processing. This article describes how to configure Link SDK for C to remotely configure a device.
Prerequisites
- The device authentication information is obtained.
- Link SDK for C is obtained.
When you customize an SDK on the SDK customization page, set Advanced Capabilities to OTA.
Note You can use the remote configuration or over-the-air (OTA) update feature to download configuration files to devices. - A development environment is prepared.
Background information
The remote configuration feature is applied on a product basis. The configuration file that is uploaded to IoT Platform takes effect on all devices of a product. You cannot specify a single device for remote configuration. For more information, see Remote configuration.
Process
The application program calls the API operations of Link SDK for C to connect with IoT Platform over MQTT and obtain a remote configuration command. The device can receive the command that is sent by IoT Platform or initiate a request to obtain the command. Then, the device initiates an HTTPS request to download the configuration file.
The following figure shows the process. In this example, the ./demos/cota_basic_demo.c application program is used. You can perform Step 3 or Step 4 as needed.
For more information about remote configuration-specific API operations, see aiot_ota_api.h.
Examples
- For more information about examples, see Example.
- For more information about error codes, see aiot_ota_api.h.