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. Configure Link SDK for C to receive and run custom device jobs.
Prerequisites
Background information
Device jobs support setting properties, asynchronously calling services, and running custom tasks. This topic covers custom tasks only. To set properties or asynchronously call services, use Thing Specification Language (TSL) models. For more information, see Overview.
How it works
An application establishes a connection with the IoT Platform by calling the C Link SDK APIs based on theconnect with IoT Platform over MQTT and obtain a task. The device can receive task notifications from IoT Platform or proactively request tasks. After completing a task, the device sends a request to update the task status in IoT Platform.
The following time series chart uses the device application./demos/task_posix_demo.c as an example to illustrate the implementation flow.
For details about device job API operations, see aiot_task_api.h.
Examples
- For a code sample of the MQTT connection feature, see Example.
- For error codes related to the MQTT connection feature, see aiot_task_api.h.