TuyaOS
结构体 | 枚举 | 函数
tal_workq_service.h 文件参考
#include "tal_workqueue.h"
tal_workq_service.h 的引用(Include)关系图:

浏览源代码.

结构体

struct  DELAYED_WORK_ENTRY_S
 delayed work entry definition 更多...
 

枚举

enum  WORKQ_SERVICE_E { WORKQ_SYSTEM , WORKQ_HIGHTPRI }
 TuyaOS provides developers with two workqueue service for convenience. 更多...
 

函数

OPERATE_RET tal_workq_cancel (WORKQ_SERVICE_E service, WORKQUEUE_CB cb, VOID_T *data)
 cancel work task in workqueue 更多...
 
OPERATE_RET tal_workq_cancel_delayed (DELAYED_WORK_HANDLE delayed_work)
 cancel delay work 更多...
 
VOID_T tal_workq_dump (WORKQ_SERVICE_E service)
 dump all work in work queue. 更多...
 
WORKQUEUE_HANDLE tal_workq_get_handle (WORKQ_SERVICE_E service)
 get handle of workqueue service 更多...
 
UINT16_T tal_workq_get_num (WORKQ_SERVICE_E service)
 get current work number in work queue. 更多...
 
OPERATE_RET tal_workq_init (VOID_T)
 init ty work queue service 更多...
 
OPERATE_RET tal_workq_init_delayed (WORKQ_SERVICE_E service, WORKQUEUE_CB cb, VOID_T *data, DELAYED_WORK_HANDLE *delayed_work)
 init delayed work task 更多...
 
OPERATE_RET tal_workq_schedule (WORKQ_SERVICE_E service, WORKQUEUE_CB cb, VOID_T *data)
 add work to work queue 更多...
 
OPERATE_RET tal_workq_schedule_instant (WORKQ_SERVICE_E service, WORKQUEUE_CB cb, VOID_T *data)
 put work task in workqueue, instant will be dequeued first 更多...
 
OPERATE_RET tal_workq_start_delayed (DELAYED_WORK_HANDLE delayed_work, TIME_MS interval, LOOP_TYPE type)
 put work task in workqueue after delay 更多...
 
OPERATE_RET tal_workq_stop_delayed (DELAYED_WORK_HANDLE delayed_work)
 stop delayed work 更多...
 

详细描述

版本
0.1
日期
2022-02-07

枚举类型说明

◆ WORKQ_SERVICE_E

TuyaOS provides developers with two workqueue service for convenience.

枚举值
WORKQ_SYSTEM 

low priority workqueue(block operations are allowed)

WORKQ_HIGHTPRI 

high priority workqueue (block operations are not allowed)

函数说明

◆ tal_workq_cancel()

OPERATE_RET tal_workq_cancel ( WORKQ_SERVICE_E  service,
WORKQUEUE_CB  cb,
VOID_T *  data 
)

cancel work task in workqueue

参数
[in]servicethe workqueue service
[in]cbthe work callback
[in]datathe work data
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_cancel_delayed()

OPERATE_RET tal_workq_cancel_delayed ( DELAYED_WORK_HANDLE  delayed_work)

cancel delay work

参数
[in]delayed_workhandle of delayed work
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_dump()

VOID_T tal_workq_dump ( WORKQ_SERVICE_E  service)

dump all work in work queue.

参数
[in]servicethe workqueue service

◆ tal_workq_get_handle()

WORKQUEUE_HANDLE tal_workq_get_handle ( WORKQ_SERVICE_E  service)

get handle of workqueue service

参数
[in]servicethe workqueue service
返回
WORKQUEUE_HANDLE handle of workqueue service

◆ tal_workq_get_num()

UINT16_T tal_workq_get_num ( WORKQ_SERVICE_E  service)

get current work number in work queue.

参数
[in]servicethe workqueue service
注解
This API is used for get the current work number in work queue.
返回
current work number in the work queue

◆ tal_workq_init()

OPERATE_RET tal_workq_init ( VOID_T  )

init ty work queue service

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

◆ tal_workq_init_delayed()

OPERATE_RET tal_workq_init_delayed ( WORKQ_SERVICE_E  service,
WORKQUEUE_CB  cb,
VOID_T *  data,
DELAYED_WORK_HANDLE *  delayed_work 
)

init delayed work task

参数
[in]servicethe workqueue service
[in]cbthe work callback
[in]datathe work data
[out]delayed_workhandle of delayed work
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_schedule()

OPERATE_RET tal_workq_schedule ( WORKQ_SERVICE_E  service,
WORKQUEUE_CB  cb,
VOID_T *  data 
)

add work to work queue

参数
[in]servicethe workqueue service
[in]cb,callback of work
[in]data,parameterof call back
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_schedule_instant()

OPERATE_RET tal_workq_schedule_instant ( WORKQ_SERVICE_E  service,
WORKQUEUE_CB  cb,
VOID_T *  data 
)

put work task in workqueue, instant will be dequeued first

参数
[in]servicethe workqueue service
[in]cbthe work callback
[in]datathe work data
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_start_delayed()

OPERATE_RET tal_workq_start_delayed ( DELAYED_WORK_HANDLE  delayed_work,
TIME_MS  interval,
LOOP_TYPE  type 
)

put work task in workqueue after delay

参数
[in]delayed_workhandle of delayed work
[in]intervalnumber of ms to wait or 0 for immediate execution
[in]typesee @LOOP_TYPE
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tal_workq_stop_delayed()

OPERATE_RET tal_workq_stop_delayed ( DELAYED_WORK_HANDLE  delayed_work)

stop delayed work

参数
[in]delayed_workhandle of delayed work
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h