TuyaOS
tkl_zcl_scene.h
浏览该文件的文档.
1
11#ifndef __TKL_ZCL_SCENE_H__
12#define __TKL_ZCL_SCENE_H__
13
14
15#ifdef __cplusplus
16 extern "C" {
17#endif
18
19#include "tuya_cloud_types.h"
20
21
22/*
23 * scenes max buffer size
24 */
25#define SCENES_MAX_SCENE_DATA_LEN 64
26
27/*
28 * scene data type
29 */
30typedef enum {
35
36/*
37 * zigbee scene structure
38 */
39typedef struct {
40 UINT8_T is_active;
42 UINT8_T ep_id;
43 UINT8_T scene_id;
44 UINT16_T group_id;
45 UINT16_T trans_time;
47 UINT8_T data_len;
48 UINT8_T data[SCENES_MAX_SCENE_DATA_LEN];
50
51/*
52 * zigbee mini scene structure
53 */
54typedef struct {
55 UINT8_T ep_id;
56 UINT8_T scene_id;
57 UINT16_T group_id;
58 UINT16_T trans_time;
61
62
63typedef OPERATE_RET (*TKL_SAVE_SCENE_PRE_CB)(UINT8_T ep_id, UINT8_T scene_id, UINT16_T group_id);
64typedef OPERATE_RET (*TKL_SAVE_SCENE_CB)(TKL_SCENE_T *entry);
65typedef OPERATE_RET (*TKL_VIEW_SCENE_CB)(TKL_SCENE_T *entry);
66typedef OPERATE_RET (*TKL_REMOVE_SCENE_CB)(UINT8_T ep_id, UINT8_T scene_id, UINT16_T group_id);
67typedef OPERATE_RET (*TKL_REMOVE_ALL_SCENE_CB)(UINT8_T ep_id, UINT16_T group_id);
68typedef OPERATE_RET (*TKL_RECALL_SCENE_CB)(UINT8_T ep_id, UINT8_T scene_id, UINT16_T group_id, UINT16_T time100ms);
69
70/*
71 * zigbee scene callback collection
72 */
73typedef struct {
74 TKL_SAVE_SCENE_PRE_CB save_scene_pre_cb;
75 TKL_SAVE_SCENE_CB save_scene_cb;
76 TKL_VIEW_SCENE_CB view_scene_cb;
77 TKL_RECALL_SCENE_CB recall_scene_cb;
78 TKL_REMOVE_SCENE_CB remove_scene_cb;
79 TKL_REMOVE_ALL_SCENE_CB remove_all_scene_cb;
81
82
89UINT8_T tkl_zg_scene_size_get(VOID_T);
90
99BOOL_T tkl_zg_find_scene(UINT8_T ep_id, UINT8_T scene_id, UINT16_T group_id);
100
108
116OPERATE_RET tkl_zg_scene_recovery(TKL_MINI_SCENE_T *scene_list, UINT8_T sums);
117
125
126
127#ifdef __cplusplus
128}
129#endif
130
131#endif
Definition: tkl_zcl_scene.h:54
UINT8_T scene_id
scene id
Definition: tkl_zcl_scene.h:56
UINT8_T trans_time100ms
check if this causes any problems
Definition: tkl_zcl_scene.h:59
UINT16_T trans_time
seconds required for the device to change from its current state to the requested scene
Definition: tkl_zcl_scene.h:58
UINT16_T group_id
group id
Definition: tkl_zcl_scene.h:57
UINT8_T ep_id
endpoint id of scene
Definition: tkl_zcl_scene.h:55
Definition: tkl_zcl_scene.h:73
Definition: tkl_zcl_scene.h:39
UINT16_T trans_time
seconds required for the device to change from its current state to the requested scene
Definition: tkl_zcl_scene.h:45
UINT8_T data_len
scene data len
Definition: tkl_zcl_scene.h:47
TKL_SCENE_TYPE_T type
scene type
Definition: tkl_zcl_scene.h:41
UINT8_T ep_id
endpoint id of scene
Definition: tkl_zcl_scene.h:42
UINT8_T trans_time100ms
check if this causes any problems
Definition: tkl_zcl_scene.h:46
UINT8_T is_active
scene table entry is active
Definition: tkl_zcl_scene.h:40
UINT8_T scene_id
scene id
Definition: tkl_zcl_scene.h:43
UINT16_T group_id
group id
Definition: tkl_zcl_scene.h:44
VOID_T tkl_zg_clear_all_scene(VOID_T)
clear all scenes
OPERATE_RET tkl_zg_scene_cb_register(TKL_SCENE_CB_T *scene_cb)
scenes callback register
TKL_SCENE_TYPE_T
Definition: tkl_zcl_scene.h:30
@ TKL_SCENE_DATA_TYPE_EXT_SERVER
scene data with extension field, save scene data in sdk
Definition: tkl_zcl_scene.h:31
@ TKL_SCENE_DATA_TYPE_ZIGBEE
not used
Definition: tkl_zcl_scene.h:33
@ TKL_SCENE_DATA_TYPE_YOURSELF
scene data without extension field, save scene data not in sdk
Definition: tkl_zcl_scene.h:32
UINT8_T tkl_zg_scene_size_get(VOID_T)
get scenes table size
OPERATE_RET tkl_zg_scene_recovery(TKL_MINI_SCENE_T *scene_list, UINT8_T sums)
tuya scene table recovery to native SDK scene table
BOOL_T tkl_zg_find_scene(UINT8_T ep_id, UINT8_T scene_id, UINT16_T group_id)
find scenes on endpoint