Overview
IoT Platform provides the Network Time Protocol (NTP) service for embedded devices that have limited resources. This allows the devices to obtain accurate clocks in real time. You can configure Link SDK for C to obtain the current UTC time on the device.
Prerequisites
- You have the device authentication information.
- Obtain the C Link SDK.
When you customize the SDK, on the Time Synchronization.
- Set up the development environment.
Background information
IoT Platform provides the NTP service. For more information, see NTP service.
How it works
An application establishes a connection with the IoT Platform by calling the C Link SDK APIs based on the connect with IoT Platform over MQTT and obtain the standard UTC time.
The following time series chart uses the device application.demos/ntp_posix_demo.c as an example to illustrate the implementation flow.

For more information about NTP service-specific API operations, see aiot_ntp_api.h.
Examples
- For a code sample of the MQTT connection feature, see Usage example.
- For error codes related to the MQTT connection feature, see aiot_ntp_api.hStatus code descriptions.