TuyaOS
宏定义
uni_time.h 文件参考

tuya time module 更多...

#include "tal_time_service.h"
uni_time.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define tuya_uni_get_sum_zone(sum_zone)   tal_time_get_sum_zone(sum_zone)
 get sum zone info 更多...
 
#define uni_get_system_time(pSecTime, pMsTime)   tal_time_get_system_time(pSecTime, pMsTime)
 get IoTOS UTC time remain micro-second time 更多...
 
#define uni_get_time_zone_seconds(time_zone)   tal_time_get_time_zone_seconds(time_zone)
 get IoTOS time zone in second format 更多...
 
#define uni_gmtime_r(tm, result)   tal_time_gmtime_r(tm, result)
 change TIME_T to posix time, redefine the std C func gmtime_r 更多...
 
#define uni_is_in_sum_zone(time)   tal_time_is_in_sum_zone(time)
 get IoTOS UTC summer time int TIME_T format 更多...
 
#define uni_local_time_get(tm)   tal_time_get_local_time_custom(0, tm)
 get IoTOS local time (local, contains the time zone and summer time zone) 更多...
 
#define uni_local_time_get_custom(in_time, tm)   tal_time_get_local_time_custom(in_time, tm)
 get IoTOS local time (local, contains the time zone and summer time zone) 更多...
 
#define uni_mktime(tm)   tal_time_mktime(tm)
 change posix time to TIME_T, redefine the std C func mktime 更多...
 
#define uni_set_sum_zone_tbl(zone, cnt)   tal_time_set_sum_zone_tbl(zone, cnt)
 set IoTOS summer time zone 更多...
 
#define uni_set_time_zone(time_zone)   tal_time_set_time_zone(time_zone)
 set IoTOS time zone in "+/-hh:mm" format 更多...
 
#define uni_set_time_zone_seconds(time_zone_sec)   tal_time_set_time_zone_seconds(time_zone_sec)
 set IoTOS time zone in second format 更多...
 
#define uni_sum_time_get(tm)   tal_time_get_sum_time(tm)
 get IoTOS UTC summer time in posix time format 更多...
 
#define uni_sum_time_get_posix()   tal_time_get_sum_time_posix()
 get IoTOS UTC summer time int TIME_T format 更多...
 
#define uni_time_check_time_sync()   tal_time_check_time_sync()
 change http-GMT format time to TIME_T 更多...
 
#define uni_time_check_time_zone_sync()   tal_time_check_time_zone_sync()
 check IoTOS time zone synchronized status 更多...
 
#define uni_time_get(tm)   tal_time_get(tm)
 get IoTOS UTC time in posix time format 更多...
 
#define uni_time_get_cur_posix()   tal_time_get_cur_posix()
 get IoTOS last synchronized UTC time in TIME_T format 更多...
 
#define uni_time_get_posix()   tal_time_get_posix()
 get IoTOS UTC time in TIME_T format 更多...
 
#define uni_time_get_posix_ms()   tal_time_get_posix_ms()
 get IoTOS UTC time in SYS_TICK_T format 更多...
 
#define uni_time_init()   tal_time_service_init()
 time-management module initialization 更多...
 
#define uni_time_set(tm)   tal_time_set(tm)
 set IoTOS UTC time 更多...
 
#define uni_time_set_posix(time, update_source)   tal_time_set_posix(time, update_source)
 set IoTOS UTC time in time_t format 更多...
 

详细描述

tuya time module

版本
1.0
日期
2019-10-30

宏定义说明

◆ tuya_uni_get_sum_zone

#define tuya_uni_get_sum_zone (   sum_zone)    tal_time_get_sum_zone(sum_zone)

get sum zone info

参数
[out]sumzone info
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_get_system_time

#define uni_get_system_time (   pSecTime,
  pMsTime 
)    tal_time_get_system_time(pSecTime, pMsTime)

get IoTOS UTC time remain micro-second time

返回
the remain micro-second time
注解
in 32bit process, cannot return 8byte, because the high 4byte will be cut by cpu, we should use: "uint64_t ms = uni_time_get_posix()*1000ULL + uni_time_get_posix_ms_remain_tick()" to get the micro-seconds

get IoTOS UTC time, both second and micro-second

参数
[out]pSecTimethe current time in second
[out]pMsTimethe current time in micro-second
返回
VOID

◆ uni_get_time_zone_seconds

#define uni_get_time_zone_seconds (   time_zone)    tal_time_get_time_zone_seconds(time_zone)

