Link Kit C-SDK  5.0.0
aiot_ntp_api.h
浏览该文件的文档.
1 
10 #ifndef _AIOT_NTP_API_H
11 #define _AIOT_NTP_API_H
12 
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
22 typedef struct {
23  uint64_t timestamp;
24  uint32_t year;
25  uint32_t mon;
26  uint32_t day;
27  uint32_t hour;
28  uint32_t min;
29  uint32_t sec;
30  uint32_t msec;
32 
40 typedef void (*ntp_callback_t)(void *device, const aiot_ntp_time_t *recv_time, void *userdata);
41 
53 int32_t aiot_device_ntp_set_zone(void *device, int8_t zone);
54 
67 int32_t aiot_device_ntp_set_callback(void *device, ntp_callback_t callback, void *userdata);
68 
79 int32_t aiot_device_ntp_request(void *device);
80 #if defined(__cplusplus)
81 }
82 #endif
83 
84 #endif
uint64_t timestamp
Definition: aiot_ntp_api.h:23
uint32_t hour
Definition: aiot_ntp_api.h:27
时间结构体
Definition: aiot_ntp_api.h:22
int32_t aiot_device_ntp_request(void *device)
请求时间同步
int32_t aiot_device_ntp_set_callback(void *device, ntp_callback_t callback, void *userdata)
设置时间同步回调
uint32_t sec
Definition: aiot_ntp_api.h:29
int32_t aiot_device_ntp_set_zone(void *device, int8_t zone)
设置时区
void(* ntp_callback_t)(void *device, const aiot_ntp_time_t *recv_time, void *userdata)
设备时间同步回调函数原型,用户定义后, 可通过 aiot_device_ntp_set_callback 配置
Definition: aiot_ntp_api.h:40
uint32_t min
Definition: aiot_ntp_api.h:28
uint32_t msec
Definition: aiot_ntp_api.h:30
uint32_t year
Definition: aiot_ntp_api.h:24
uint32_t day
Definition: aiot_ntp_api.h:26
uint32_t mon
Definition: aiot_ntp_api.h:25