• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: 时间适配层接口(此文件为DEMO,需集成方适配修改)
15  */
16 #ifndef HILINK_TIME_ADAPTER_H
17 #define HILINK_TIME_ADAPTER_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 typedef struct HiLinkTimeval {
26     uint32_t sec;
27     uint32_t usec;
28 } HiLinkTimeval;
29 
30 /*
31  * 描述:获取当前设备启动后运行时间
32  * 参数:time,出参,表示当前设备启动后运行时间
33  * 返回:0成功,其他失败
34  */
35 int HILINK_GetOsTime(HiLinkTimeval *time);
36 
37 /*
38  * 描述:获取当前UTC时间
39  * 参数:time,出参
40  * 返回:0成功,其他失败
41  * 注意: 对于不支持时间同步的设备,该接口不使用
42  */
43 int HILINK_GetUtcTime(HiLinkTimeval *time);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* HILINK_TIME_ADAPTER_H */