• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************/
18 #ifndef HCI_CMD_H_
19 #define HCI_CMD_H_
20 
21 #include "stack/ble/ble_format.h"
22 
23 /**
24  *  @brief  Command Parameters for "7.1.6 Disconnect command"
25  */
26 typedef struct {
27     u16 connection_handle;
28     u8 reason;
29 } hci_disconnect_cmdParam_t;
30 
31 /**
32  *  @brief  Return Parameters for "7.4.6 Read BD_ADDR command"
33  */
34 typedef struct {
35     u8 status;
36     u8 bd_addr[6];
37 } hci_readBdAddr_retParam_t;
38 
39 /**
40  *  @brief  Return Parameters for "7.8.2 LE Read Buffer Size command"
41  */
42 typedef struct {
43     u8 status;
44     u16 acl_data_pkt_len;  // LE_ACL_Data_Packet_Length
45     u8 num_le_data_pkt;    // Total_Num_LE_ACL_Data_Packets
46 } hci_le_readBufSize_v1_retParam_t;
47 
48 /**
49  *  @brief  Command Parameters for "7.8.5 LE Set Advertising Parameters command"
50  */
51 /* Advertising Parameters structure */
52 typedef struct {
53     u16 intervalMin;  // Minimum advertising interval for non-directed advertising, time = N * 0.625ms
54     u16 intervalMax;  // Maximum advertising interval for non-directed advertising, time = N * 0.625ms
55     u8 advType;       // Advertising
56     u8 ownAddrType;
57     u8 peerAddrType;
58     u8 peerAddr[6];  // BLE_ADDR_LEN];
59     u8 advChannelMap;
60     u8 advFilterPolicy;
61 } hci_le_setAdvParam_cmdParam_t;
62 
63 /* Advertising_Interval, Time = N * 0.625 ms,
64  * Notice that these are just part of but not all Advertising_Interval value */
65 typedef enum {
66     ADV_INTERVAL_3_125MS = 5,
67     ADV_INTERVAL_3_75MS = 6,
68     ADV_INTERVAL_10MS = 16,
69     ADV_INTERVAL_15MS = 24,
70     ADV_INTERVAL_20MS = 32,
71     ADV_INTERVAL_25MS = 40,
72     ADV_INTERVAL_30MS = 48,
73     ADV_INTERVAL_35MS = 56,
74     ADV_INTERVAL_40MS = 64,
75     ADV_INTERVAL_45MS = 72,
76     ADV_INTERVAL_50MS = 80,
77     ADV_INTERVAL_60MS = 96,
78     ADV_INTERVAL_70MS = 112,
79     ADV_INTERVAL_80MS = 128,
80     ADV_INTERVAL_90MS = 144,
81     ADV_INTERVAL_100MS = 160,
82     ADV_INTERVAL_150MS = 240,
83     ADV_INTERVAL_195MS = 312,
84     ADV_INTERVAL_200MS = 320,
85     ADV_INTERVAL_250MS = 400,
86     ADV_INTERVAL_300MS = 480,
87     ADV_INTERVAL_350MS = 560,
88     ADV_INTERVAL_400MS = 640,
89     ADV_INTERVAL_450MS = 720,
90     ADV_INTERVAL_500MS = 800,
91     ADV_INTERVAL_600MS = 960,
92     ADV_INTERVAL_700MS = 1120,
93     ADV_INTERVAL_800MS = 1280,
94     ADV_INTERVAL_900MS = 1440,
95     ADV_INTERVAL_1S = 1600,
96     ADV_INTERVAL_1S5 = 2400,
97     ADV_INTERVAL_2S = 3200,
98     ADV_INTERVAL_1_28_S = 2048,
99     ADV_INTERVAL_10_24S = 16384,
100 } adv_inter_t;
101 
102 /* Advertisement Type */
103 typedef enum {
104     ADV_TYPE_CONNECTABLE_UNDIRECTED = 0x00,          // ADV_IND
105     ADV_TYPE_CONNECTABLE_DIRECTED_HIGH_DUTY = 0x01,  // ADV_INDIRECT_IND (high duty cycle)
106     ADV_TYPE_SCANNABLE_UNDIRECTED = 0x02,            // ADV_SCAN_IND
107     ADV_TYPE_NONCONNECTABLE_UNDIRECTED = 0x03,       // ADV_NONCONN_IND
108     ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY = 0x04,   // ADV_INDIRECT_IND (low duty cycle)
109 } adv_type_t;
110 
111 /* Own Address Type */
112 typedef enum {
113     OWN_ADDRESS_PUBLIC = 0,
114     OWN_ADDRESS_RANDOM = 1,
115     OWN_ADDRESS_RESOLVE_PRIVATE_PUBLIC = 2,
116     OWN_ADDRESS_RESOLVE_PRIVATE_RANDOM = 3,
117 } own_addr_type_t;
118 
119 /* Advertising_Channel_Map */
120 typedef enum {
121     BLT_ENABLE_ADV_37 = BIT(0),
122     BLT_ENABLE_ADV_38 = BIT(1),
123     BLT_ENABLE_ADV_39 = BIT(2),
124     BLT_ENABLE_ADV_ALL = (BLT_ENABLE_ADV_37 | BLT_ENABLE_ADV_38 | BLT_ENABLE_ADV_39),
125 } adv_chn_map_t;
126 
127 /* Advertising_Filter_Policy */
128 typedef enum {
129     ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_ANY = 0x00,  // Process scan and connection requests from all devices
130     ADV_FP_ALLOW_SCAN_WL_ALLOW_CONN_ANY = 0x01,
131     // Process connection requests from all devices and only scan requests from devices that are in the White List.
132     ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_WL = 0x02,
133     // Process scan requests from all devices and only connection requests from devices that are in the White List.
134     ADV_FP_ALLOW_SCAN_WL_ALLOW_CONN_WL = 0x03,
135     // Process scan and connection requests only from devices in the White List.
136     ADV_FP_NONE = ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_ANY,  // adv filter policy set to zero, not use whitelist
137 } adv_fp_type_t;                                         // adv_filterPolicy_type_t
138 
139 #define ALLOW_SCAN_WL BIT(0)
140 #define ALLOW_CONN_WL BIT(1)
141 
142 /**
143  *  @brief  Command Parameters for "7.8.9 LE Set Advertising Enable command"
144  */
145 typedef enum {
146     BLC_ADV_DISABLE = 0x00,
147     BLC_ADV_ENABLE = 0x01,
148 } adv_en_t;
149 
150 /**
151  *  @brief  Command Parameters for "7.8.10 LE Set Scan Parameters command"
152  */
153 typedef enum {
154     SCAN_TYPE_PASSIVE = 0x00,
155     SCAN_TYPE_ACTIVE = 0x01,
156 } scan_type_t;
157 
158 /* Scannning_Interval, Time = N * 0.625 ms,
159  * Notice that these are just part of but not all Scannning_Interval value */
160 typedef enum {
161     SCAN_INTERVAL_10MS = 16,
162     SCAN_INTERVAL_20MS = 32,
163     SCAN_INTERVAL_30MS = 48,
164     SCAN_INTERVAL_40MS = 64,
165     SCAN_INTERVAL_50MS = 80,
166     SCAN_INTERVAL_60MS = 96,
167     SCAN_INTERVAL_70MS = 112,
168     SCAN_INTERVAL_80MS = 128,
169     SCAN_INTERVAL_90MS = 144,
170     SCAN_INTERVAL_100MS = 160,
171     SCAN_INTERVAL_150MS = 240,
172     SCAN_INTERVAL_200MS = 320,
173     SCAN_INTERVAL_250MS = 400,
174     SCAN_INTERVAL_300MS = 480,
175     SCAN_INTERVAL_350MS = 560,
176     SCAN_INTERVAL_400MS = 640,
177     SCAN_INTERVAL_450MS = 720,
178     SCAN_INTERVAL_500MS = 800,
179     SCAN_INTERVAL_600MS = 960,
180     SCAN_INTERVAL_700MS = 1120,
181     SCAN_INTERVAL_800MS = 1280,
182     SCAN_INTERVAL_900MS = 1440,
183     SCAN_INTERVAL_1000MS = 1600,
184 } scan_inter_t;
185 
186 /* Scannning_Window, Time = N * 0.625 ms,
187  * Notice that these are just part of but not all Scannning_Window value */
188 typedef enum {
189     SCAN_WINDOW_10MS = 16,
190     SCAN_WINDOW_20MS = 32,
191     SCAN_WINDOW_30MS = 48,
192     SCAN_WINDOW_40MS = 64,
193     SCAN_WINDOW_50MS = 80,
194     SCAN_WINDOW_60MS = 96,
195     SCAN_WINDOW_70MS = 112,
196     SCAN_WINDOW_80MS = 128,
197     SCAN_WINDOW_90MS = 144,
198     SCAN_WINDOW_100MS = 160,
199     SCAN_WINDOW_150MS = 240,
200     SCAN_WINDOW_200MS = 320,
201     SCAN_WINDOW_250MS = 400,
202     SCAN_WINDOW_300MS = 480,
203     SCAN_WINDOW_350MS = 560,
204     SCAN_WINDOW_400MS = 640,
205     SCAN_WINDOW_450MS = 720,
206     SCAN_WINDOW_500MS = 800,
207     SCAN_WINDOW_600MS = 960,
208     SCAN_WINDOW_700MS = 1120,
209     SCAN_WINDOW_800MS = 1280,
210     SCAN_WINDOW_900MS = 1440,
211     SCAN_WINDOW_1000MS = 1600,
212 } scan_wind_t;
213 
214 /* Scanning_Filter_Policy */
215 typedef enum {
216     SCAN_FP_ALLOW_ADV_ANY = 0x00,                  // except direct adv address not match
217     SCAN_FP_ALLOW_ADV_WL = 0x01,                   // except direct adv address not match
218     SCAN_FP_ALLOW_UNDIRECT_ADV = 0x02,             // and direct adv address match initiator's resolvable private MAC
219     SCAN_FP_ALLOW_ADV_WL_DIRECT_ADV_MACTH = 0x03,  // and direct adv address match initiator's resolvable private MAC
220 } scan_fp_type_t;
221 
222 /**
223  *  @brief  Command Parameters for "7.8.11 LE Set Scan Enable command"
224  */
225 /* LE_Scan_Enable */
226 typedef enum {
227     BLC_SCAN_DISABLE = 0x00,
228     BLC_SCAN_ENABLE = 0x01,
229 } scan_en_t;
230 
231 /* Filter_Duplicates */
232 typedef enum {
233     DUP_FILTER_DISABLE = 0x00,
234     DUP_FILTER_ENABLE = 0x01,
235 } dupFilter_en_t;
236 
237 /**
238  *  @brief  Command Parameters for "7.8.12 LE Create Connection command"
239  */
240 typedef struct {
241     u16 scan_inter;
242     u16 scan_wind;
243     u8 fp;  // init_filter_policy
244     u8 peerAddr_type;
245     u8 peer_addr[6];
246     u8 ownAddr_type;
247     u16 conn_min;
248     u16 conn_max;
249     u16 connLatency;
250     u16 timeout;
251     u16 ceLen_min;
252     u16 ceLen_max;
253 } hci_le_createConn_cmdParam_t;
254 
255 /* Initiator_Filter_Policy */
256 typedef enum {
257     INITIATE_FP_ADV_SPECIFY = 0x00,  // connect ADV specified by host
258     INITIATE_FP_ADV_WL = 0x01,       // connect ADV in whiteList
259 } init_fp_t;
260 
261 /* Connection_Interval, Time = N * 1.25 ms,
262  * Notice that these are just part of but not all Connection_Interval value */
263 typedef enum {
264     CONN_INTERVAL_7P5MS = 6,
265     CONN_INTERVAL_8P75MS = 7,
266     CONN_INTERVAL_10MS = 8,
267     CONN_INTERVAL_11P25MS = 9,
268     CONN_INTERVAL_12P5MS = 10,
269     CONN_INTERVAL_13P75MS = 11,
270     CONN_INTERVAL_15MS = 12,
271     CONN_INTERVAL_16P25MS = 13,
272     CONN_INTERVAL_17P5MS = 14,
273     CONN_INTERVAL_18P75MS = 15,
274     CONN_INTERVAL_20MS = 16,
275     CONN_INTERVAL_21P25MS = 17,
276     CONN_INTERVAL_22P5MS = 18,
277     CONN_INTERVAL_23P75MS = 19,
278     CONN_INTERVAL_25MS = 20,
279     CONN_INTERVAL_26P25MS = 21,
280     CONN_INTERVAL_27P5MS = 22,
281     CONN_INTERVAL_28P75MS = 23,
282     CONN_INTERVAL_30MS = 24,
283     CONN_INTERVAL_31P25MS = 25,
284     CONN_INTERVAL_32P5MS = 26,
285     CONN_INTERVAL_33P75MS = 27,
286     CONN_INTERVAL_35MS = 28,
287     CONN_INTERVAL_36P25MS = 29,
288     CONN_INTERVAL_37P5MS = 30,
289     CONN_INTERVAL_38P75MS = 31,
290     CONN_INTERVAL_40MS = 32,
291     CONN_INTERVAL_41P25MS = 33,
292     CONN_INTERVAL_42P5MS = 34,
293     CONN_INTERVAL_43P75MS = 35,
294     CONN_INTERVAL_45MS = 36,
295     CONN_INTERVAL_46P25MS = 37,
296     CONN_INTERVAL_47P5MS = 38,
297     CONN_INTERVAL_48P75MS = 39,
298     CONN_INTERVAL_50MS = 40,
299     CONN_INTERVAL_55MS = 44,
300     CONN_INTERVAL_60MS = 48,
301     CONN_INTERVAL_62P5MS = 50,
302     CONN_INTERVAL_65MS = 52,
303     CONN_INTERVAL_70MS = 56,
304     CONN_INTERVAL_75MS = 60,
305     CONN_INTERVAL_80MS = 64,
306     CONN_INTERVAL_85MS = 68,
307     CONN_INTERVAL_90MS = 72,
308     CONN_INTERVAL_95MS = 78,
309     CONN_INTERVAL_100MS = 80,
310     CONN_INTERVAL_110MS = 88,
311     CONN_INTERVAL_120MS = 96,
312     CONN_INTERVAL_130MS = 104,
313     CONN_INTERVAL_140MS = 112,
314     CONN_INTERVAL_150MS = 120,
315     CONN_INTERVAL_160MS = 128,
316     CONN_INTERVAL_170MS = 136,
317     CONN_INTERVAL_180MS = 144,
318     CONN_INTERVAL_190MS = 152,
319     CONN_INTERVAL_200MS = 160,
320     CONN_INTERVAL_250MS = 200,
321     CONN_INTERVAL_300MS = 240,
322     CONN_INTERVAL_320MS = 256,
323 } conn_inter_t;
324 
325 /* Supervision_Timeout, Time = N * 10 ms,
326  * Notice that these are just part of but not all Supervision_Timeout value */
327 typedef enum {
328     CONN_TIMEOUT_500MS = 50,
329     CONN_TIMEOUT_1S = 100,
330     CONN_TIMEOUT_1S5 = 150,
331     CONN_TIMEOUT_2S = 200,
332     CONN_TIMEOUT_2S5 = 250,
333     CONN_TIMEOUT_3S = 300,
334     CONN_TIMEOUT_3S5 = 350,
335     CONN_TIMEOUT_4S = 400,
336     CONN_TIMEOUT_4S5 = 450,
337     CONN_TIMEOUT_5S = 500,
338     CONN_TIMEOUT_6S = 600,
339     CONN_TIMEOUT_7S = 700,
340     CONN_TIMEOUT_8S = 800,
341     CONN_TIMEOUT_9S = 900,
342     CONN_TIMEOUT_10S = 1000,
343     CONN_TIMEOUT_15S = 1500,
344     CONN_TIMEOUT_20S = 2000,
345 } conn_tm_t;
346 
347 /**
348  *  @brief  Command Parameters for "7.8.16 LE Add Device To White List command"
349  */
350 typedef struct {
351     u8 adr_type;
352     u8 addr[6];
353 } hci_le_addDeviceWhitelist_cmdParam_t;
354 
355 /**
356  *  @brief  Command Parameters for "7.8.17 LE Remove Device From White List command"
357  */
358 typedef struct {
359     u8 adr_type;
360     u8 addr[6];
361 } hci_le_removeDeviceWhitelist_cmdParam_t;
362 
363 /**
364  *  @brief  Return Parameters for "7.8.46 LE Read Maximum Data Length command"
365  */
366 typedef struct {
367     u8 status;
368     u16 support_max_tx_oct;
369     u16 support_max_tx_time;
370     u16 support_max_rx_oct;
371     u16 support_max_rx_time;
372 } hci_le_readMaxDataLengthCmd_retParam_t;
373 
374 /**
375  *  @brief  Return Parameters for "7.8.47 LE Read PHY command"
376  */
377 typedef struct {
378     u8 status;
379     u8 handle[2];
380     u8 tx_phy;
381     u8 rx_phy;
382 } hci_le_readPhyCmd_retParam_t;
383 
384 /**
385  *  @brief  Command Parameters for "7.8.48 LE Set Default PHY command"
386  */
387 
388 /**
389  *  @brief  Command Parameters for "7.8.49 LE Set PHY command"
390  */
391 
392 typedef struct {
393     u16 connHandle;
394     u8 all_phys;
395     u8 tx_phys;
396     u8 rx_phys;
397     u16 phy_options;
398 } hci_le_setPhyCmd_param_t;
399 
400 typedef enum {
401     BLE_PHY_1M = 0x01,
402     BLE_PHY_2M = 0x02,
403     BLE_PHY_CODED = 0x03,
404 } le_phy_type_t;
405 
406 typedef enum {
407     PHY_PREFER_1M = BIT(0),
408     PHY_PREFER_2M = BIT(1),
409     PHY_PREFER_CODED = BIT(2),
410 } le_phy_prefer_type_t;
411 
412 typedef enum {
413     PHY_TRX_PREFER = 0,                     // has 	 preference among TX & RX PHYs
414     PHY_TX_NO_PREFER = BIT(0),              // has no preference among TX PHYs
415     PHY_RX_NO_PREFER = BIT(1),              // has no preference among RX PHYs
416     PHY_TRX_NO_PREFER = (BIT(0) | BIT(1)),  // has no preference among TX & RX PHYs
417 } le_phy_prefer_mask_t;
418 
419 typedef enum {
420     CODED_PHY_PREFER_NONE = 0,
421     CODED_PHY_PREFER_S2 = 1,
422     CODED_PHY_PREFER_S8 = 2,
423 } le_ci_prefer_t;  // LE coding indication prefer
424 
425 /**
426  *  @brief  Command Parameters for "7.8.53 LE Set Extended Advertising Parameters command"
427  */
428 typedef struct {
429     u8 adv_handle;
430     u16 advEvt_props;
431     u8 pri_advIntMin[3];
432     u8 pri_advIntMax[3];
433     u8 pri_advChnMap;
434     u8 ownAddrType;
435     u8 peerAddrType;
436     u8 peerAddr[6];
437     u8 advFilterPolicy;
438     u8 adv_tx_pow;
439     u8 pri_adv_phy;
440     u8 sec_adv_max_skip;
441     u8 sec_adv_phy;
442     u8 adv_sid;
443     u8 scan_req_noti_en;
444 } hci_le_setExtAdvParam_cmdParam_t;
445 
446 /* Advertising_Handle */
447 typedef enum {
448     ADV_HANDLE0 = 0x00,
449     ADV_HANDLE1 = 0x01,
450     ADV_HANDLE2 = 0x02,
451     ADV_HANDLE3 = 0x03,
452 } adv_handle_t;
453 
454 /* Advertising Event Properties mask */
455 typedef enum {
456     ADVEVT_PROP_MASK_CONNECTABLE = BIT(0),
457     ADVEVT_PROP_MASK_SCANNABLE = BIT(1),
458     ADVEVT_PROP_MASK_DIRECTED = BIT(2),
459     ADVEVT_PROP_MASK_HD_DIRECTED = BIT(3),
460     ADVEVT_PROP_MASK_LEGACY = BIT(4),
461     ADVEVT_PROP_MASK_ANON_ADV = BIT(5),
462     ADVEVT_PROP_MASK_INC_TX_PWR = BIT(6),
463 } advEvtProp_mask_t;
464 
465 #define ADVEVT_PROP_MASK_CONNECTABLE_SCANNABLE (0x0003)  // ADVEVT_PROP_MASK_CONNECTABLE | ADVEVT_PROP_MASK_SCANNABLE
466 #define ADVEVT_PROP_MASK_LEGACY_SCANNABLE      (0x0012)  // ADVEVT_PROP_MASK_LEGACY | ADVEVT_PROP_MASK_SCANNABLE
467 #define ADVEVT_PROP_MASK_LEGACY_DIRECTED       (0x0014)  // ADVEVT_PROP_MASK_LEGACY | ADVEVT_PROP_MASK_DIRECTED
468 #define ADVEVT_PROP_MASK_LEGACY_HD_DIRECTED    (0x0018)  // ADVEVT_PROP_MASK_LEGACY | ADVEVT_PROP_MASK_HD_DIRECTED
469 #define ADVEVT_PROP_MASK_LEGACY_CONNECTABLE_SCANNABLE                                                                 \
470     (0x0013)  // ADVEVT_PROP_MASK_LEGACY | ADVEVT_PROP_MASK_CONNECTABLE | ADVEVT_PROP_MASK_SCANNABLE
471 
472 /* Advertising Event Properties type */
473 typedef enum {
474     ADV_EVT_PROP_LEGACY_CONNECTABLE_SCANNABLE_UNDIRECTED = 0x0013,  //  0001 0011'b 	ADV_IND
475     ADV_EVT_PROP_LEGACY_CONNECTABLE_DIRECTED_LOW_DUTY = 0x0015,     //  0001 0101'b		ADV_DIRECT_IND(low duty cycle)
476     ADV_EVT_PROP_LEGACY_CONNECTABLE_DIRECTED_HIGH_DUTY = 0x001D,    //  0001 1101'b		ADV_DIRECT_IND(high duty cycle)
477     ADV_EVT_PROP_LEGACY_SCANNABLE_UNDIRECTED = 0x0012,              //  0001 0010'b		ADV_SCAN_IND
478     ADV_EVT_PROP_LEGACY_NON_CONNECTABLE_NON_SCANNABLE_UNDIRECTED = 0x0010,  //  0001 0000'b		ADV_NONCONN_IND
479 
480     ADV_EVT_PROP_EXTENDED_NON_CONNECTABLE_NON_SCANNABLE_UNDIRECTED =
481         0x0000,                                             //  0000 0000'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
482     ADV_EVT_PROP_EXTENDED_CONNECTABLE_UNDIRECTED = 0x0001,  //  0000 0001'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
483     ADV_EVT_PROP_EXTENDED_SCANNABLE_UNDIRECTED = 0x0002,    //  0000 0010'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
484     ADV_EVT_PROP_EXTENDED_NON_CONNECTABLE_NON_SCANNABLE_DIRECTED =
485         0x0004,                                           //  0000 0100'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
486     ADV_EVT_PROP_EXTENDED_CONNECTABLE_DIRECTED = 0x0005,  //  0000 0101'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
487     ADV_EVT_PROP_EXTENDED_SCANNABLE_DIRECTED = 0x0006,    //  0000 0110'b		ADV_EXT_IND + AUX_ADV_IND/AUX_CHAIN_IND
488 
489     ADV_EVT_PROP_EXTENDED_MASK_ANONYMOUS_ADV =
490         0x0020,  // if this mask on(only extended ADV event can mask it), anonymous advertising
491     ADV_EVT_PROP_EXTENDED_MASK_TX_POWER_INCLUDE =
492         0x0040,  // if this mask on(only extended ADV event can mask it), TX power include
493 } advEvtProp_type_t;
494 
495 /* Advertising_TX_Power */
496 typedef enum {
497     TX_POWER_0dBm = 0,
498     TX_POWER_1dBm = 1,
499     TX_POWER_2dBm = 2,
500     TX_POWER_3dBm = 3,
501     TX_POWER_4dBm = 4,
502     TX_POWER_5dBm = 5,
503     TX_POWER_6dBm = 6,
504     TX_POWER_7dBm = 7,
505     TX_POWER_8dBm = 8,
506     TX_POWER_9dBm = 9,
507     TX_POWER_10dBm = 10,
508 } tx_power_t;
509 
510 /* Advertising_SID */
511 typedef enum {
512     ADV_SID_0 = 0x00,
513     ADV_SID_1 = 0x01,
514     ADV_SID_2 = 0x02,
515     ADV_SID_3 = 0x03,
516 } adv_sid_t;
517 
518 /**
519  *  @brief  Command Parameters for "7.8.54 LE Set Extended Advertising Data command"
520  */
521 
522 /* Operation */
523 typedef enum {
524     DATA_OPER_INTER = 0x00,
525     DATA_OPER_FIRST = 0x01,
526     DATA_OPER_LAST = 0x02,
527     DATA_OPER_COMPLETE = 0x03,
528     DATA_OPER_UNCHANGEED = 0x04,
529 } data_oper_t;
530 
531 /* Fragment_Preference */
532 typedef enum {
533     DATA_FRAGM_ALLOWED = 0x00,
534     DATA_FRAGM_NONE_OR_MINIMIZE = 0x01,
535 } data_fragm_t;
536 
537 /**
538  *  @brief  Command Parameters for "7.8.56 LE Set Extended Advertising Enable command"
539  */
540 
541 typedef struct {
542     u8 adv_handle;
543     u16 duration;
544     u8 max_ext_adv_evts;
545 } extAdvEn_Cfg_t;
546 
547 typedef struct {
548     u8 enable;
549     u8 num_sets;
550     extAdvEn_Cfg_t cisCfg[3];  // TSKNUM_EXT_ADV
551 } hci_le_setExtAdvEn_cmdParam_t;
552 
553 /**
554  *  @brief  Command Parameters for "7.8.61 LE Set Periodic Advertising Parameters command"
555  */
556 
557 /* Periodic_adv_Interval, Time = N * 1.25 ms,
558  * Notice that these are just part of but not all Periodic_adv_Interval value */
559 typedef enum {
560     PERADV_INTERVAL_7P5MS = 6,
561     PERADV_INTERVAL_8P75MS = 7,
562     PERADV_INTERVAL_10MS = 8,
563     PERADV_INTERVAL_11P25MS = 9,
564     PERADV_INTERVAL_12P5MS = 10,
565     PERADV_INTERVAL_13P75MS = 11,
566     PERADV_INTERVAL_15MS = 12,
567     PERADV_INTERVAL_16P25MS = 13,
568     PERADV_INTERVAL_17P5MS = 14,
569     PERADV_INTERVAL_18P75MS = 15,
570     PERADV_INTERVAL_20MS = 16,
571     PERADV_INTERVAL_21P25MS = 17,
572     PERADV_INTERVAL_22P5MS = 18,
573     PERADV_INTERVAL_23P75MS = 19,
574     PERADV_INTERVAL_25MS = 20,
575     PERADV_INTERVAL_26P25MS = 21,
576     PERADV_INTERVAL_27P5MS = 22,
577     PERADV_INTERVAL_28P75MS = 23,
578     PERADV_INTERVAL_30MS = 24,
579     PERADV_INTERVAL_31P25MS = 25,
580     PERADV_INTERVAL_32P5MS = 26,
581     PERADV_INTERVAL_33P75MS = 27,
582     PERADV_INTERVAL_35MS = 28,
583     PERADV_INTERVAL_36P25MS = 29,
584     PERADV_INTERVAL_37P5MS = 30,
585     PERADV_INTERVAL_38P75MS = 31,
586     PERADV_INTERVAL_40MS = 32,
587     PERADV_INTERVAL_41P25MS = 33,
588     PERADV_INTERVAL_42P5MS = 34,
589     PERADV_INTERVAL_43P75MS = 35,
590     PERADV_INTERVAL_45MS = 36,
591     PERADV_INTERVAL_46P25MS = 37,
592     PERADV_INTERVAL_47P5MS = 38,
593     PERADV_INTERVAL_48P75MS = 39,
594     PERADV_INTERVAL_50MS = 40,
595     PERADV_INTERVAL_55MS = 44,
596     PERADV_INTERVAL_60MS = 48,
597     PERADV_INTERVAL_62P5MS = 50,
598     PERADV_INTERVAL_65MS = 52,
599     PERADV_INTERVAL_70MS = 56,
600     PERADV_INTERVAL_75MS = 60,
601     PERADV_INTERVAL_80MS = 64,
602     PERADV_INTERVAL_85MS = 68,
603     PERADV_INTERVAL_90MS = 72,
604     PERADV_INTERVAL_95MS = 78,
605     PERADV_INTERVAL_100MS = 80,
606     PERADV_INTERVAL_110MS = 88,
607     PERADV_INTERVAL_120MS = 96,
608     PERADV_INTERVAL_130MS = 104,
609     PERADV_INTERVAL_140MS = 112,
610     PERADV_INTERVAL_150MS = 120,
611     PERADV_INTERVAL_180MS = 144,
612     PERADV_INTERVAL_200MS = 160,
613     PERADV_INTERVAL_250MS = 200,
614     PERADV_INTERVAL_300MS = 240,
615     PERADV_INTERVAL_400MS = 320,
616     PERADV_INTERVAL_500MS = 400,
617     PERADV_INTERVAL_600MS = 480,
618     PERADV_INTERVAL_700MS = 560,
619     PERADV_INTERVAL_800MS = 640,
620     PERADV_INTERVAL_900MS = 720,
621     PERADV_INTERVAL_1S = 800,
622     PERADV_INTERVAL_1S2 = 960,
623     PERADV_INTERVAL_1S4 = 1120,
624     PERADV_INTERVAL_1S5 = 1200,
625     PERADV_INTERVAL_1S6 = 1280,
626     PERADV_INTERVAL_1S8 = 1440,
627     PERADV_INTERVAL_2S = 1600,
628     PERADV_INTERVAL_3S = 2400,
629     PERADV_INTERVAL_4S = 3200,
630     PERADV_INTERVAL_5S = 4000,
631     PERADV_INTERVAL_6S = 4800,
632     PERADV_INTERVAL_7S = 5600,
633     PERADV_INTERVAL_8S = 6400,
634     PERADV_INTERVAL_9S = 7200,
635     PERADV_INTERVAL_10S = 8000,
636 } periodic_adv_inter_t;
637 
638 typedef enum {
639     PERD_ADV_PROP_MASK_NONE = 0,
640 
641     PERD_ADV_PROP_MASK_TX_POWER_INCLUDE = BIT(6),
642 } perd_adv_prop_t;
643 
644 /**
645  *  @brief  Command Parameters for "7.8.64 LE Set Extended Scan Parameters command"
646  */
647 typedef struct {
648     u8 scan_type;
649     u16 scan_interval;
650     u16 scan_window;
651 } ext_scan_cfg_t;
652 
653 typedef struct {
654     u8 ownAddress_type;
655     u8 scan_filter_policy;
656     u8 scan_PHYs;
657     ext_scan_cfg_t scanCfg[2];  // at most 2 kind of PHY: 1M and Coded
658 } hci_le_setExtScanParam_cmdParam_t;
659 
660 /* Scanning_PHYs */
661 typedef enum {
662     SCAN_PHY_1M = BIT(0),
663     SCAN_PHY_CODED = BIT(2),
664     SCAN_PHY_1M_CODED = (SCAN_PHY_1M | SCAN_PHY_CODED),
665 } scan_phy_t;
666 
667 /**
668  *  @brief  Command Parameters for "7.8.65 LE Set Extended Scan Enable command"
669  */
670 typedef struct {
671     u8 Enable;
672     u8 Filter_Duplicates;
673     u16 Duration;
674     u16 Period;
675 } hci_le_setExtScanEnable_cmdParam_t;
676 
677 /* Filter_Duplicates for Extended Scan */
678 typedef enum {
679     DUPE_FLTR_DISABLE = 0x00,
680     DUPE_FLTR_ENABLE = 0x01,
681     DUPE_FLTR_ENABLE_RST_PERIOD = 0x02,
682 } dupe_fltr_en_t;
683 
684 /* Scan duration, Range: 0x0001 to 0xFFFF, Time = N * 10 ms, Time Range: 10 ms to 655.35 s,
685  * Notice that these are just part of but not all Scan duration value */
686 typedef enum {
687     SCAN_DURATION_CONTINUOUS = 0,
688     SCAN_DURATION_50MS = 5,
689     SCAN_DURATION_100MS = 10,
690     SCAN_DURATION_150MS = 15,
691     SCAN_DURATION_200MS = 20,
692     SCAN_DURATION_250MS = 25,
693     SCAN_DURATION_300MS = 30,
694     SCAN_DURATION_350MS = 35,
695     SCAN_DURATION_400MS = 40,
696     SCAN_DURATION_450MS = 45,
697     SCAN_DURATION_500MS = 50,
698     SCAN_DURATION_550MS = 55,
699     SCAN_DURATION_600MS = 60,
700     SCAN_DURATION_650MS = 65,
701     SCAN_DURATION_700MS = 70,
702     SCAN_DURATION_750MS = 75,
703     SCAN_DURATION_800MS = 80,
704     SCAN_DURATION_850MS = 85,
705     SCAN_DURATION_900MS = 90,
706     SCAN_DURATION_950MS = 96,
707     SCAN_DURATION_1S = 100,
708     SCAN_DURATION_1S2 = 120,
709     SCAN_DURATION_1S5 = 150,
710     SCAN_DURATION_1S6 = 160,
711     SCAN_DURATION_1S8 = 180,
712     SCAN_DURATION_2S = 200,
713     SCAN_DURATION_3S = 300,
714     SCAN_DURATION_4S = 400,
715     SCAN_DURATION_5S = 500,
716     SCAN_DURATION_6S = 600,
717     SCAN_DURATION_7S = 700,
718     SCAN_DURATION_8S = 800,
719     SCAN_DURATION_9S = 900,
720     SCAN_DURATION_10S = 1000,
721 } scan_durn_t;
722 
723 /* Scan period, Range: 0x0001 to 0xFFFF, Time = N * 1.28 sec, Time Range: 1.28 s to 83,884.8 s
724  * Notice that these are just part of but not all Scan period value */
725 typedef enum {
726     SCAN_WINDOW_CONTINUOUS = 0,
727     SCAN_WINDOW_1S28 = 1,
728     SCAN_WINDOW_2S56 = 2,
729     SCAN_WINDOW_3S84 = 3,
730     SCAN_WINDOW_5S12 = 4,
731     SCAN_WINDOW_6S4 = 5,
732     SCAN_WINDOW_7S68 = 6,
733     SCAN_WINDOW_8S92 = 7,
734     SCAN_WINDOW_10S24 = 8,
735     SCAN_WINDOW_11S52 = 9,
736     SCAN_WINDOW_12S8 = 10,
737 } scan_period_t;
738 
739 /**
740  *  @brief  Command Parameters for "7.8.66 LE Extended Create Connection command"
741  */
742 typedef struct {
743     u16 scan_inter;
744     u16 scan_wind;
745     u16 conn_min;
746     u16 conn_max;
747     u16 connLatency;
748     u16 timeout;
749     u16 ceLen_min;
750     u16 ceLen_max;
751 } ext_init_cfg_t;
752 
753 typedef struct {
754     u8 fp;  // init_filter_policy
755     u8 ownAddr_type;
756     u8 peerAddr_type;
757     u8 peer_addr[6];
758     u8 init_PHYs;
759     ext_init_cfg_t initCfg[3];
760 } hci_le_ext_createConn_cmdParam_t;
761 
762 #define EXT_CREATE_CONN_CMD_PARAM_MAX_LENGTH (10 + 16 * 3)  // 10 + sizeof(ext_init_cfg_t) * 3
763 
764 /* Initiating_PHYs */
765 typedef enum {
766     INIT_PHY_1M = BIT(0),
767     INIT_PHY_2M = BIT(1),  // can not use this,
768     // at least one bit set for a PHY allowed for scanning on the primary advertising physical channel
769     INIT_PHY_CODED = BIT(2),
770     INIT_PHY_1M_2M = (INIT_PHY_1M | INIT_PHY_2M),
771     INIT_PHY_1M_CODED = (INIT_PHY_1M | INIT_PHY_CODED),
772     INIT_PHY_2M_CODED = (INIT_PHY_2M | INIT_PHY_CODED),
773     INIT_PHY_1M_2M_CODED = (INIT_PHY_1M | INIT_PHY_2M | INIT_PHY_1M_CODED),
774 } init_phy_t;
775 
776 /**
777  *  @brief  Command Parameters for "7.8.67 LE Periodic Advertising Create Sync command"
778  */
779 typedef struct {
780     u8 Options;
781     u8 Advertising_SID;
782     u8 Advertiser_Address_Type;
783     u8 Advertiser_Address[6];
784     u16 Skip;
785     u16 Sync_Timeout;
786     u16 Sync_CTE_Type;
787 } hci_le_periodicAdvCreateSync_cmdParam_t;
788 
789 /**
790  * @brief  Command Parameters for "7.8.80 LE Set Connectionless CTE Transmit Parameters command"
791  */
792 typedef struct {
793     u8 Advertising_Handle;
794     u8 CTE_length;
795     u8 CTE_type;
796     u8 CTE_count;
797 
798     u8 Switch_pattern_len;
799     u8 Antenna_IDs[1];
800 } hci_le_setConnectionless_CTETransmitParam_t;
801 
802 typedef struct {
803     adv_handle_t adv_handle;
804     u8 CTE_enable;
805 } hci_le_CTE_enable_type;
806 
807 typedef struct {
808     u16 Sync_Handle;
809     u8 Sampling_Enable;
810     u8 Slot_Duration;
811 
812     u8 Max_Sampled_CTEs;
813     u8 Switching_pattern_len;
814     u8 Antenna_IDs[1];
815 } hci_le_setConnectionless_IQsampleEn_t;
816 
817 typedef struct {
818     u8 conn_handle;
819     u8 sampling_en;
820     u8 slot_duration;
821     u8 switch_pattern_len;
822 
823     u8 antenna_ids[1];
824 } hci_le_setConnection_CTERevParams_t;
825 
826 typedef struct {
827     u8 conn_handle;
828     u8 CTE_type;
829     u8 switching_pattern_len;
830     u8 antenna_IDs[1];
831 } hci_le_setConnection_CTETransmitParams_t;
832 
833 typedef struct {
834     u8 status;
835     u8 support_switch_sample_rate;
836     u8 antenna_num;
837     u8 max_switch_pattern_len;
838 
839     u8 max_cte_len;
840 } cte_antenna_infor_t;
841 
842 typedef struct {
843     u8 conn_handle;
844     u8 cte_req_en;
845     u16 cte_req_intvl;
846 
847     u8 req_cte_len;
848     u8 req_cte_type;
849 } hci_le_cteReqEn_t;
850 
851 typedef struct {
852     u8 conn_handle;
853     u8 rsp_enable;
854 } hci_le_cteRspEn_t;
855 
856 /* Options */
857 typedef enum {
858     /* BIT(0)
859 	 * 0: Use the adv_sid, adv_addr_type, and adv_address parameters to determine which advertiser to listen to.
860 	 * 1: Use the Periodic Advertiser List to determine which advertiser to listen to. */
861     SYNC_ADV_SPECIFY = 0,
862     SYNC_ADV_FROM_LIST = BIT(0),
863 
864     /* BIT(1)
865 	   whether HCI_Periodic_Advertising_Report events for this periodic advertising train are initially enabled
866 	   0: enabled
867 	   1: disabled
868 	*/
869     REPORTING_INITIALLY_EN = 0,
870     REPORTING_INITIALLY_DIS = BIT(1),
871 
872     /* BIT(2) ~ BIT(7) reserved */
873 } option_msk_t;
874 
875 /* Synchronization timeout, Time = N * 10 ms,
876  * Notice that these are just part of but not all Synchronization timeout value */
877 typedef enum {
878     SYNC_TIMEOUT_100MS = 10,
879     SYNC_TIMEOUT_200MS = 20,
880     SYNC_TIMEOUT_300MS = 30,
881     SYNC_TIMEOUT_400MS = 40,
882     SYNC_TIMEOUT_500MS = 50,
883     SYNC_TIMEOUT_1S = 100,
884     SYNC_TIMEOUT_1S5 = 150,
885     SYNC_TIMEOUT_2S = 200,
886     SYNC_TIMEOUT_2S5 = 250,
887     SYNC_TIMEOUT_3S = 300,
888     SYNC_TIMEOUT_3S5 = 350,
889     SYNC_TIMEOUT_4S = 400,
890     SYNC_TIMEOUT_4S5 = 450,
891     SYNC_TIMEOUT_5S = 500,
892     SYNC_TIMEOUT_6S = 600,
893     SYNC_TIMEOUT_7S = 700,
894     SYNC_TIMEOUT_8S = 800,
895     SYNC_TIMEOUT_9S = 900,
896     SYNC_TIMEOUT_10S = 1000,
897     SYNC_TIMEOUT_15S = 1500,
898     SYNC_TIMEOUT_20S = 2000,
899 } sync_tm_t;
900 
901 /**
902  *  @brief  Command Parameters for "7.8.97 LE Set CIG Parameters command"
903  */
904 typedef struct {
905     u8 cig_id;
906     u8 sdu_int_m2s[3];
907     u8 sdu_int_s2m[3];
908     u8 sca;
909     u8 packing;
910     u8 framing;
911     u16 max_trans_lat_m2s;
912     u16 max_trans_lat_s2m;
913     u8 cis_count;
914     u8 restparam[1];
915 } hci_le_setCigParam_cmdParam_t;
916 
917 typedef struct {
918     u8 cis_id;
919     u8 nse;
920     u16 max_sdu_m2s;
921     u16 max_sdu_s2m;
922     u16 max_pdu_m2s;
923     u16 max_pdu_s2m;
924     u8 phy_m2s;
925     u8 phy_s2m;
926     u8 bn_m2s;
927     u8 bn_s2m;
928 } cigParamTest_cisCfg_t;
929 
930 /* Slaves_Clock_Accuracy */
931 typedef enum {
932     PPM_251_500 = 0x00,
933     PPM_151_250 = 0x01,
934     PPM_101_150 = 0x02,
935     PPM_76_100 = 0x03,
936     PPM_51_75 = 0x04,
937     PPM_31_50 = 0x05,
938     PPM_21_30 = 0x06,
939     PPM_0_20 = 0x07,
940 } slv_clk_accuracy_t;
941 
942 /* Packing */
943 typedef enum {
944     PACK_SEQUENTIAL = 0x00,
945     PACK_INTERLEAVED = 0x01,
946 } packing_type_t;
947 
948 /* Framing */
949 typedef enum {
950     UNFRAMED = 0x00,
951     FRAMED = 0x01,
952 } framing_t;
953 
954 /**
955  *  @brief  Command Parameters for "7.8.98 LE Set CIG Parameters Test command"
956  */
957 typedef struct {
958     u8 cig_id;
959     u8 sdu_int_m2s[3];
960     u8 sdu_int_s2m[3];
961     u8 ft_m2s;
962     u8 ft_s2m;
963     u16 iso_intvl;
964     u8 sca;
965     u8 packing;
966     u8 framing;
967     u8 cis_count;                     // 15 B above
968     cigParamTest_cisCfg_t cisCfg[1];  // 14 B for one CIS configuration
969 } hci_le_setCigParamTest_cmdParam_t;
970 
971 /**
972  *  @brief  Return Parameters for "LE Set CIG Parameters command" and "LE Set CIG Parameters Test command"
973  */
974 typedef struct {
975     u8 status;
976     u8 cig_id;
977     u8 cis_count;
978     u16 cis_connHandle[1];  // not 4 byte aligned, but no problem
979 } hci_le_setCigParam_retParam_t;
980 
981 /* ISO_Interval, Time = N * 1.25 ms,
982  * Notice that these are just part of but not all ISO_Interval value */
983 typedef enum {
984     ISO_INTERVAL_5MS = 4,
985     ISO_INTERVAL_6P75MS = 5,
986     ISO_INTERVAL_7P5MS = 6,
987     ISO_INTERVAL_8P75MS = 7,
988     ISO_INTERVAL_10MS = 8,
989     ISO_INTERVAL_11P25MS = 9,
990     ISO_INTERVAL_12P5MS = 10,
991     ISO_INTERVAL_15MS = 12,
992     ISO_INTERVAL_18P75MS = 15,
993     ISO_INTERVAL_20MS = 16,
994     ISO_INTERVAL_25MS = 20,
995     ISO_INTERVAL_27P5MS = 22,
996     ISO_INTERVAL_30MS = 24,
997     ISO_INTERVAL_31P25MS = 25,
998     ISO_INTERVAL_38P75MS = 31,
999     ISO_INTERVAL_40MS = 32,
1000     ISO_INTERVAL_48P75MS = 39,
1001     ISO_INTERVAL_50MS = 40,
1002     ISO_INTERVAL_100MS = 80,
1003 } iso_inter_t;
1004 
1005 /**
1006  *	@brief  Command Parameters for "7.8.99 LE Create CIS command"
1007  */
1008 typedef struct {
1009     u16 cis_handle;
1010     u16 acl_handle;
1011 } cisConnParams_t;
1012 
1013 typedef struct {
1014     u8 cis_count;
1015     cisConnParams_t cisConn[1];
1016 } hci_le_CreateCisParams_t;
1017 
1018 /**
1019  *	@brief  Command Parameters for "7.8.103 LE Create BIG command"
1020  */
1021 typedef struct {
1022     u8 big_handle;           /* Used to identify the BIG */
1023     u8 adv_handle;           /* Used to identify the periodic advertising train */
1024     u8 num_bis;              /* Total number of BISes in the BIG */
1025     u8 sdu_intvl[3];         /* The interval, in microseconds, of BIS SDUs */
1026     u16 max_sdu;             /* Maximum size of an SDU, in octets */
1027     u16 max_trans_lat;       /* Maximum time, in milliseconds, for transmitting an SDU */
1028     u8 rtn;                  /* The maximum number of times that every BIS Data PDU should be retransmitted */
1029     u8 phy;                  /* The transmitter PHY of packets */
1030     packing_type_t packing;  // type same as u8
1031     framing_t framing;       // type same as u8
1032     u8 enc;                  /* Encryption flag */
1033     u8 broadcast_code
1034         [16]; /* The code used to derive the session key that is used to encrypt and decrypt BIS payloads */
1035 } hci_le_createBigParams_t;
1036 
1037 /**
1038  *	@brief  Command Parameters for "7.8.104 LE Create BIG Test command"
1039  */
1040 typedef struct {
1041     u8 big_handle;   /* Used to identify the BIG */
1042     u8 adv_handle;   /* Used to identify the periodic advertising train */
1043     u8 num_bis;      /* Total number of BISes in the BIG */
1044     u8 sdu_intvl[3]; /* The interval, in microseconds, of periodic SDUs */
1045     u16 iso_intvl;   /* The time between consecutive BIG anchor points, Time = N * 1.25 ms */
1046     u8 nse;          /* The total number of subevents in each interval of each BIS in the BIG */
1047     u16 max_sdu;     /* Maximum size of an SDU, in octets */
1048     u16 max_pdu;     /* Maximum size, in octets, of payload */
1049     u8 phy;          /* The transmitter PHY of packets, BIT(0): LE 1M; BIT(1): LE 2M; BIT(3): LE Coded PHY */
1050     u8 packing;
1051     u8 framing;
1052     u8 bn;  /* The number of new payloads in each interval for each BIS */
1053     u8 irc; /* The number of times the scheduled payload(s) are transmitted in a given event */
1054     u8 pto; /* Offset used for pre-transmissions */
1055     u8 enc; /* Encryption flag */
1056     u8 broadcast_code
1057         [16]; /* The code used to derive the session key that is used to encrypt and decrypt BIS payloads */
1058 } hci_le_createBigParamsTest_t;
1059 
1060 /**
1061  *	@brief  Command Parameters for "7.8.105 LE Terminate BIG command"
1062  */
1063 typedef struct {
1064     u8 big_handle;
1065     u8 reason;
1066 } hci_le_terminateBigParams_t;
1067 
1068 typedef struct {
1069     u8 big_handle;   /* Used to identify the BIG */
1070     u16 sync_handle; /* Identifier of the periodic advertising train */
1071     u8 enc;          /* Encryption flag */
1072     u8 broadcast_code
1073         [16]; /* The code used to derive the session key that is used to encrypt and decrypt BIS payloads */
1074     u8 mse;   /* The Controller can schedule reception of any number of subevents up to NSE */
1075     u16 big_sync_timeout; /* Synchronization timeout for the BIG, Time = N*10 ms, Time Range: 100 ms to 163.84 s */
1076     u8 num_bis;           /* Total number of BISes to synchronize */
1077     u8 bis[1];            /* List of indices of BISes */
1078 } hci_le_bigCreateSyncParams_t;
1079 
1080 /**
1081  *	@brief  Command Parameters for "7.8.109 LE Setup ISO Data Path command"
1082  */
1083 typedef struct {
1084     u16 conn_handle;
1085     u8 data_path_direction;
1086     u8 data_path_id;
1087     u8 codec_id[5];
1088 
1089     u32 controller_delay : 24;
1090     u32 codec_configration_length : 8;
1091 
1092     u8 codec_config[1];
1093 } hci_le_setupIsoDataPathCmdParams_t;
1094 
1095 /**
1096  * @brief Command Parameters for "7.8.111 LE ISO Transmit Test command"
1097  */
1098 typedef struct {
1099     u16 handle;
1100     u8 payload_type;
1101 } hci_le_isoTransmitTestCmdParams_t;
1102 
1103 /**
1104  * @brief Command Parameters for "7.8.112 LE ISO Receive Test command"
1105  */
1106 typedef struct {
1107     u16 handle;
1108     u8 payload_type;
1109 } hci_le_isoReceiveTestCmdParams_t;
1110 
1111 #endif /* HCI_CMD_H_ */
1112