IoT Platform provides the over-the-air (OTA) update and management feature. This article describes how to configure Link SDK for C to perform an OTA update.
To perform an OTA update, you must use the MQTT protocol to connect the application program with IoT Platform. You can use the HTTPS or MQTT protocol to download an OTA update package.
- You can use this protocol to download an OTA update package that contains one or more files.
- For more information about the related API operations, see aiot_ota_api.h.
- The following figure shows the process. In this example, the ./demos/fota_posix_demo.c or ./demos/fota_multi_file_demo.c application program is used.
- You can use this protocol to download an OTA update package that contains a single file.
- For more information about the related API operations, see aiot_mqtt_download_api.h.
- The following figure shows the process. In this example, the ./demos/mota_basic_demo.c application program is used.
- For more information about examples, see the following sample code files:
Sample code file Protocol to connect devices with IoT Platform Protocol to download update packages Number of files in an update package Reference ./demos/fota_posix_demo.c MQTT HTTPS One Example 1: Sample code ./demos/fota_multi_file_demo.c Multiple Example 2: Sample code ./demos/mota_basic_demo.c MQTT One Example 3: Sample code
- For more information about error codes, see aiot_ota_api.h or aiot_mqtt_download_api.h.