IoT Platform provides the device job feature. You can create a device job to initiate tasks on multiple devices based on products, devices, or groups. This article describes how to configure Link SDK for C to obtain a custom task and then implement the task.
Prerequisites
Background information
You can create a device job to set properties, asynchronously call services, and implement custom tasks. This article only describes how to obtain custom tasks. To set properties or asynchronously call services, you can use Thing Specification Language (TSL) models. For more information, see Overview.
Process
The application program calls the API operations of Link SDK for C to connect with IoT Platform over MQTT and obtain a task. The device can receive the task notification that is sent by IoT Platform or request the task from IoT Platform. After the device implements the task, the device sends a request to update the task status in IoT Platform.
The following figure shows the process. In this example, the ./demos/task_posix_demo.c application program is used.
For more information about device job-specific API operations, see aiot_task_api.h.
Examples
- For more information about examples, see Example.
- For more information about error codes, see aiot_task_api.h.