get IoTOS time zone in second format

参数
[out]time_zonethe current time zone in second format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_gmtime_r

#define uni_gmtime_r (   tm,
  result 
)    tal_time_gmtime_r(tm, result)

change TIME_T to posix time, redefine the std C func gmtime_r

参数
[in]tmthe time in TIME_T format
[out]resultthe time in posix time format
返回
the time in posix time format

◆ uni_is_in_sum_zone

#define uni_is_in_sum_zone (   time)    tal_time_is_in_sum_zone(time)

get IoTOS UTC summer time int TIME_T format

返回
the summer time in TIME_T format

◆ uni_local_time_get

#define uni_local_time_get (   tm)    tal_time_get_local_time_custom(0, tm)

get IoTOS local time (local, contains the time zone and summer time zone)

参数
[out]tmthe current local time in posix format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_local_time_get_custom

#define uni_local_time_get_custom (   in_time,
  tm 
)    tal_time_get_local_time_custom(in_time, tm)

get IoTOS local time (local, contains the time zone and summer time zone)

参数
[in]in_timethe time need translate
[out]tmthe local time in posix format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h
注解
if in_time is 0, return the IoTOS local time, otherwise, translate the in_time to local time

◆ uni_mktime

#define uni_mktime (   tm)    tal_time_mktime(tm)

change posix time to TIME_T, redefine the std C func mktime

参数
[in]tmthe time in posix time format
返回
the time in TIME_T format

◆ uni_set_sum_zone_tbl

#define uni_set_sum_zone_tbl (   zone,
  cnt 
)    tal_time_set_sum_zone_tbl(zone, cnt)

set IoTOS summer time zone

参数
[in]zonethe summer time zone table
[in]cntthe summer time counts
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_set_time_zone

#define uni_set_time_zone (   time_zone)    tal_time_set_time_zone(time_zone)

set IoTOS time zone in "+/-hh:mm" format

参数
[in]time_zonethe new time zone in "+/-hh:mm" format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_set_time_zone_seconds

#define uni_set_time_zone_seconds (   time_zone_sec)    tal_time_set_time_zone_seconds(time_zone_sec)

set IoTOS time zone in second format

参数
[in]time_zonethe new time zone in second format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_sum_time_get

#define uni_sum_time_get (   tm)    tal_time_get_sum_time(tm)

get IoTOS UTC summer time in posix time format

参数
[out]tmthe summer time in posix format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_sum_time_get_posix

#define uni_sum_time_get_posix ( )    tal_time_get_sum_time_posix()

get IoTOS UTC summer time int TIME_T format

返回
the summer time in TIME_T format

◆ uni_time_check_time_sync

#define uni_time_check_time_sync ( )    tal_time_check_time_sync()

change http-GMT format time to TIME_T

参数
[in]datehttp-GMT format time
返回
the time in TIME_T format

check IoTOS time synchronize status

返回
OPRT_OK on synchronized. Others on not

◆ uni_time_check_time_zone_sync

#define uni_time_check_time_zone_sync ( )    tal_time_check_time_zone_sync()

check IoTOS time zone synchronized status

返回
OPRT_OK on synchronized. Others on not

◆ uni_time_get

#define uni_time_get (   tm)    tal_time_get(tm)

get IoTOS UTC time in posix time format

参数
[out]tmthe IoTOS UTC time in posix time format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_time_get_cur_posix

#define uni_time_get_cur_posix ( )    tal_time_get_cur_posix()

get IoTOS last synchronized UTC time in TIME_T format

返回
the time in TIME_T format

◆ uni_time_get_posix

#define uni_time_get_posix ( )    tal_time_get_posix()

get IoTOS UTC time in TIME_T format

返回
the current second time in TIME_T format

◆ uni_time_get_posix_ms

#define uni_time_get_posix_ms ( )    tal_time_get_posix_ms()

get IoTOS UTC time in SYS_TICK_T format

返回
the current micro-second time in SYS_TICK_T format

◆ uni_time_init

#define uni_time_init ( )    tal_time_service_init()

time-management module initialization

返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_time_set

#define uni_time_set (   tm)    tal_time_set(tm)

set IoTOS UTC time

参数
[in]tmthe new time in posix time format
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ uni_time_set_posix

#define uni_time_set_posix (   time,
  update_source 
)    tal_time_set_posix(time, update_source)

set IoTOS UTC time in time_t format

参数
[in]timethe new time in time_t format
[in]update_sourcethe source of time (0:rtc 1:cloud 2:other)
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h