TuyaOS
类型定义 | 枚举 | 函数
tal_sw_timer.h 文件参考

This is tal_sw_timer file 更多...

#include "tuya_cloud_types.h"
tal_sw_timer.h 的引用(Include)关系图:

浏览源代码.

类型定义

typedef VOID_T(* TAL_TIMER_CB) (TIMER_ID timer_id, VOID_T *arg)
 
typedef PVOID_T TIMER_ID
 

枚举

enum  TIMER_TYPE { TAL_TIMER_ONCE = 0 , TAL_TIMER_CYCLE }
 the type of timer
 

函数

OPERATE_RET tal_sw_timer_create (TAL_TIMER_CB func, VOID_T *arg, TIMER_ID *timer_id)
 create a software timer 更多...
 
OPERATE_RET tal_sw_timer_delete (TIMER_ID timer_id)
 Delete the software timer 更多...
 
INT_T tal_sw_timer_get_num (VOID_T)
 Get timer node currently 更多...
 
OPERATE_RET tal_sw_timer_init (VOID_T)
 Initializing the software timer 更多...
 
BOOL_T tal_sw_timer_is_running (TIMER_ID timer_id)
 Identify the software timer is running 更多...
 
OPERATE_RET tal_sw_timer_release (VOID_T)
 Release all resource of the software timer 更多...
 
OPERATE_RET tal_sw_timer_remain_time_get (TIMER_ID timer_id, UINT32_T *remain_time)
 Identify the software timer is running 更多...
 
OPERATE_RET tal_sw_timer_start (TIMER_ID timer_id, TIME_MS time_ms, TIMER_TYPE timer_type)
 Start the software timer 更多...
 
OPERATE_RET tal_sw_timer_stop (TIMER_ID timer_id)
 Stop the software timer 更多...
 
OPERATE_RET tal_sw_timer_trigger (TIMER_ID timer_id)
 Trigger the software timer 更多...
 

详细描述

This is tal_sw_timer file

版本
1.0
日期
2021-08-24

函数说明

◆ tal_sw_timer_create()

OPERATE_RET tal_sw_timer_create ( TAL_TIMER_CB  func,
VOID_T *  arg,
TIMER_ID *  timer_id 
)

create a software timer

参数
[in]functhe processing function of the timer
[in]argthe parameater of the timer function
[out]timer_idtimer id
注解
This API is used for create a software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_delete()

OPERATE_RET tal_sw_timer_delete ( TIMER_ID  timer_id)

Delete the software timer

参数
[in]timer_idtimer id
注解
This API is used for deleting the software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_get_num()

INT_T tal_sw_timer_get_num ( VOID_T  )

Get timer node currently

参数
VOID
注解
This API is used for getting the timer node currently.
返回
the timer node count.

◆ tal_sw_timer_init()

OPERATE_RET tal_sw_timer_init ( VOID_T  )

Initializing the software timer

参数
VOID
注解
This API is used for initializing the software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_is_running()

BOOL_T tal_sw_timer_is_running ( TIMER_ID  timer_id)

Identify the software timer is running

参数
[in]timer_idtimer id
注解
This API is used to identify wheather the software timer is running
返回
TRUE or FALSE

◆ tal_sw_timer_release()

OPERATE_RET tal_sw_timer_release ( VOID_T  )

Release all resource of the software timer

参数
VOID
注解
This API is used for releasing all resource of the software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_remain_time_get()

OPERATE_RET tal_sw_timer_remain_time_get ( TIMER_ID  timer_id,
UINT32_T *  remain_time 
)

Identify the software timer is running

参数
[in]timer_idtimer id
[in]remain_timems
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_start()

OPERATE_RET tal_sw_timer_start ( TIMER_ID  timer_id,
TIME_MS  time_ms,
TIMER_TYPE  timer_type 
)

Start the software timer

参数
[in]timer_idtimer id
[in]time_mstimer running cycle
[in]timer_typetimer type
注解
This API is used for starting the software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_stop()

OPERATE_RET tal_sw_timer_stop ( TIMER_ID  timer_id)

Stop the software timer

参数
[in]timer_idtimer id
注解
This API is used for stopping the software timer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_sw_timer_trigger()

OPERATE_RET tal_sw_timer_trigger ( TIMER_ID  timer_id)

Trigger the software timer

参数
[in]timer_idtimer id
注解
This API is used for triggering the software timer instantly.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h