Link SDK for C that is provided by IoT Platform supports the dynamic registration or unique-certificate-per-product authentication feature. This eliminates the need to burn different DeviceSecrets to devices and reduces the burning costs. You can use HTTPS-based dynamic registration to obtain device authentication information and then connect devices with IoT Platform.
Prerequisites
- A development environment is prepared.
When you customize an SDK, set Device authentication scheme to Dynamic registration on the SDK customization page.
- A product is created, the ProductName and ProductSecret are obtained, and dynamic registration is enabled.
One or more devices are added to the product and the DeviceNames are obtained
Process
The application program calls the API operations of Link SDK for C to implement HTTPS-based dynamic registration and obtain the authentication information that are required to connect the devices with IoT Platform.
The following figure shows the process. In this example, the ./demos/dynreg_basic_demo.c application program is used.
For more information about API operations that are related to HTTPS-based dynamic registration, see aiot_dynreg_api.h.
Examples
For more information about examples, see Example.
For more information about error codes, see aiot_dynreg_api.h..
What's next
After HTTPS dynamic registration is successful, you can use the returned DeviceSecret with the ProductKey and DeviceName to activate devices and connect the devices with IoT Platform. For more information, see the following articles:
- If the device is not activated, you can perform dynamic registration multiple times. However, only the latest DeviceSecret is valid. Make sure that the latest DeviceSecret is burned on the device.
- If the device is activated, you must call the ResetThing operation to reset the registration status of the device to unregistered in the IoT Platform console. Then, you can dynamically register the device.