TuyaOS
tkl_bluetooth_mesh_def.h
浏览该文件的文档.
1
11#ifndef __TKL_BLUETOOTH_MESH_DEF_H__
12#define __TKL_BLUETOOTH_MESH_DEF_H__
13
14#include "tuya_cloud_types.h"
15#include "tuya_error_code.h"
16#include "tkl_bluetooth.h"
17
18#ifndef _PACKED_
19#define _PACKED_ __attribute__ ((packed))
20#endif
21
22#ifndef _WEAK_
23#define _WEAK_ __attribute__((weak))
24#endif
25
26
28typedef struct {
29 UINT_T opcode;
30 UCHAR_T *data;
31 USHORT_T data_len;
33
35typedef struct {
36 USHORT_T src_addr;
37 USHORT_T dst_addr;
38 UCHAR_T model_index;
39 UINT_T seq;
40 UCHAR_T ttl;
41 USHORT_T app_key_index;
42 USHORT_T net_key_index;
43 CHAR_T rssi;
45
47typedef struct{
48 UCHAR_T net_key[16];
49 USHORT_T key_index;
50 UCHAR_T flags;
51 UCHAR_T iv_index[4];
52 USHORT_T unicast_address;
53} _PACKED_ TKL_NET_PROV_DATA_T;
54
56typedef struct{
57 UCHAR_T net_app_idx[3];
58 UCHAR_T app_key[16];
59} _PACKED_ TKL_APP_KEY_DATA_T;
60
61typedef OPERATE_RET (*TKL_MESH_MSG_RECV_CB)(TKL_MESH_ACCESS_MSG_T *msg_raw, TKL_MESH_NET_PARAM_T *net_param);
62
64typedef struct {
65 UINT_T model_id;
66 TKL_MESH_MSG_RECV_CB model_receive;
67 USHORT_T model_handle;
69
71typedef enum {
77
78typedef enum {
95
96typedef struct {
97 UCHAR_T peer_addr[6];
98 UCHAR_T peer_uuid[16];
100 USHORT_T node_addr;
101 UCHAR_T node_devkey[16];
103
104typedef struct {
105 USHORT_T local_addr;
107 UCHAR_T netkey[16];
108 UCHAR_T appkey[16];
110
111typedef struct {
112 UCHAR_T mac[6];
113 UCHAR_T uuid[16];
114 USHORT_T oob;
115 UINT_T uri_hash;
116 CHAR_T rssi;
118
119typedef struct {
120 UCHAR_T mac[6];
121 UCHAR_T length;
122 UCHAR_T *p_data;
123 CHAR_T rssi;
125
126typedef struct {
127 UINT_T opcode;
128 UCHAR_T count;
131 USHORT_T data_len;
132 UCHAR_T *p_data;
134
135typedef struct {
136 UINT_T opcode;
137 USHORT_T node_addr;
139 USHORT_T data_len;
140 UCHAR_T *p_data;
142
143typedef struct {
144 USHORT_T node_addr;
145 UCHAR_T devkey[16];
147
148typedef struct {
150 INT_T state;
152 union {
159 }mesh_event;
161
163typedef VOID(*TKL_MESH_EVT_FUNC_CB)(TKL_MESH_EVT_PARAMS_T *p_event);
164
165typedef enum{
166 TKL_MESH_PROVISION_SUCCESS = 0,
167 TKL_MESH_PROVISION_START,
168 TKL_MESH_PROVISION_TIMEOUT,
169 TKL_MESH_RESET,
170 TKL_MESH_RESET_IN_RAM,
171 TKL_MESH_REVERT_IN_MESH,
172 TKL_MESH_GROUP_SUB_ADD,
173 TKL_MESH_GROUP_SUB_DEL,
174
175 TKL_OTA_START,
176 TKL_OTA_SUCCESS,
177 TKL_OTA_FAIL,
178}TKL_MESH_STATE_T;
179
180typedef VOID(*TKL_MESH_NET_STATE_CB_T)(TKL_MESH_STATE_T state);
181
182#endif
183
mesh access msg parameters.
Definition: tkl_bluetooth_mesh_def.h:28
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:31
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:29
UCHAR_T * data
Definition: tkl_bluetooth_mesh_def.h:30
Definition: tkl_bluetooth_mesh_def.h:135
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:140
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:139
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:137
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:136
Definition: tkl_bluetooth_mesh_def.h:126
UCHAR_T interval_steps
Definition: tkl_bluetooth_mesh_def.h:129
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:131
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:132
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:127
UCHAR_T count
Definition: tkl_bluetooth_mesh_def.h:128
Definition: tkl_bluetooth_mesh_def.h:96
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:100
Definition: tkl_bluetooth_mesh_def.h:148
TKL_MESH_EVT_TYPE_E type
Definition: tkl_bluetooth_mesh_def.h:149
TKL_PRIVATE_BEACON_T beacon_report
Definition: tkl_bluetooth_mesh_def.h:154
TKL_MESH_DATA_RECEIVE_T model_report
Definition: tkl_bluetooth_mesh_def.h:158
TKL_MESH_UNPROV_BEACON_T unprov_report
Definition: tkl_bluetooth_mesh_def.h:153
TKL_MESH_DATA_RECEIVE_T config_report
Definition: tkl_bluetooth_mesh_def.h:157
INT_T state
Definition: tkl_bluetooth_mesh_def.h:150
TKL_MESH_PROV_T prov
Definition: tkl_bluetooth_mesh_def.h:156
Definition: tkl_bluetooth_mesh_def.h:104
USHORT_T local_addr
Definition: tkl_bluetooth_mesh_def.h:105
model handle.
Definition: tkl_bluetooth_mesh_def.h:64
UINT_T model_id
Definition: tkl_bluetooth_mesh_def.h:65
USHORT_T model_handle
Definition: tkl_bluetooth_mesh_def.h:67
network parameters.
Definition: tkl_bluetooth_mesh_def.h:35
UCHAR_T model_index
Definition: tkl_bluetooth_mesh_def.h:38
USHORT_T dst_addr
Definition: tkl_bluetooth_mesh_def.h:37
UCHAR_T ttl
Definition: tkl_bluetooth_mesh_def.h:40
USHORT_T net_key_index
Definition: tkl_bluetooth_mesh_def.h:42
USHORT_T app_key_index
Definition: tkl_bluetooth_mesh_def.h:41
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:43
USHORT_T src_addr
Definition: tkl_bluetooth_mesh_def.h:36
UINT_T seq
Definition: tkl_bluetooth_mesh_def.h:39
Definition: tkl_bluetooth_mesh_def.h:143
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:144
Definition: tkl_bluetooth_mesh_def.h:111
UINT_T uri_hash
Definition: tkl_bluetooth_mesh_def.h:115
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:116
USHORT_T oob
Definition: tkl_bluetooth_mesh_def.h:114
Definition: tkl_bluetooth_mesh_def.h:119
UCHAR_T length
Definition: tkl_bluetooth_mesh_def.h:121
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:123
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:122
Definition: tal_fast_provision_inner.h:45
UCHAR_T flags
Definition: tkl_bluetooth_mesh_def.h:50
USHORT_T key_index
Definition: tkl_bluetooth_mesh_def.h:49
USHORT_T unicast_address
Definition: tkl_bluetooth_mesh_def.h:52
MESH_FEATURE_T
mesh node feature.
Definition: tkl_bluetooth_mesh_def.h:71
@ MESH_FEATURE_FRIEND
Definition: tkl_bluetooth_mesh_def.h:74
@ MESH_FEATURE_LPN
Definition: tkl_bluetooth_mesh_def.h:75
@ MESH_FEATURE_RELAY
Definition: tkl_bluetooth_mesh_def.h:72
@ MESH_FEATURE_PROXY
Definition: tkl_bluetooth_mesh_def.h:73
TKL_MESH_EVT_TYPE_E
Definition: tkl_bluetooth_mesh_def.h:78
@ TKL_MESH_EVT_PRIVATE_BEACON_REPORT
Definition: tkl_bluetooth_mesh_def.h:87
@ TKL_MESH_EVT_MODEL_DATA_RX
Definition: tkl_bluetooth_mesh_def.h:93
@ TKL_MESH_EVT_STACK_RESET
Definition: tkl_bluetooth_mesh_def.h:83
@ TKL_MESH_EVT_STACK_DEINIT
Definition: tkl_bluetooth_mesh_def.h:81
@ TKL_MESH_EVT_UNPROV_BEACON_REPORT
Definition: tkl_bluetooth_mesh_def.h:85
@ TKL_MESH_EVT_CONFIG_DATA_RX
Definition: tkl_bluetooth_mesh_def.h:91
@ TKL_MESH_EVT_STACK_INIT
Definition: tkl_bluetooth_mesh_def.h:79
@ TKL_MESH_EVT_INVITE_EVT
Definition: tkl_bluetooth_mesh_def.h:89