TuyaOS
结构体 | 宏定义 | 函数
tal_time_service.h 文件参考

tuya time service, support UTC time, local time and summer time 更多...

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

浏览源代码.

结构体

struct  SUM_ZONE_TBL_S
 sum zone info 更多...
 

宏定义

#define SUM_ZONE_TAB_LMT   6
 number of time zone table
 

函数

OPERATE_RET tal_time_check_time_sync (VOID)
 check IoTOS time synchronize status 更多...
 
OPERATE_RET tal_time_check_time_zone_sync (VOID)
 check IoTOS time zone synchronized status 更多...
 
OPERATE_RET tal_time_get (OUT POSIX_TM_S *tm)
 get IoTOS UTC time in posix time format 更多...
 
TIME_T tal_time_get_cur_posix (VOID)
 get IoTOS last synchronized UTC time in TIME_T format 更多...
 
OPERATE_RET tal_time_get_local_time_custom (IN TIME_T in_time, OUT POSIX_TM_S *tm)
 get IoTOS local time (local, contains the time zone and summer time zone) 更多...
 
TIME_T tal_time_get_posix (VOID)
 get IoTOS UTC time in TIME_T format 更多...
 
SYS_TICK_T tal_time_get_posix_ms (VOID)
 get IoTOS UTC time in SYS_TICK_T format 更多...
 
OPERATE_RET tal_time_get_sum_time (OUT POSIX_TM_S *tm)
 get IoTOS UTC summer time in posix time format 更多...
 
TIME_T tal_time_get_sum_time_posix (VOID)
 get IoTOS UTC summer time int TIME_T format 更多...
 
OPERATE_RET tal_time_get_sum_zone (OUT SUM_ZONE_TBL_S *sum_zone)
 get sum zone info 更多...
 
VOID tal_time_get_system_time (OUT TIME_S *pSecTime, OUT TIME_MS *pMsTime)
 get IoTOS UTC time, both second and micro-second 更多...
 
OPERATE_RET tal_time_get_time_zone_seconds (OUT INT_T *time_zone)
 get IoTOS time zone in second format 更多...
 
POSIX_TM_Stal_time_gmtime_r (IN CONST TIME_T *tm, OUT POSIX_TM_S *result)
 change TIME_T to posix time, redefine the std C func gmtime_r 更多...
 
BOOL_T tal_time_is_in_sum_zone (TIME_T time)
 get IoTOS UTC summer time int TIME_T format 更多...
 
TIME_T tal_time_mktime (IN CONST POSIX_TM_S *tm)
 change posix time to TIME_T, redefine the std C func mktime 更多...
 
OPERATE_RET tal_time_service_init (VOID)
 time-management module initialization 更多...
 
OPERATE_RET tal_time_set (IN CONST POSIX_TM_S *tm)
 set IoTOS UTC time 更多...
 
OPERATE_RET tal_time_set_posix (IN CONST TIME_T time, IN CONST INT_T update_source)
 set IoTOS UTC time in time_t format 更多...
 
VOID tal_time_set_sum_zone_tbl (IN CONST SUM_ZONE_S *zone, IN CONST UINT_T cnt)
 set IoTOS summer time zone 更多...
 
OPERATE_RET tal_time_set_time_zone (IN CONST CHAR_T *time_zone)
 set IoTOS time zone in "+/-hh:mm" format 更多...
 
OPERATE_RET tal_time_set_time_zone_seconds (IN INT_T time_zone_sec)
 set IoTOS time zone in second format 更多...
 

详细描述

tuya time service, support UTC time, local time and summer time

版本
1.0
日期
2019-10-30

函数说明

◆ tal_time_check_time_sync()

OPERATE_RET tal_time_check_time_sync ( VOID  )

check IoTOS time synchronize status

返回
OPRT_OK on synchronized. Others on not

◆ tal_time_check_time_zone_sync()

OPERATE_RET tal_time_check_time_zone_sync ( VOID  )

check IoTOS time zone synchronized status

返回
OPRT_OK on synchronized. Others on not

◆ tal_time_get()

OPERATE_RET tal_time_get ( OUT POSIX_TM_S 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

◆ tal_time_get_cur_posix()

TIME_T tal_time_get_cur_posix ( VOID  )

get IoTOS last synchronized UTC time in TIME_T format

返回
the time in TIME_T format

◆ tal_time_get_local_time_custom()

OPERATE_RET tal_time_get_local_time_custom ( IN TIME_T  in_time,
OUT POSIX_TM_S 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

◆ tal_time_get_posix()

TIME_T tal_time_get_posix ( VOID  )

get IoTOS UTC time in TIME_T format

返回
the current second time in TIME_T format

◆ tal_time_get_posix_ms()

SYS_TICK_T tal_time_get_posix_ms ( VOID  )

get IoTOS UTC time in SYS_TICK_T format

返回
the current micro-second time in SYS_TICK_T format

◆ tal_time_get_sum_time()

OPERATE_RET tal_time_get_sum_time ( OUT POSIX_TM_S 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

◆ tal_time_get_sum_time_posix()

TIME_T tal_time_get_sum_time_posix ( VOID  )

get IoTOS UTC summer time int TIME_T format

返回
the summer time in TIME_T format

◆ tal_time_get_sum_zone()

OPERATE_RET tal_time_get_sum_zone ( OUT SUM_ZONE_TBL_S sum_zone)

get sum zone info

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

◆ tal_time_get_system_time()

VOID tal_time_get_system_time ( OUT TIME_S *  pSecTime,
OUT TIME_MS *  pMsTime 
)

get IoTOS UTC time, both second and micro-second

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

◆ tal_time_get_time_zone_seconds()

OPERATE_RET tal_time_get_time_zone_seconds ( OUT INT_T *  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

◆ tal_time_gmtime_r()

POSIX_TM_S * tal_time_gmtime_r ( IN CONST TIME_T *  tm,
OUT POSIX_TM_S 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

◆ tal_time_is_in_sum_zone()

BOOL_T tal_time_is_in_sum_zone ( TIME_T  time)

get IoTOS UTC summer time int TIME_T format

返回
the summer time in TIME_T format

◆ tal_time_mktime()

TIME_T tal_time_mktime ( IN CONST POSIX_TM_S 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

◆ tal_time_service_init()

OPERATE_RET tal_time_service_init ( VOID  )

time-management module initialization

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

◆ tal_time_set()

OPERATE_RET tal_time_set ( IN CONST POSIX_TM_S 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

◆ tal_time_set_posix()

OPERATE_RET tal_time_set_posix ( IN CONST TIME_T  time,
IN CONST INT_T  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

◆ tal_time_set_sum_zone_tbl()

VOID tal_time_set_sum_zone_tbl ( IN CONST SUM_ZONE_S zone,
IN CONST UINT_T  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

◆ tal_time_set_time_zone()

OPERATE_RET tal_time_set_time_zone ( IN CONST CHAR_T *  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

◆ tal_time_set_time_zone_seconds()

OPERATE_RET tal_time_set_time_zone_seconds ( IN INT_T  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