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 typedef struct {
27 UCHAR_T *data;
28 USHORT_T data_len;
30
32typedef struct {
33 UINT_T opcode;
34 UCHAR_T *data;
35 USHORT_T data_len;
37
39typedef struct {
40 USHORT_T src_addr;
41 USHORT_T dst_addr;
42 UCHAR_T model_index;
43 UINT_T seq;
44 UCHAR_T ttl;
45 USHORT_T app_key_index;
46 USHORT_T net_key_index;
47 CHAR_T rssi;
49
51typedef struct{
52 UCHAR_T net_key[16];
53 USHORT_T key_index;
54 UCHAR_T flags;
55 UCHAR_T iv_index[4];
56 USHORT_T unicast_address;
57} _PACKED_ TKL_NET_PROV_DATA_T;
58
60typedef struct{
61 UCHAR_T net_app_idx[3];
62 UCHAR_T app_key[16];
63} _PACKED_ TKL_APP_KEY_DATA_T;
64
65typedef OPERATE_RET (*TKL_MESH_MSG_RECV_CB)(TKL_MESH_ACCESS_MSG_T *msg_raw, TKL_MESH_NET_PARAM_T *net_param);
66
68typedef struct {
69 UINT_T model_id;
70 TKL_MESH_MSG_RECV_CB model_receive;
71 USHORT_T model_handle;
73
75typedef enum {
81
82typedef enum {
99
100typedef struct {
101 UCHAR_T peer_addr[6];
102 UCHAR_T peer_uuid[16];
104 USHORT_T node_addr;
105 UCHAR_T node_devkey[16];
107
108typedef struct {
109 USHORT_T local_addr;
111 UCHAR_T netkey[16];
112 UCHAR_T appkey[16];
114
115typedef struct {
116 UCHAR_T mac[6];
117 UCHAR_T uuid[16];
118 USHORT_T oob;
119 UINT_T uri_hash;
120 CHAR_T rssi;
122
123typedef struct {
124 UCHAR_T mac[6];
125 UCHAR_T length;
126 UCHAR_T *p_data;
127 CHAR_T rssi;
129
130typedef struct {
131 UINT_T opcode;
132 UCHAR_T count;
135 USHORT_T data_len;
136 UCHAR_T *p_data;
138
139typedef struct {
140 UINT_T opcode;
141 USHORT_T node_addr;
143 USHORT_T data_len;
144 UCHAR_T *p_data;
146
147typedef struct {
148 USHORT_T node_addr;
149 UCHAR_T devkey[16];
151
152typedef struct {
154 INT_T state;
156 union {
163 }mesh_event;
165
167typedef VOID(*TKL_MESH_EVT_FUNC_CB)(TKL_MESH_EVT_PARAMS_T *p_event);
168
169typedef enum{
170 TKL_MESH_PROVISION_SUCCESS = 0,
171 TKL_MESH_PROVISION_START,
172 TKL_MESH_PROVISION_TIMEOUT,
173 TKL_MESH_RESET,
174 TKL_MESH_RESET_IN_RAM,
175 TKL_MESH_REVERT_IN_MESH,
176 TKL_MESH_GROUP_SUB_ADD,
177 TKL_MESH_GROUP_SUB_DEL,
178
179 TKL_OTA_START,
180 TKL_OTA_SUCCESS,
181 TKL_OTA_FAIL,
182}TKL_MESH_STATE_T;
183
184typedef VOID(*TKL_MESH_NET_STATE_CB_T)(TKL_MESH_STATE_T state);
185
186#endif
187
mesh access msg parameters.
Definition: tkl_bluetooth_mesh_def.h:32
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:35
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:33
UCHAR_T * data
Definition: tkl_bluetooth_mesh_def.h:34
Definition: tkl_bluetooth_mesh_def.h:139
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:144
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:143
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:141
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:140
Definition: tkl_bluetooth_mesh_def.h:130
UCHAR_T interval_steps
Definition: tkl_bluetooth_mesh_def.h:133
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:135
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:136
UINT_T opcode
Definition: tkl_bluetooth_mesh_def.h:131
UCHAR_T count
Definition: tkl_bluetooth_mesh_def.h:132
Definition: tkl_bluetooth_mesh_def.h:100
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:104
Definition: tkl_bluetooth_mesh_def.h:152
TKL_MESH_EVT_TYPE_E type
Definition: tkl_bluetooth_mesh_def.h:153
TKL_PRIVATE_BEACON_T beacon_report
Definition: tkl_bluetooth_mesh_def.h:158
TKL_MESH_DATA_RECEIVE_T model_report
Definition: tkl_bluetooth_mesh_def.h:162
TKL_MESH_UNPROV_BEACON_T unprov_report
Definition: tkl_bluetooth_mesh_def.h:157
TKL_MESH_DATA_RECEIVE_T config_report
Definition: tkl_bluetooth_mesh_def.h:161
INT_T state
Definition: tkl_bluetooth_mesh_def.h:154
TKL_MESH_PROV_T prov
Definition: tkl_bluetooth_mesh_def.h:160
Definition: tkl_bluetooth_mesh_def.h:108
USHORT_T local_addr
Definition: tkl_bluetooth_mesh_def.h:109
model handle.
Definition: tkl_bluetooth_mesh_def.h:68
UINT_T model_id
Definition: tkl_bluetooth_mesh_def.h:69
USHORT_T model_handle
Definition: tkl_bluetooth_mesh_def.h:71
network parameters.
Definition: tkl_bluetooth_mesh_def.h:39
UCHAR_T model_index
Definition: tkl_bluetooth_mesh_def.h:42
USHORT_T dst_addr
Definition: tkl_bluetooth_mesh_def.h:41
UCHAR_T ttl
Definition: tkl_bluetooth_mesh_def.h:44
USHORT_T net_key_index
Definition: tkl_bluetooth_mesh_def.h:46
USHORT_T app_key_index
Definition: tkl_bluetooth_mesh_def.h:45
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:47
USHORT_T src_addr
Definition: tkl_bluetooth_mesh_def.h:40
UINT_T seq
Definition: tkl_bluetooth_mesh_def.h:43
Definition: tkl_bluetooth_mesh_def.h:147
USHORT_T node_addr
Definition: tkl_bluetooth_mesh_def.h:148
Definition: tkl_bluetooth_mesh_def.h:26
UCHAR_T * data
Definition: tkl_bluetooth_mesh_def.h:27
USHORT_T data_len
Definition: tkl_bluetooth_mesh_def.h:28
Definition: tkl_bluetooth_mesh_def.h:115
UINT_T uri_hash
Definition: tkl_bluetooth_mesh_def.h:119
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:120
USHORT_T oob
Definition: tkl_bluetooth_mesh_def.h:118
Definition: tkl_bluetooth_mesh_def.h:123
UCHAR_T length
Definition: tkl_bluetooth_mesh_def.h:125
CHAR_T rssi
Definition: tkl_bluetooth_mesh_def.h:127
UCHAR_T * p_data
Definition: tkl_bluetooth_mesh_def.h:126
Definition: tal_fast_provision_inner.h:45
UCHAR_T flags
Definition: tkl_bluetooth_mesh_def.h:54
USHORT_T key_index
Definition: tkl_bluetooth_mesh_def.h:53
USHORT_T unicast_address
Definition: tkl_bluetooth_mesh_def.h:56
MESH_FEATURE_T
mesh node feature.
Definition: tkl_bluetooth_mesh_def.h:75
@ MESH_FEATURE_FRIEND
Definition: tkl_bluetooth_mesh_def.h:78
@ MESH_FEATURE_LPN
Definition: tkl_bluetooth_mesh_def.h:79
@ MESH_FEATURE_RELAY
Definition: tkl_bluetooth_mesh_def.h:76
@ MESH_FEATURE_PROXY
Definition: tkl_bluetooth_mesh_def.h:77
TKL_MESH_EVT_TYPE_E
Definition: tkl_bluetooth_mesh_def.h:82
@ TKL_MESH_EVT_PRIVATE_BEACON_REPORT
Definition: tkl_bluetooth_mesh_def.h:91
@ TKL_MESH_EVT_MODEL_DATA_RX
Definition: tkl_bluetooth_mesh_def.h:97
@ TKL_MESH_EVT_STACK_RESET
Definition: tkl_bluetooth_mesh_def.h:87
@ TKL_MESH_EVT_STACK_DEINIT
Definition: tkl_bluetooth_mesh_def.h:85
@ TKL_MESH_EVT_UNPROV_BEACON_REPORT
Definition: tkl_bluetooth_mesh_def.h:89
@ TKL_MESH_EVT_CONFIG_DATA_RX
Definition: tkl_bluetooth_mesh_def.h:95
@ TKL_MESH_EVT_STACK_INIT
Definition: tkl_bluetooth_mesh_def.h:83
@ TKL_MESH_EVT_INVITE_EVT
Definition: tkl_bluetooth_mesh_def.h:93