CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/cache/sources/hcitools/monitor/bt.h
Views: 3959
1
/*
2
*
3
* BlueZ - Bluetooth protocol stack for Linux
4
*
5
* Copyright (C) 2011-2012 Intel Corporation
6
* Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>
7
*
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 2.1 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
*
23
*/
24
25
#include <stdint.h>
26
27
struct bt_ll_hdr {
28
uint8_t preamble;
29
uint32_t access_addr;
30
} __attribute__ ((packed));
31
32
#define BT_LL_CONN_UPDATE_REQ 0x00
33
struct bt_ll_conn_update_req {
34
uint8_t win_size;
35
uint16_t win_offset;
36
uint16_t interval;
37
uint16_t latency;
38
uint16_t timeout;
39
uint16_t instant;
40
} __attribute__ ((packed));
41
42
#define BT_LL_CHANNEL_MAP_REQ 0x01
43
struct bt_ll_channel_map_req {
44
uint8_t map[5];
45
uint16_t instant;
46
} __attribute__ ((packed));
47
48
#define BT_LL_TERMINATE_IND 0x02
49
struct bt_ll_terminate_ind {
50
uint8_t error;
51
} __attribute__ ((packed));
52
53
#define BT_LL_ENC_REQ 0x03
54
struct bt_ll_enc_req {
55
uint64_t rand;
56
uint16_t ediv;
57
uint64_t skd;
58
uint32_t iv;
59
} __attribute__ ((packed));
60
61
#define BT_LL_ENC_RSP 0x04
62
struct bt_ll_enc_rsp {
63
uint64_t skd;
64
uint32_t iv;
65
} __attribute__ ((packed));
66
67
#define BT_LL_START_ENC_REQ 0x05
68
69
#define BT_LL_START_ENC_RSP 0x06
70
71
#define BT_LL_UNKNOWN_RSP 0x07
72
struct bt_ll_unknown_rsp {
73
uint8_t type;
74
} __attribute__ ((packed));
75
76
#define BT_LL_FEATURE_REQ 0x08
77
struct bt_ll_feature_req {
78
uint8_t features[8];
79
} __attribute__ ((packed));
80
81
#define BT_LL_FEATURE_RSP 0x09
82
struct bt_ll_feature_rsp {
83
uint8_t features[8];
84
} __attribute__ ((packed));
85
86
#define BT_LL_PAUSE_ENC_REQ 0x0a
87
88
#define BT_LL_PAUSE_ENC_RSP 0x0b
89
90
#define BT_LL_VERSION_IND 0x0c
91
struct bt_ll_version_ind {
92
uint8_t version;
93
uint16_t company;
94
uint16_t subversion;
95
} __attribute__ ((packed));
96
97
#define BT_LL_REJECT_IND 0x0d
98
struct bt_ll_reject_ind {
99
uint8_t error;
100
} __attribute__ ((packed));
101
102
#define BT_H4_CMD_PKT 0x01
103
#define BT_H4_ACL_PKT 0x02
104
#define BT_H4_SCO_PKT 0x03
105
#define BT_H4_EVT_PKT 0x04
106
107
struct bt_hci_acl_hdr {
108
uint16_t handle;
109
uint16_t dlen;
110
} __attribute__ ((packed));
111
112
struct bt_hci_cmd_hdr {
113
uint16_t opcode;
114
uint8_t plen;
115
} __attribute__ ((packed));
116
117
struct bt_hci_evt_hdr {
118
uint8_t evt;
119
uint8_t plen;
120
} __attribute__ ((packed));
121
122
#define BT_HCI_CMD_NOP 0x0000
123
124
#define BT_HCI_CMD_INQUIRY 0x0401
125
struct bt_hci_cmd_inquiry {
126
uint8_t lap[3];
127
uint8_t length;
128
uint8_t num_resp;
129
} __attribute__ ((packed));
130
131
#define BT_HCI_CMD_INQUIRY_CANCEL 0x0402
132
133
#define BT_HCI_CMD_PERIODIC_INQUIRY 0x0403
134
struct bt_hci_cmd_periodic_inquiry {
135
uint16_t max_period;
136
uint16_t min_period;
137
uint8_t lap[3];
138
uint8_t length;
139
uint8_t num_resp;
140
} __attribute__ ((packed));
141
142
#define BT_HCI_CMD_EXIT_PERIODIC_INQUIRY 0x0404
143
144
#define BT_HCI_CMD_CREATE_CONN 0x0405
145
struct bt_hci_cmd_create_conn {
146
uint8_t bdaddr[6];
147
uint16_t pkt_type;
148
uint8_t pscan_rep_mode;
149
uint8_t pscan_mode;
150
uint16_t clock_offset;
151
uint8_t role_switch;
152
} __attribute__ ((packed));
153
154
#define BT_HCI_CMD_DISCONNECT 0x0406
155
struct bt_hci_cmd_disconnect {
156
uint16_t handle;
157
uint8_t reason;
158
} __attribute__ ((packed));
159
160
#define BT_HCI_CMD_ADD_SCO_CONN 0x0407
161
struct bt_hci_cmd_add_sco_conn {
162
uint16_t handle;
163
uint16_t pkt_type;
164
} __attribute__ ((packed));
165
166
#define BT_HCI_CMD_CREATE_CONN_CANCEL 0x0408
167
struct bt_hci_cmd_create_conn_cancel {
168
uint8_t bdaddr[6];
169
} __attribute__ ((packed));
170
171
#define BT_HCI_CMD_ACCEPT_CONN_REQUEST 0x0409
172
struct bt_hci_cmd_accept_conn_request {
173
uint8_t bdaddr[6];
174
uint8_t role;
175
} __attribute__ ((packed));
176
177
#define BT_HCI_CMD_REJECT_CONN_REQUEST 0x040a
178
struct bt_hci_cmd_reject_conn_request {
179
uint8_t bdaddr[6];
180
uint8_t reason;
181
} __attribute__ ((packed));
182
183
#define BT_HCI_CMD_LINK_KEY_REQUEST_REPLY 0x040b
184
struct bt_hci_cmd_link_key_request_reply {
185
uint8_t bdaddr[6];
186
uint8_t link_key[16];
187
} __attribute__ ((packed));
188
189
#define BT_HCI_CMD_LINK_KEY_REQUEST_NEG_REPLY 0x040c
190
struct bt_hci_cmd_link_key_request_neg_reply {
191
uint8_t bdaddr[6];
192
} __attribute__ ((packed));
193
194
#define BT_HCI_CMD_PIN_CODE_REQUEST_REPLY 0x040d
195
struct bt_hci_cmd_pin_code_request_reply {
196
uint8_t bdaddr[6];
197
uint8_t pin_len;
198
uint8_t pin_code[16];
199
} __attribute__ ((packed));
200
201
#define BT_HCI_CMD_PIN_CODE_REQUEST_NEG_REPLY 0x040e
202
struct bt_hci_cmd_pin_code_request_neg_reply {
203
uint8_t bdaddr[6];
204
} __attribute__ ((packed));
205
206
#define BT_HCI_CMD_CHANGE_CONN_PKT_TYPE 0x040f
207
struct bt_hci_cmd_change_conn_pkt_type {
208
uint16_t handle;
209
uint16_t pkt_type;
210
} __attribute__ ((packed));
211
212
#define BT_HCI_CMD_AUTH_REQUESTED 0x0411
213
struct bt_hci_cmd_auth_requested {
214
uint16_t handle;
215
} __attribute__ ((packed));
216
217
#define BT_HCI_CMD_SET_CONN_ENCRYPT 0x0413
218
struct bt_hci_cmd_set_conn_encrypt {
219
uint16_t handle;
220
uint8_t encr_mode;
221
} __attribute__ ((packed));
222
223
#define BT_HCI_CMD_CHANGE_CONN_LINK_KEY 0x0415
224
struct bt_hci_cmd_change_conn_link_key {
225
uint16_t handle;
226
} __attribute__ ((packed));
227
228
#define BT_HCI_CMD_MASTER_LINK_KEY 0x0417
229
struct bt_hci_cmd_master_link_key {
230
uint8_t key_flag;
231
} __attribute__ ((packed));
232
233
#define BT_HCI_CMD_REMOTE_NAME_REQUEST 0x0419
234
struct bt_hci_cmd_remote_name_request {
235
uint8_t bdaddr[6];
236
uint8_t pscan_rep_mode;
237
uint8_t pscan_mode;
238
uint16_t clock_offset;
239
} __attribute__ ((packed));
240
241
#define BT_HCI_CMD_REMOTE_NAME_REQUEST_CANCEL 0x041a
242
struct bt_hci_cmd_remote_name_request_cancel {
243
uint8_t bdaddr[6];
244
} __attribute__ ((packed));
245
struct bt_hci_rsp_remote_name_request_cancel {
246
uint8_t status;
247
uint8_t bdaddr[6];
248
} __attribute__ ((packed));
249
250
#define BT_HCI_CMD_READ_REMOTE_FEATURES 0x041b
251
struct bt_hci_cmd_read_remote_features {
252
uint16_t handle;
253
} __attribute__ ((packed));
254
255
#define BT_HCI_CMD_READ_REMOTE_EXT_FEATURES 0x041c
256
struct bt_hci_cmd_read_remote_ext_features {
257
uint16_t handle;
258
uint8_t page;
259
} __attribute__ ((packed));
260
261
#define BT_HCI_CMD_READ_REMOTE_VERSION 0x041d
262
struct bt_hci_cmd_read_remote_version {
263
uint16_t handle;
264
} __attribute__ ((packed));
265
266
#define BT_HCI_CMD_READ_CLOCK_OFFSET 0x041f
267
struct bt_hci_cmd_read_clock_offset {
268
uint16_t handle;
269
} __attribute__ ((packed));
270
271
#define BT_HCI_CMD_READ_LMP_HANDLE 0x0420
272
struct bt_hci_cmd_read_lmp_handle {
273
uint16_t handle;
274
} __attribute__ ((packed));
275
struct bt_hci_rsp_read_lmp_handle {
276
uint8_t status;
277
uint16_t handle;
278
uint8_t lmp_handle;
279
uint32_t reserved;
280
} __attribute__ ((packed));
281
282
#define BT_HCI_CMD_SETUP_SYNC_CONN 0x0428
283
struct bt_hci_cmd_setup_sync_conn {
284
uint16_t handle;
285
uint32_t tx_bandwidth;
286
uint32_t rx_bandwidth;
287
uint16_t max_latency;
288
uint16_t voice_setting;
289
uint8_t retrans_effort;
290
uint16_t pkt_type;
291
} __attribute__ ((packed));
292
293
#define BT_HCI_CMD_ACCEPT_SYNC_CONN 0x0429
294
struct bt_hci_cmd_accept_sync_conn {
295
uint8_t bdaddr[6];
296
uint32_t tx_bandwidth;
297
uint32_t rx_bandwidth;
298
uint16_t max_latency;
299
uint16_t voice_setting;
300
uint8_t retrans_effort;
301
uint16_t pkt_type;
302
} __attribute__ ((packed));
303
304
#define BT_HCI_CMD_REJECT_SYNC_CONN 0x042a
305
struct bt_hci_cmd_reject_sync_conn {
306
uint8_t bdaddr[6];
307
uint8_t reason;
308
} __attribute__ ((packed));
309
310
#define BT_HCI_CMD_IO_CAPABILITY_REQUEST_REPLY 0x042b
311
struct bt_hci_cmd_io_capability_request_reply {
312
uint8_t bdaddr[6];
313
uint8_t capability;
314
uint8_t oob_data;
315
uint8_t authentication;
316
} __attribute__ ((packed));
317
318
#define BT_HCI_CMD_USER_CONFIRM_REQUEST_REPLY 0x042c
319
struct bt_hci_cmd_user_confirm_request_reply {
320
uint8_t bdaddr[6];
321
} __attribute__ ((packed));
322
323
#define BT_HCI_CMD_USER_CONFIRM_REQUEST_NEG_REPLY 0x042d
324
struct bt_hci_cmd_user_confirm_request_neg_reply {
325
uint8_t bdaddr[6];
326
} __attribute__ ((packed));
327
328
#define BT_HCI_CMD_USER_PASSKEY_REQUEST_REPLY 0x042e
329
struct bt_hci_cmd_user_passkey_request_reply {
330
uint8_t bdaddr[6];
331
uint32_t passkey;
332
} __attribute__ ((packed));
333
334
#define BT_HCI_CMD_USER_PASSKEY_REQUEST_NEG_REPLY 0x042f
335
struct bt_hci_cmd_user_passkey_request_neg_reply {
336
uint8_t bdaddr[6];
337
} __attribute__ ((packed));
338
339
#define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_REPLY 0x0430
340
struct bt_hci_cmd_remote_oob_data_request_reply {
341
uint8_t bdaddr[6];
342
uint8_t hash[16];
343
uint8_t randomizer[16];
344
} __attribute__ ((packed));
345
346
#define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_NEG_REPLY 0x0433
347
struct bt_hci_cmd_remote_oob_data_request_neg_reply {
348
uint8_t bdaddr[6];
349
} __attribute__ ((packed));
350
351
#define BT_HCI_CMD_IO_CAPABILITY_REQUEST_NEG_REPLY 0x0434
352
struct bt_hci_cmd_io_capability_request_neg_reply {
353
uint8_t bdaddr[6];
354
uint8_t reason;
355
} __attribute__ ((packed));
356
357
#define BT_HCI_CMD_CREATE_PHY_LINK 0x0435
358
struct bt_hci_cmd_create_phy_link {
359
uint8_t phy_handle;
360
uint8_t key_len;
361
uint8_t key_type;
362
} __attribute__ ((packed));
363
364
#define BT_HCI_CMD_ACCEPT_PHY_LINK 0x0436
365
struct bt_hci_cmd_accept_phy_link {
366
uint8_t phy_handle;
367
uint8_t key_len;
368
uint8_t key_type;
369
} __attribute__ ((packed));
370
371
#define BT_HCI_CMD_DISCONN_PHY_LINK 0x0437
372
struct bt_hci_cmd_disconn_phy_link {
373
uint8_t phy_handle;
374
uint8_t reason;
375
} __attribute__ ((packed));
376
377
#define BT_HCI_CMD_CREATE_LOGIC_LINK 0x0438
378
struct bt_hci_cmd_create_logic_link {
379
uint8_t phy_handle;
380
uint8_t tx_flow_spec[16];
381
uint8_t rx_flow_spec[16];
382
} __attribute__ ((packed));
383
384
#define BT_HCI_CMD_ACCEPT_LOGIC_LINK 0x0439
385
struct bt_hci_cmd_accept_logic_link {
386
uint8_t phy_handle;
387
uint8_t tx_flow_spec[16];
388
uint8_t rx_flow_spec[16];
389
} __attribute__ ((packed));
390
391
#define BT_HCI_CMD_DISCONN_LOGIC_LINK 0x043a
392
struct bt_hci_cmd_disconn_logic_link {
393
uint16_t handle;
394
} __attribute__ ((packed));
395
396
#define BT_HCI_CMD_LOGIC_LINK_CANCEL 0x043b
397
struct bt_hci_cmd_logic_link_cancel {
398
uint8_t phy_handle;
399
uint8_t flow_spec;
400
} __attribute__ ((packed));
401
struct bt_hci_rsp_logic_link_cancel {
402
uint8_t status;
403
uint8_t phy_handle;
404
uint8_t flow_spec;
405
} __attribute__ ((packed));
406
407
#define BT_HCI_CMD_FLOW_SPEC_MODIFY 0x043c
408
struct bt_hci_cmd_flow_spec_modify {
409
uint16_t handle;
410
uint8_t tx_flow_spec[16];
411
uint8_t rx_flow_spec[16];
412
} __attribute__ ((packed));
413
414
#define BT_HCI_CMD_HOLD_MODE 0x0801
415
struct bt_hci_cmd_hold_mode {
416
uint16_t handle;
417
uint16_t max_interval;
418
uint16_t min_interval;
419
} __attribute__ ((packed));
420
421
#define BT_HCI_CMD_SNIFF_MODE 0x0803
422
struct bt_hci_cmd_sniff_mode {
423
uint16_t handle;
424
uint16_t max_interval;
425
uint16_t min_interval;
426
uint16_t attempt;
427
uint16_t timeout;
428
} __attribute__ ((packed));
429
430
#define BT_HCI_CMD_EXIT_SNIFF_MODE 0x0804
431
struct bt_hci_cmd_exit_sniff_mode {
432
uint16_t handle;
433
} __attribute__ ((packed));
434
435
#define BT_HCI_CMD_PARK_STATE 0x0805
436
struct bt_hci_cmd_park_state {
437
uint16_t handle;
438
uint16_t max_interval;
439
uint16_t min_interval;
440
} __attribute__ ((packed));
441
442
#define BT_HCI_CMD_EXIT_PARK_STATE 0x0806
443
struct bt_hci_cmd_exit_park_state {
444
uint16_t handle;
445
} __attribute__ ((packed));
446
447
#define BT_HCI_CMD_QOS_SETUP 0x0807
448
struct bt_hci_cmd_qos_setup {
449
uint16_t handle;
450
uint8_t flags;
451
uint8_t service_type;
452
uint32_t token_rate;
453
uint32_t peak_bandwidth;
454
uint32_t latency;
455
uint32_t delay_variation;
456
} __attribute__ ((packed));
457
458
#define BT_HCI_CMD_ROLE_DISCOVERY 0x0809
459
struct bt_hci_cmd_role_discovery {
460
uint16_t handle;
461
} __attribute__ ((packed));
462
struct bt_hci_rsp_role_discovery {
463
uint8_t status;
464
uint16_t handle;
465
uint8_t role;
466
} __attribute__ ((packed));
467
468
#define BT_HCI_CMD_SWITCH_ROLE 0x080b
469
struct bt_hci_cmd_switch_role {
470
uint8_t bdaddr[6];
471
uint8_t role;
472
} __attribute__ ((packed));
473
474
#define BT_HCI_CMD_READ_LINK_POLICY 0x080c
475
struct bt_hci_cmd_read_link_policy {
476
uint16_t handle;
477
} __attribute__ ((packed));
478
struct bt_hci_rsp_read_link_policy {
479
uint8_t status;
480
uint16_t handle;
481
uint16_t policy;
482
} __attribute__ ((packed));
483
484
#define BT_HCI_CMD_WRITE_LINK_POLICY 0x080d
485
struct bt_hci_cmd_write_link_policy {
486
uint16_t handle;
487
uint16_t policy;
488
} __attribute__ ((packed));
489
struct bt_hci_rsp_write_link_policy {
490
uint8_t status;
491
uint16_t handle;
492
} __attribute__ ((packed));
493
494
#define BT_HCI_CMD_READ_DEFAULT_LINK_POLICY 0x080e
495
struct bt_hci_rsp_read_default_link_policy {
496
uint8_t status;
497
uint16_t policy;
498
} __attribute__ ((packed));
499
500
#define BT_HCI_CMD_WRITE_DEFAULT_LINK_POLICY 0x080f
501
struct bt_hci_cmd_write_default_link_policy {
502
uint16_t policy;
503
} __attribute__ ((packed));
504
505
#define BT_HCI_CMD_FLOW_SPEC 0x0810
506
struct bt_hci_cmd_flow_spec {
507
uint16_t handle;
508
uint8_t flags;
509
uint8_t direction;
510
uint8_t service_type;
511
uint32_t token_rate;
512
uint32_t token_bucket_size;
513
uint32_t peak_bandwidth;
514
uint32_t access_latency;
515
} __attribute__ ((packed));
516
517
#define BT_HCI_CMD_SNIFF_SUBRATING 0x0811
518
struct bt_hci_cmd_sniff_subrating {
519
uint16_t handle;
520
uint16_t max_latency;
521
uint16_t min_remote_timeout;
522
uint16_t min_local_timeout;
523
} __attribute__ ((packed));
524
struct bt_hci_rsp_sniff_subrating {
525
uint8_t status;
526
uint16_t handle;
527
} __attribute__ ((packed));
528
529
#define BT_HCI_CMD_SET_EVENT_MASK 0x0c01
530
struct bt_hci_cmd_set_event_mask {
531
uint8_t mask[8];
532
} __attribute__ ((packed));
533
534
#define BT_HCI_CMD_RESET 0x0c03
535
536
#define BT_HCI_CMD_SET_EVENT_FILTER 0x0c05
537
struct bt_hci_cmd_set_event_filter {
538
uint8_t type;
539
uint8_t cond_type;
540
uint8_t cond[0];
541
} __attribute__ ((packed));
542
543
#define BT_HCI_CMD_FLUSH 0x0c08
544
struct bt_hci_cmd_flush {
545
uint16_t handle;
546
} __attribute__ ((packed));
547
struct bt_hci_rsp_flush {
548
uint8_t status;
549
uint16_t handle;
550
} __attribute__ ((packed));
551
552
#define BT_HCI_CMD_READ_PIN_TYPE 0x0c09
553
struct bt_hci_rsp_read_pin_type {
554
uint8_t status;
555
uint8_t pin_type;
556
} __attribute__ ((packed));
557
558
#define BT_HCI_CMD_WRITE_PIN_TYPE 0x0c0a
559
struct bt_hci_cmd_write_pin_type {
560
uint8_t pin_type;
561
} __attribute__ ((packed));
562
563
#define BT_HCI_CMD_CREATE_NEW_UNIT_KEY 0x0c0b
564
565
#define BT_HCI_CMD_READ_STORED_LINK_KEY 0x0c0d
566
struct bt_hci_cmd_read_stored_link_key {
567
uint8_t bdaddr[6];
568
uint8_t read_all;
569
} __attribute__ ((packed));
570
struct bt_hci_rsp_read_stored_link_key {
571
uint8_t status;
572
uint16_t max_num_keys;
573
uint16_t num_keys;
574
} __attribute__ ((packed));
575
576
#define BT_HCI_CMD_WRITE_STORED_LINK_KEY 0x0c11
577
struct bt_hci_cmd_write_stored_link_key {
578
uint8_t num_keys;
579
} __attribute__ ((packed));
580
struct bt_hci_rsp_write_stored_link_key {
581
uint8_t status;
582
uint8_t num_keys;
583
} __attribute__ ((packed));
584
585
#define BT_HCI_CMD_DELETE_STORED_LINK_KEY 0x0c12
586
struct bt_hci_cmd_delete_stored_link_key {
587
uint8_t bdaddr[6];
588
uint8_t delete_all;
589
} __attribute__ ((packed));
590
struct bt_hci_rsp_delete_stored_link_key {
591
uint8_t status;
592
uint16_t num_keys;
593
} __attribute__ ((packed));
594
595
#define BT_HCI_CMD_WRITE_LOCAL_NAME 0x0c13
596
struct bt_hci_cmd_write_local_name {
597
uint8_t name[248];
598
} __attribute__ ((packed));
599
600
#define BT_HCI_CMD_READ_LOCAL_NAME 0x0c14
601
struct bt_hci_rsp_read_local_name {
602
uint8_t status;
603
uint8_t name[248];
604
} __attribute__ ((packed));
605
606
#define BT_HCI_CMD_READ_CONN_ACCEPT_TIMEOUT 0x0c15
607
struct bt_hci_rsp_read_conn_accept_timeout {
608
uint8_t status;
609
uint16_t timeout;
610
} __attribute__ ((packed));
611
612
#define BT_HCI_CMD_WRITE_CONN_ACCEPT_TIMEOUT 0x0c16
613
struct bt_hci_cmd_write_conn_accept_timeout {
614
uint16_t timeout;
615
} __attribute__ ((packed));
616
617
#define BT_HCI_CMD_READ_PAGE_TIMEOUT 0x0c17
618
struct bt_hci_rsp_read_page_timeout {
619
uint8_t status;
620
uint16_t timeout;
621
} __attribute__ ((packed));
622
623
#define BT_HCI_CMD_WRITE_PAGE_TIMEOUT 0x0c18
624
struct bt_hci_cmd_write_page_timeout {
625
uint16_t timeout;
626
} __attribute__ ((packed));
627
628
#define BT_HCI_CMD_READ_SCAN_ENABLE 0x0c19
629
struct bt_hci_rsp_read_scan_enable {
630
uint8_t status;
631
uint8_t enable;
632
} __attribute__ ((packed));
633
634
#define BT_HCI_CMD_WRITE_SCAN_ENABLE 0x0c1a
635
struct bt_hci_cmd_write_scan_enable {
636
uint8_t enable;
637
} __attribute__ ((packed));
638
639
#define BT_HCI_CMD_READ_PAGE_SCAN_ACTIVITY 0x0c1b
640
struct bt_hci_rsp_read_page_scan_activity {
641
uint8_t status;
642
uint16_t interval;
643
uint16_t window;
644
} __attribute__ ((packed));
645
646
#define BT_HCI_CMD_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c
647
struct bt_hci_cmd_write_page_scan_activity {
648
uint16_t interval;
649
uint16_t window;
650
} __attribute__ ((packed));
651
652
#define BT_HCI_CMD_READ_INQUIRY_SCAN_ACTIVITY 0x0c1d
653
struct bt_hci_rsp_read_inquiry_scan_activity {
654
uint8_t status;
655
uint16_t interval;
656
uint16_t window;
657
} __attribute__ ((packed));
658
659
#define BT_HCI_CMD_WRITE_INQUIRY_SCAN_ACTIVITY 0x0c1e
660
struct bt_hci_cmd_write_inquiry_scan_activity {
661
uint16_t interval;
662
uint16_t window;
663
} __attribute__ ((packed));
664
665
#define BT_HCI_CMD_READ_AUTH_ENABLE 0x0c1f
666
struct bt_hci_rsp_read_auth_enable {
667
uint8_t status;
668
uint8_t enable;
669
} __attribute__ ((packed));
670
671
#define BT_HCI_CMD_WRITE_AUTH_ENABLE 0x0c20
672
struct bt_hci_cmd_write_auth_enable {
673
uint8_t enable;
674
} __attribute__ ((packed));
675
676
#define BT_HCI_CMD_READ_ENCRYPT_MODE 0x0c21
677
struct bt_hci_rsp_read_encrypt_mode {
678
uint8_t status;
679
uint8_t mode;
680
} __attribute__ ((packed));
681
682
#define BT_HCI_CMD_WRITE_ENCRYPT_MODE 0x0c22
683
struct bt_hci_cmd_write_encrypt_mode {
684
uint8_t mode;
685
} __attribute__ ((packed));
686
687
#define BT_HCI_CMD_READ_CLASS_OF_DEV 0x0c23
688
struct bt_hci_rsp_read_class_of_dev {
689
uint8_t status;
690
uint8_t dev_class[3];
691
} __attribute__ ((packed));
692
693
#define BT_HCI_CMD_WRITE_CLASS_OF_DEV 0x0c24
694
struct bt_hci_cmd_write_class_of_dev {
695
uint8_t dev_class[3];
696
} __attribute__ ((packed));
697
698
#define BT_HCI_CMD_READ_VOICE_SETTING 0x0c25
699
struct bt_hci_rsp_read_voice_setting {
700
uint8_t status;
701
uint16_t setting;
702
} __attribute__ ((packed));
703
704
#define BT_HCI_CMD_WRITE_VOICE_SETTING 0x0c26
705
struct bt_hci_cmd_write_voice_setting {
706
uint16_t setting;
707
} __attribute__ ((packed));
708
709
#define BT_HCI_CMD_HOST_BUFFER_SIZE 0x0c33
710
struct bt_hci_cmd_host_buffer_size {
711
uint16_t acl_mtu;
712
uint8_t sco_mtu;
713
uint16_t acl_max_pkt;
714
uint16_t sco_max_pkt;
715
} __attribute__ ((packed));
716
717
#define BT_HCI_CMD_READ_LINK_SUPV_TIMEOUT 0x0c36
718
struct bt_hci_cmd_read_link_supv_timeout {
719
uint16_t handle;
720
} __attribute__ ((packed));
721
struct bt_hci_rsp_read_link_supv_timeout {
722
uint8_t status;
723
uint16_t handle;
724
uint16_t timeout;
725
} __attribute__ ((packed));
726
727
#define BT_HCI_CMD_WRITE_LINK_SUPV_TIMEOUT 0x0c37
728
struct bt_hci_cmd_write_link_supv_timeout {
729
uint16_t handle;
730
uint16_t timeout;
731
} __attribute__ ((packed));
732
struct bt_hci_rsp_write_link_supv_timeout {
733
uint8_t status;
734
uint16_t handle;
735
} __attribute__ ((packed));
736
737
#define BT_HCI_CMD_READ_NUM_SUPPORTED_IAC 0x0c38
738
struct bt_hci_rsp_read_num_supported_iac {
739
uint8_t status;
740
uint8_t num_iac;
741
} __attribute__ ((packed));
742
743
#define BT_HCI_CMD_READ_CURRENT_IAC_LAP 0x0c39
744
struct bt_hci_rsp_read_current_iac_lap {
745
uint8_t status;
746
uint8_t num_iac;
747
uint8_t iac_lap[0];
748
} __attribute__ ((packed));
749
750
#define BT_HCI_CMD_WRITE_CURRENT_IAC_LAP 0x0c3a
751
struct bt_hci_cmd_write_current_iac_lap {
752
uint8_t num_iac;
753
uint8_t iac_lap[0];
754
} __attribute__ ((packed));
755
756
#define BT_HCI_CMD_READ_PAGE_SCAN_PERIOD_MODE 0x0c3b
757
struct bt_hci_rsp_read_page_scan_period_mode {
758
uint8_t status;
759
uint8_t mode;
760
} __attribute__ ((packed));
761
762
#define BT_HCI_CMD_WRITE_PAGE_SCAN_PERIOD_MODE 0x0c3c
763
struct bt_hci_cmd_write_page_scan_period_mode {
764
uint8_t mode;
765
} __attribute__ ((packed));
766
767
#define BT_HCI_CMD_READ_PAGE_SCAN_MODE 0x0c3d
768
struct bt_hci_rsp_read_page_scan_mode {
769
uint8_t status;
770
uint8_t mode;
771
} __attribute__ ((packed));
772
773
#define BT_HCI_CMD_WRITE_PAGE_SCAN_MODE 0x0c3e
774
struct bt_hci_cmd_write_page_scan_mode {
775
uint8_t mode;
776
} __attribute__ ((packed));
777
778
#define BT_HCI_CMD_SET_AFH_HOST_CLASSIFICATION 0x0c3f
779
struct bt_hci_cmd_set_afh_host_classification {
780
uint8_t map[10];
781
} __attribute__ ((packed));
782
783
#define BT_HCI_CMD_READ_INQUIRY_SCAN_TYPE 0x0c42
784
struct bt_hci_rsp_read_inquiry_scan_type {
785
uint8_t status;
786
uint8_t type;
787
} __attribute__ ((packed));
788
789
#define BT_HCI_CMD_WRITE_INQUIRY_SCAN_TYPE 0x0c43
790
struct bt_hci_cmd_write_inquiry_scan_type {
791
uint8_t type;
792
} __attribute__ ((packed));
793
794
#define BT_HCI_CMD_READ_INQUIRY_MODE 0x0c44
795
struct bt_hci_rsp_read_inquiry_mode {
796
uint8_t status;
797
uint8_t mode;
798
} __attribute__ ((packed));
799
800
#define BT_HCI_CMD_WRITE_INQUIRY_MODE 0x0c45
801
struct bt_hci_cmd_write_inquiry_mode {
802
uint8_t mode;
803
} __attribute__ ((packed));
804
805
#define BT_HCI_CMD_READ_PAGE_SCAN_TYPE 0x0c46
806
struct bt_hci_rsp_read_page_scan_type {
807
uint8_t status;
808
uint8_t type;
809
} __attribute__ ((packed));
810
811
#define BT_HCI_CMD_WRITE_PAGE_SCAN_TYPE 0x0c47
812
struct bt_hci_cmd_write_page_scan_type {
813
uint8_t type;
814
} __attribute__ ((packed));
815
816
#define BT_HCI_CMD_READ_AFH_ASSESSMENT_MODE 0x0c48
817
struct bt_hci_rsp_read_afh_assessment_mode {
818
uint8_t status;
819
uint8_t mode;
820
} __attribute__ ((packed));
821
822
#define BT_HCI_CMD_WRITE_AFH_ASSESSMENT_MODE 0x0c49
823
struct bt_hci_cmd_write_afh_assessment_mode {
824
uint8_t mode;
825
} __attribute__ ((packed));
826
827
#define BT_HCI_CMD_READ_EXT_INQUIRY_RESPONSE 0x0c51
828
struct bt_hci_rsp_read_ext_inquiry_response {
829
uint8_t status;
830
uint8_t fec;
831
uint8_t data[240];
832
} __attribute__ ((packed));
833
834
#define BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE 0x0c52
835
struct bt_hci_cmd_write_ext_inquiry_response {
836
uint8_t fec;
837
uint8_t data[240];
838
} __attribute__ ((packed));
839
840
#define BT_HCI_CMD_REFRESH_ENCRYPT_KEY 0x0c53
841
struct bt_hci_cmd_refresh_encrypt_key {
842
uint16_t handle;
843
} __attribute__ ((packed));
844
845
#define BT_HCI_CMD_READ_SIMPLE_PAIRING_MODE 0x0c55
846
struct bt_hci_rsp_read_simple_pairing_mode {
847
uint8_t status;
848
uint8_t mode;
849
} __attribute__ ((packed));
850
851
#define BT_HCI_CMD_WRITE_SIMPLE_PAIRING_MODE 0x0c56
852
struct bt_hci_cmd_write_simple_pairing_mode {
853
uint8_t mode;
854
} __attribute__ ((packed));
855
856
#define BT_HCI_CMD_READ_LOCAL_OOB_DATA 0x0c57
857
struct bt_hci_rsp_read_local_oob_data {
858
uint8_t status;
859
uint8_t hash[16];
860
uint8_t randomizer[16];
861
} __attribute__ ((packed));
862
863
#define BT_HCI_CMD_READ_INQUIRY_RESP_TX_POWER 0x0c58
864
struct bt_hci_rsp_read_inquiry_resp_tx_power {
865
uint8_t status;
866
int8_t level;
867
} __attribute__ ((packed));
868
869
#define BT_HCI_CMD_WRITE_INQUIRY_TX_POWER 0x0c59
870
struct bt_hci_cmd_write_inquiry_tx_power {
871
int8_t level;
872
} __attribute__ ((packed));
873
874
#define BT_HCI_CMD_ENHANCED_FLUSH 0x0c5f
875
struct bt_hci_cmd_enhanced_flush {
876
uint16_t handle;
877
uint8_t type;
878
} __attribute__ ((packed));
879
880
#define BT_HCI_CMD_SET_EVENT_MASK_PAGE2 0x0c63
881
struct bt_hci_cmd_set_event_mask_page2 {
882
uint8_t mask[8];
883
} __attribute__ ((packed));
884
885
#define BT_HCI_CMD_READ_LOCATION_DATA 0x0c64
886
struct bt_hci_rsp_read_location_data {
887
uint8_t status;
888
uint8_t domain_aware;
889
uint8_t domain[2];
890
uint8_t domain_options;
891
uint8_t options;
892
} __attribute__ ((packed));
893
894
#define BT_HCI_CMD_WRITE_LOCATION_DATA 0x0c65
895
struct bt_hci_cmd_write_location_data {
896
uint8_t domain_aware;
897
uint8_t domain[2];
898
uint8_t domain_options;
899
uint8_t options;
900
} __attribute__ ((packed));
901
902
#define BT_HCI_CMD_READ_FLOW_CONTROL_MODE 0x0c66
903
struct bt_hci_rsp_read_flow_control_mode {
904
uint8_t status;
905
uint8_t mode;
906
} __attribute__ ((packed));
907
908
#define BT_HCI_CMD_WRITE_FLOW_CONTROL_MODE 0x0c67
909
struct bt_hci_cmd_write_flow_control_mode {
910
uint8_t mode;
911
} __attribute__ ((packed));
912
913
#define BT_HCI_CMD_READ_LE_HOST_SUPPORTED 0x0c6c
914
struct bt_hci_rsp_read_le_host_supported {
915
uint8_t status;
916
uint8_t supported;
917
uint8_t simultaneous;
918
} __attribute__ ((packed));
919
920
#define BT_HCI_CMD_WRITE_LE_HOST_SUPPORTED 0x0c6d
921
struct bt_hci_cmd_write_le_host_supported {
922
uint8_t supported;
923
uint8_t simultaneous;
924
} __attribute__ ((packed));
925
926
#define BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS 0x0c77
927
struct bt_hci_rsp_read_sync_train_params {
928
uint8_t status;
929
uint16_t interval;
930
uint32_t timeout;
931
uint8_t service_data;
932
} __attribute__ ((packed));
933
934
#define BT_HCI_CMD_READ_LOCAL_VERSION 0x1001
935
struct bt_hci_rsp_read_local_version {
936
uint8_t status;
937
uint8_t hci_ver;
938
uint16_t hci_rev;
939
uint8_t lmp_ver;
940
uint16_t manufacturer;
941
uint16_t lmp_subver;
942
} __attribute__ ((packed));
943
944
#define BT_HCI_CMD_READ_LOCAL_COMMANDS 0x1002
945
struct bt_hci_rsp_read_local_commands {
946
uint8_t status;
947
uint8_t commands[64];
948
} __attribute__ ((packed));
949
950
#define BT_HCI_CMD_READ_LOCAL_FEATURES 0x1003
951
struct bt_hci_rsp_read_local_features {
952
uint8_t status;
953
uint8_t features[8];
954
} __attribute__ ((packed));
955
956
#define BT_HCI_CMD_READ_LOCAL_EXT_FEATURES 0x1004
957
struct bt_hci_cmd_read_local_ext_features {
958
uint8_t page;
959
} __attribute__ ((packed));
960
struct bt_hci_rsp_read_local_ext_features {
961
uint8_t status;
962
uint8_t page;
963
uint8_t max_page;
964
uint8_t features[8];
965
} __attribute__ ((packed));
966
967
#define BT_HCI_CMD_READ_BUFFER_SIZE 0x1005
968
struct bt_hci_rsp_read_buffer_size {
969
uint8_t status;
970
uint16_t acl_mtu;
971
uint8_t sco_mtu;
972
uint16_t acl_max_pkt;
973
uint16_t sco_max_pkt;
974
} __attribute__ ((packed));
975
976
#define BT_HCI_CMD_READ_COUNTRY_CODE 0x1007
977
struct bt_hci_rsp_read_country_code {
978
uint8_t status;
979
uint8_t code;
980
} __attribute__ ((packed));
981
982
#define BT_HCI_CMD_READ_BD_ADDR 0x1009
983
struct bt_hci_rsp_read_bd_addr {
984
uint8_t status;
985
uint8_t bdaddr[6];
986
} __attribute__ ((packed));
987
988
#define BT_HCI_CMD_READ_DATA_BLOCK_SIZE 0x100a
989
struct bt_hci_rsp_read_data_block_size {
990
uint8_t status;
991
uint16_t max_acl_len;
992
uint16_t block_len;
993
uint16_t num_blocks;
994
} __attribute__ ((packed));
995
996
#define BT_HCI_CMD_READ_FAILED_CONTACT_COUNTER 0x1401
997
struct bt_hci_cmd_read_failed_contact_counter {
998
uint16_t handle;
999
} __attribute__ ((packed));
1000
struct bt_hci_rsp_read_failed_contact_counter {
1001
uint8_t status;
1002
uint16_t handle;
1003
uint16_t counter;
1004
} __attribute__ ((packed));
1005
1006
#define BT_HCI_CMD_RESET_FAILED_CONTACT_COUNTER 0x1402
1007
struct bt_hci_cmd_reset_failed_contact_counter {
1008
uint16_t handle;
1009
} __attribute__ ((packed));
1010
struct bt_hci_rsp_reset_failed_contact_counter {
1011
uint8_t status;
1012
uint16_t handle;
1013
} __attribute__ ((packed));
1014
1015
#define BT_HCI_CMD_READ_LINK_QUALITY 0x1403
1016
struct bt_hci_cmd_read_link_quality {
1017
uint16_t handle;
1018
} __attribute__ ((packed));
1019
struct bt_hci_rsp_read_link_quality {
1020
uint8_t status;
1021
uint16_t handle;
1022
uint8_t link_quality;
1023
} __attribute__ ((packed));
1024
1025
#define BT_HCI_CMD_READ_RSSI 0x1405
1026
struct bt_hci_cmd_read_rssi {
1027
uint16_t handle;
1028
} __attribute__ ((packed));
1029
struct bt_hci_rsp_read_rssi {
1030
uint8_t status;
1031
uint16_t handle;
1032
int8_t rssi;
1033
} __attribute__ ((packed));
1034
1035
#define BT_HCI_CMD_READ_AFH_CHANNEL_MAP 0x1406
1036
struct bt_hci_cmd_read_afh_channel_map {
1037
uint16_t handle;
1038
} __attribute__ ((packed));
1039
struct bt_hci_rsp_read_afh_channel_map {
1040
uint8_t status;
1041
uint16_t handle;
1042
uint8_t mode;
1043
uint8_t map[10];
1044
} __attribute__ ((packed));
1045
1046
#define BT_HCI_CMD_READ_CLOCK 0x1407
1047
struct bt_hci_cmd_read_clock {
1048
uint16_t handle;
1049
uint8_t type;
1050
} __attribute__ ((packed));
1051
struct bt_hci_rsp_read_clock {
1052
uint8_t status;
1053
uint16_t handle;
1054
uint32_t clock;
1055
uint16_t accuracy;
1056
} __attribute__ ((packed));
1057
1058
#define BT_HCI_CMD_READ_ENCRYPT_KEY_SIZE 0x1408
1059
struct bt_hci_cmd_read_encrypt_key_size {
1060
uint16_t handle;
1061
} __attribute__ ((packed));
1062
struct bt_hci_rsp_read_encrypt_key_size {
1063
uint8_t status;
1064
uint16_t handle;
1065
uint8_t key_size;
1066
} __attribute__ ((packed));
1067
1068
#define BT_HCI_CMD_READ_LOCAL_AMP_INFO 0x1409
1069
struct bt_hci_rsp_read_local_amp_info {
1070
uint8_t status;
1071
uint8_t amp_status;
1072
uint32_t total_bw;
1073
uint32_t max_bw;
1074
uint32_t min_latency;
1075
uint32_t max_pdu;
1076
uint8_t amp_type;
1077
uint16_t pal_cap;
1078
uint16_t max_assoc_len;
1079
uint32_t max_flush_to;
1080
uint32_t be_flush_to;
1081
} __attribute__ ((packed));
1082
1083
#define BT_HCI_CMD_READ_LOCAL_AMP_ASSOC 0x140a
1084
struct bt_hci_cmd_read_local_amp_assoc {
1085
uint8_t phy_handle;
1086
uint16_t len_so_far;
1087
uint16_t max_assoc_len;
1088
} __attribute__ ((packed));
1089
struct bt_hci_rsp_read_local_amp_assoc {
1090
uint8_t status;
1091
uint8_t phy_handle;
1092
uint16_t remain_assoc_len;
1093
uint8_t assoc_fragment[248];
1094
} __attribute__ ((packed));
1095
1096
#define BT_HCI_CMD_WRITE_REMOTE_AMP_ASSOC 0x140b
1097
struct bt_hci_cmd_write_remote_amp_assoc {
1098
uint8_t phy_handle;
1099
uint16_t len_so_far;
1100
uint16_t remain_assoc_len;
1101
uint8_t assoc_fragment[248];
1102
} __attribute__ ((packed));
1103
struct bt_hci_rsp_write_remote_amp_assoc {
1104
uint8_t status;
1105
uint8_t phy_handle;
1106
} __attribute__ ((packed));
1107
1108
#define BT_HCI_CMD_ENABLE_DUT_MODE 0x1803
1109
1110
#define BT_HCI_CMD_LE_SET_EVENT_MASK 0x2001
1111
struct bt_hci_cmd_le_set_event_mask {
1112
uint8_t mask[8];
1113
} __attribute__ ((packed));
1114
1115
#define BT_HCI_CMD_LE_READ_BUFFER_SIZE 0x2002
1116
struct bt_hci_rsp_le_read_buffer_size {
1117
uint8_t status;
1118
uint16_t le_mtu;
1119
uint8_t le_max_pkt;
1120
} __attribute__ ((packed));
1121
1122
#define BT_HCI_CMD_LE_READ_LOCAL_FEATURES 0x2003
1123
struct bt_hci_rsp_le_read_local_features {
1124
uint8_t status;
1125
uint8_t features[8];
1126
} __attribute__ ((packed));
1127
1128
#define BT_HCI_CMD_LE_SET_RANDOM_ADDRESS 0x2005
1129
struct bt_hci_cmd_le_set_random_address {
1130
uint8_t addr[6];
1131
} __attribute__ ((packed));
1132
1133
#define BT_HCI_CMD_LE_SET_ADV_PARAMETERS 0x2006
1134
struct bt_hci_cmd_le_set_adv_parameters {
1135
uint16_t min_interval;
1136
uint16_t max_interval;
1137
uint8_t type;
1138
uint8_t own_addr_type;
1139
uint8_t direct_addr_type;
1140
uint8_t direct_addr[6];
1141
uint8_t channel_map;
1142
uint8_t filter_policy;
1143
} __attribute__ ((packed));
1144
1145
#define BT_HCI_CMD_LE_READ_ADV_TX_POWER 0x2007
1146
struct bt_hci_rsp_le_read_adv_tx_power {
1147
uint8_t status;
1148
int8_t level;
1149
} __attribute__ ((packed));
1150
1151
#define BT_HCI_CMD_LE_SET_ADV_DATA 0x2008
1152
struct bt_hci_cmd_le_set_adv_data {
1153
uint8_t len;
1154
uint8_t data[31];
1155
} __attribute__ ((packed));
1156
1157
#define BT_HCI_CMD_LE_SET_SCAN_RSP_DATA 0x2009
1158
struct bt_hci_cmd_le_set_scan_rsp_data {
1159
uint8_t len;
1160
uint8_t data[31];
1161
} __attribute__ ((packed));
1162
1163
#define BT_HCI_CMD_LE_SET_ADV_ENABLE 0x200a
1164
struct bt_hci_cmd_le_set_adv_enable {
1165
uint8_t enable;
1166
} __attribute__ ((packed));
1167
1168
#define BT_HCI_CMD_LE_SET_SCAN_PARAMETERS 0x200b
1169
struct bt_hci_cmd_le_set_scan_parameters {
1170
uint8_t type;
1171
uint16_t interval;
1172
uint16_t window;
1173
uint8_t own_addr_type;
1174
uint8_t filter_policy;
1175
} __attribute__ ((packed));
1176
1177
#define BT_HCI_CMD_LE_SET_SCAN_ENABLE 0x200c
1178
struct bt_hci_cmd_le_set_scan_enable {
1179
uint8_t enable;
1180
uint8_t filter_dup;
1181
} __attribute__ ((packed));
1182
1183
#define BT_HCI_CMD_LE_CREATE_CONN 0x200d
1184
struct bt_hci_cmd_le_create_conn {
1185
uint16_t scan_interval;
1186
uint16_t scan_window;
1187
uint8_t filter_policy;
1188
uint8_t peer_addr_type;
1189
uint8_t peer_addr[6];
1190
uint8_t own_addr_type;
1191
uint16_t min_interval;
1192
uint16_t max_interval;
1193
uint16_t latency;
1194
uint16_t supv_timeout;
1195
uint16_t min_length;
1196
uint16_t max_length;
1197
} __attribute__ ((packed));
1198
1199
#define BT_HCI_CMD_LE_CREATE_CONN_CANCEL 0x200e
1200
1201
#define BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE 0x200f
1202
struct bt_hci_rsp_le_read_white_list_size {
1203
uint8_t status;
1204
uint8_t size;
1205
} __attribute__ ((packed));
1206
1207
#define BT_HCI_CMD_LE_CLEAR_WHITE_LIST 0x2010
1208
1209
#define BT_HCI_CMD_LE_ADD_TO_WHITE_LIST 0x2011
1210
struct bt_hci_cmd_le_add_to_white_list {
1211
uint8_t addr_type;
1212
uint8_t addr[6];
1213
} __attribute__ ((packed));
1214
1215
#define BT_HCI_CMD_LE_REMOVE_FROM_WHITE_LIST 0x2012
1216
struct bt_hci_cmd_le_remove_from_white_list {
1217
uint8_t addr_type;
1218
uint8_t addr[6];
1219
} __attribute__ ((packed));
1220
1221
#define BT_HCI_CMD_LE_CONN_UPDATE 0x2013
1222
struct bt_hci_cmd_le_conn_update {
1223
uint16_t handle;
1224
uint16_t min_interval;
1225
uint16_t max_interval;
1226
uint16_t latency;
1227
uint16_t supv_timeout;
1228
uint16_t min_length;
1229
uint16_t max_length;
1230
} __attribute__ ((packed));
1231
1232
#define BT_HCI_CMD_LE_SET_HOST_CLASSIFICATION 0x2014
1233
struct bt_hci_cmd_le_set_host_classification {
1234
uint8_t map[5];
1235
} __attribute__ ((packed));
1236
1237
#define BT_HCI_CMD_LE_READ_CHANNEL_MAP 0x2015
1238
struct bt_hci_cmd_le_read_channel_map {
1239
uint16_t handle;
1240
} __attribute__ ((packed));
1241
struct bt_hci_rsp_le_read_channel_map {
1242
uint8_t status;
1243
uint16_t handle;
1244
uint8_t map[5];
1245
} __attribute__ ((packed));
1246
1247
#define BT_HCI_CMD_LE_READ_REMOTE_FEATURES 0x2016
1248
struct bt_hci_cmd_le_read_remote_features {
1249
uint16_t handle;
1250
} __attribute__ ((packed));
1251
1252
#define BT_HCI_CMD_LE_ENCRYPT 0x2017
1253
struct bt_hci_cmd_le_encrypt {
1254
uint8_t key[16];
1255
uint8_t plaintext[16];
1256
} __attribute__ ((packed));
1257
struct bt_hci_rsp_le_encrypt {
1258
uint8_t status;
1259
uint8_t data[16];
1260
} __attribute__ ((packed));
1261
1262
#define BT_HCI_CMD_LE_RAND 0x2018
1263
struct bt_hci_rsp_le_rand {
1264
uint8_t status;
1265
uint8_t number[8];
1266
} __attribute__ ((packed));
1267
1268
#define BT_HCI_CMD_LE_START_ENCRYPT 0x2019
1269
struct bt_hci_cmd_le_start_encrypt {
1270
uint16_t handle;
1271
uint8_t number[8];
1272
uint16_t diversifier;
1273
uint8_t ltk[16];
1274
} __attribute__ ((packed));
1275
1276
#define BT_HCI_CMD_LE_LTK_REQ_REPLY 0x201a
1277
struct bt_hci_cmd_le_ltk_req_reply {
1278
uint16_t handle;
1279
uint8_t ltk[16];
1280
} __attribute__ ((packed));
1281
struct bt_hci_rsp_le_ltk_req_reply {
1282
uint8_t status;
1283
uint16_t handle;
1284
} __attribute__ ((packed));
1285
1286
#define BT_HCI_CMD_LE_LTK_REQ_NEG_REPLY 0x201b
1287
struct bt_hci_cmd_le_ltk_req_neg_reply {
1288
uint16_t handle;
1289
} __attribute__ ((packed));
1290
struct bt_hci_rsp_le_ltk_req_neg_reply {
1291
uint8_t status;
1292
uint16_t handle;
1293
} __attribute__ ((packed));
1294
1295
#define BT_HCI_CMD_LE_READ_SUPPORTED_STATES 0x201c
1296
struct bt_hci_rsp_le_read_supported_states {
1297
uint8_t status;
1298
uint8_t states[8];
1299
} __attribute__ ((packed));
1300
1301
#define BT_HCI_CMD_LE_RECEIVER_TEST 0x201d
1302
struct bt_hci_cmd_le_receiver_test {
1303
uint8_t frequency;
1304
} __attribute__ ((packed));
1305
1306
#define BT_HCI_CMD_LE_TRANSMITTER_TEST 0x201e
1307
struct bt_hci_cmd_le_transmitter_test {
1308
uint8_t frequency;
1309
uint8_t data_len;
1310
uint8_t payload;
1311
} __attribute__ ((packed));
1312
1313
#define BT_HCI_CMD_LE_TEST_END 0x201f
1314
struct bt_hci_rsp_le_test_end {
1315
uint8_t status;
1316
uint16_t num_packets;
1317
} __attribute__ ((packed));
1318
1319
#define BT_HCI_EVT_INQUIRY_COMPLETE 0x01
1320
struct bt_hci_evt_inquiry_complete {
1321
uint8_t status;
1322
} __attribute__ ((packed));
1323
1324
#define BT_HCI_EVT_INQUIRY_RESULT 0x02
1325
struct bt_hci_evt_inquiry_result {
1326
uint8_t num_resp;
1327
uint8_t bdaddr[6];
1328
uint8_t pscan_rep_mode;
1329
uint8_t pscan_period_mode;
1330
uint8_t pscan_mode;
1331
uint8_t dev_class[3];
1332
uint16_t clock_offset;
1333
} __attribute__ ((packed));
1334
1335
#define BT_HCI_EVT_CONN_COMPLETE 0x03
1336
struct bt_hci_evt_conn_complete {
1337
uint8_t status;
1338
uint16_t handle;
1339
uint8_t bdaddr[6];
1340
uint8_t link_type;
1341
uint8_t encr_mode;
1342
} __attribute__ ((packed));
1343
1344
#define BT_HCI_EVT_CONN_REQUEST 0x04
1345
struct bt_hci_evt_conn_request {
1346
uint8_t bdaddr[6];
1347
uint8_t dev_class[3];
1348
uint8_t link_type;
1349
} __attribute__ ((packed));
1350
1351
#define BT_HCI_EVT_DISCONNECT_COMPLETE 0x05
1352
struct bt_hci_evt_disconnect_complete {
1353
uint8_t status;
1354
uint16_t handle;
1355
uint8_t reason;
1356
} __attribute__ ((packed));
1357
1358
#define BT_HCI_EVT_AUTH_COMPLETE 0x06
1359
struct bt_hci_evt_auth_complete {
1360
uint8_t status;
1361
uint16_t handle;
1362
} __attribute__ ((packed));
1363
1364
#define BT_HCI_EVT_REMOTE_NAME_REQUEST_COMPLETE 0x07
1365
struct bt_hci_evt_remote_name_request_complete {
1366
uint8_t status;
1367
uint8_t bdaddr[6];
1368
uint8_t name[248];
1369
} __attribute__ ((packed));
1370
1371
#define BT_HCI_EVT_ENCRYPT_CHANGE 0x08
1372
struct bt_hci_evt_encrypt_change {
1373
uint8_t status;
1374
uint16_t handle;
1375
uint8_t encr_mode;
1376
} __attribute__ ((packed));
1377
1378
#define BT_HCI_EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
1379
struct bt_hci_evt_change_conn_link_key_complete {
1380
uint8_t status;
1381
uint16_t handle;
1382
} __attribute__ ((packed));
1383
1384
#define BT_HCI_EVT_MASTER_LINK_KEY_COMPLETE 0x0a
1385
struct bt_hci_evt_master_link_key_complete {
1386
uint8_t status;
1387
uint16_t handle;
1388
uint8_t key_flag;
1389
} __attribute__ ((packed));
1390
1391
#define BT_HCI_EVT_REMOTE_FEATURES_COMPLETE 0x0b
1392
struct bt_hci_evt_remote_features_complete {
1393
uint8_t status;
1394
uint16_t handle;
1395
uint8_t features[8];
1396
} __attribute__ ((packed));
1397
1398
#define BT_HCI_EVT_REMOTE_VERSION_COMPLETE 0x0c
1399
struct bt_hci_evt_remote_version_complete {
1400
uint8_t status;
1401
uint16_t handle;
1402
uint8_t lmp_ver;
1403
uint16_t manufacturer;
1404
uint16_t lmp_subver;
1405
} __attribute__ ((packed));
1406
1407
#define BT_HCI_EVT_QOS_SETUP_COMPLETE 0x0d
1408
struct bt_hci_evt_qos_setup_complete {
1409
uint8_t status;
1410
uint16_t handle;
1411
uint8_t flags;
1412
uint8_t service_type;
1413
uint32_t token_rate;
1414
uint32_t peak_bandwidth;
1415
uint32_t latency;
1416
uint32_t delay_variation;
1417
} __attribute__ ((packed));
1418
1419
#define BT_HCI_EVT_CMD_COMPLETE 0x0e
1420
struct bt_hci_evt_cmd_complete {
1421
uint8_t ncmd;
1422
uint16_t opcode;
1423
} __attribute__ ((packed));
1424
1425
#define BT_HCI_EVT_CMD_STATUS 0x0f
1426
struct bt_hci_evt_cmd_status {
1427
uint8_t status;
1428
uint8_t ncmd;
1429
uint16_t opcode;
1430
} __attribute__ ((packed));
1431
1432
#define BT_HCI_EVT_HARDWARE_ERROR 0x10
1433
struct bt_hci_evt_hardware_error {
1434
uint8_t code;
1435
} __attribute__ ((packed));
1436
1437
#define BT_HCI_EVT_FLUSH_OCCURRED 0x11
1438
struct bt_hci_evt_flush_occurred {
1439
uint16_t handle;
1440
} __attribute__ ((packed));
1441
1442
#define BT_HCI_EVT_ROLE_CHANGE 0x12
1443
struct bt_hci_evt_role_change {
1444
uint8_t status;
1445
uint8_t bdaddr[6];
1446
uint8_t role;
1447
} __attribute__ ((packed));
1448
1449
#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13
1450
struct bt_hci_evt_num_completed_packets {
1451
uint8_t num_handles;
1452
uint16_t handle;
1453
uint16_t count;
1454
} __attribute__ ((packed));
1455
1456
#define BT_HCI_EVT_MODE_CHANGE 0x14
1457
struct bt_hci_evt_mode_change {
1458
uint8_t status;
1459
uint16_t handle;
1460
uint8_t mode;
1461
uint16_t interval;
1462
} __attribute__ ((packed));
1463
1464
#define BT_HCI_EVT_RETURN_LINK_KEYS 0x15
1465
1466
#define BT_HCI_EVT_PIN_CODE_REQUEST 0x16
1467
struct bt_hci_evt_pin_code_request {
1468
uint8_t bdaddr[6];
1469
} __attribute__ ((packed));
1470
1471
#define BT_HCI_EVT_LINK_KEY_REQUEST 0x17
1472
struct bt_hci_evt_link_key_request {
1473
uint8_t bdaddr[6];
1474
} __attribute__ ((packed));
1475
1476
#define BT_HCI_EVT_LINK_KEY_NOTIFY 0x18
1477
struct bt_hci_evt_link_key_notify {
1478
uint8_t bdaddr[6];
1479
uint8_t link_key[16];
1480
uint8_t key_type;
1481
} __attribute__ ((packed));
1482
1483
#define BT_HCI_EVT_LOOPBACK_COMMAND 0x19
1484
1485
#define BT_HCI_EVT_DATA_BUFFER_OVERFLOW 0x1a
1486
struct bt_hci_evt_data_buffer_overflow {
1487
uint8_t link_type;
1488
} __attribute__ ((packed));
1489
1490
#define BT_HCI_EVT_MAX_SLOTS_CHANGE 0x1b
1491
struct bt_hci_evt_max_slots_change {
1492
uint16_t handle;
1493
uint8_t max_slots;
1494
} __attribute__ ((packed));
1495
1496
#define BT_HCI_EVT_CLOCK_OFFSET_COMPLETE 0x1c
1497
struct bt_hci_evt_clock_offset_complete {
1498
uint8_t status;
1499
uint16_t handle;
1500
uint16_t clock_offset;
1501
} __attribute__ ((packed));
1502
1503
#define BT_HCI_EVT_CONN_PKT_TYPE_CHANGED 0x1d
1504
struct bt_hci_evt_conn_pkt_type_changed {
1505
uint8_t status;
1506
uint16_t handle;
1507
uint16_t pkt_type;
1508
} __attribute__ ((packed));
1509
1510
#define BT_HCI_EVT_QOS_VIOLATION 0x1e
1511
struct bt_hci_evt_qos_violation {
1512
uint16_t handle;
1513
} __attribute__ ((packed));
1514
1515
#define BT_HCI_EVT_PSCAN_MODE_CHANGE 0x1f
1516
struct bt_hci_evt_pscan_mode_change {
1517
uint8_t bdaddr[6];
1518
uint8_t pscan_mode;
1519
} __attribute__ ((packed));
1520
1521
#define BT_HCI_EVT_PSCAN_REP_MODE_CHANGE 0x20
1522
struct bt_hci_evt_pscan_rep_mode_change {
1523
uint8_t bdaddr[6];
1524
uint8_t pscan_rep_mode;
1525
} __attribute__ ((packed));
1526
1527
#define BT_HCI_EVT_FLOW_SPEC_COMPLETE 0x21
1528
struct bt_hci_evt_flow_spec_complete {
1529
uint8_t status;
1530
uint16_t handle;
1531
uint8_t flags;
1532
uint8_t direction;
1533
uint8_t service_type;
1534
uint32_t token_rate;
1535
uint32_t token_bucket_size;
1536
uint32_t peak_bandwidth;
1537
uint32_t access_latency;
1538
} __attribute__ ((packed));
1539
1540
#define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI 0x22
1541
struct bt_hci_evt_inquiry_result_with_rssi {
1542
uint8_t num_resp;
1543
uint8_t bdaddr[6];
1544
uint8_t pscan_rep_mode;
1545
uint8_t pscan_period_mode;
1546
uint8_t dev_class[3];
1547
uint16_t clock_offset;
1548
int8_t rssi;
1549
} __attribute__ ((packed));
1550
1551
#define BT_HCI_EVT_REMOTE_EXT_FEATURES_COMPLETE 0x23
1552
struct bt_hci_evt_remote_ext_features_complete {
1553
uint8_t status;
1554
uint16_t handle;
1555
uint8_t page;
1556
uint8_t max_page;
1557
uint8_t features[8];
1558
} __attribute__ ((packed));
1559
1560
#define BT_HCI_EVT_SYNC_CONN_COMPLETE 0x2c
1561
struct bt_hci_evt_sync_conn_complete {
1562
uint8_t status;
1563
uint16_t handle;
1564
uint8_t bdaddr[6];
1565
uint8_t link_type;
1566
uint8_t tx_interval;
1567
uint8_t retrans_window;
1568
uint16_t rx_pkt_len;
1569
uint16_t tx_pkt_len;
1570
uint8_t air_mode;
1571
} __attribute__ ((packed));
1572
1573
#define BT_HCI_EVT_SYNC_CONN_CHANGED 0x2d
1574
struct bt_hci_evt_sync_conn_changed {
1575
uint8_t status;
1576
uint16_t handle;
1577
uint8_t tx_interval;
1578
uint8_t retrans_window;
1579
uint16_t rx_pkt_len;
1580
uint16_t tx_pkt_len;
1581
} __attribute__ ((packed));
1582
1583
#define BT_HCI_EVT_SNIFF_SUBRATING 0x2e
1584
struct bt_hci_evt_sniff_subrating {
1585
uint8_t status;
1586
uint16_t handle;
1587
uint16_t max_tx_latency;
1588
uint16_t max_rx_latency;
1589
uint16_t min_remote_timeout;
1590
uint16_t min_local_timeout;
1591
} __attribute__ ((packed));
1592
1593
#define BT_HCI_EVT_EXT_INQUIRY_RESULT 0x2f
1594
struct bt_hci_evt_ext_inquiry_result {
1595
uint8_t num_resp;
1596
uint8_t bdaddr[6];
1597
uint8_t pscan_rep_mode;
1598
uint8_t pscan_period_mode;
1599
uint8_t dev_class[3];
1600
uint16_t clock_offset;
1601
int8_t rssi;
1602
uint8_t data[240];
1603
} __attribute__ ((packed));
1604
1605
#define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30
1606
struct bt_hci_evt_encrypt_key_refresh_complete {
1607
uint8_t status;
1608
uint16_t handle;
1609
} __attribute__ ((packed));
1610
1611
#define BT_HCI_EVT_IO_CAPABILITY_REQUEST 0x31
1612
struct bt_hci_evt_io_capability_request {
1613
uint8_t bdaddr[6];
1614
} __attribute__ ((packed));
1615
1616
#define BT_HCI_EVT_IO_CAPABILITY_RESPONSE 0x32
1617
struct bt_hci_evt_io_capability_response {
1618
uint8_t bdaddr[6];
1619
uint8_t capability;
1620
uint8_t oob_data;
1621
uint8_t authentication;
1622
} __attribute__ ((packed));
1623
1624
#define BT_HCI_EVT_USER_CONFIRM_REQUEST 0x33
1625
struct bt_hci_evt_user_confirm_request {
1626
uint8_t bdaddr[6];
1627
uint32_t passkey;
1628
} __attribute__ ((packed));
1629
1630
#define BT_HCI_EVT_USER_PASSKEY_REQUEST 0x34
1631
struct bt_hci_evt_user_passkey_request {
1632
uint8_t bdaddr[6];
1633
} __attribute__ ((packed));
1634
1635
#define BT_HCI_EVT_REMOTE_OOB_DATA_REQUEST 0x35
1636
struct bt_hci_evt_remote_oob_data_request {
1637
uint8_t bdaddr[6];
1638
} __attribute__ ((packed));
1639
1640
#define BT_HCI_EVT_SIMPLE_PAIRING_COMPLETE 0x36
1641
struct bt_hci_evt_simple_pairing_complete {
1642
uint8_t status;
1643
uint8_t bdaddr[6];
1644
} __attribute__ ((packed));
1645
1646
#define BT_HCI_EVT_LINK_SUPV_TIMEOUT_CHANGED 0x38
1647
struct bt_hci_evt_link_supv_timeout_changed {
1648
uint16_t handle;
1649
uint16_t timeout;
1650
} __attribute__ ((packed));
1651
1652
#define BT_HCI_EVT_ENHANCED_FLUSH_COMPLETE 0x39
1653
struct bt_hci_evt_enhanced_flush_complete {
1654
uint16_t handle;
1655
} __attribute__ ((packed));
1656
1657
#define BT_HCI_EVT_USER_PASSKEY_NOTIFY 0x3b
1658
struct bt_hci_evt_user_passkey_notify {
1659
uint8_t bdaddr[6];
1660
uint32_t passkey;
1661
} __attribute__ ((packed));
1662
1663
#define BT_HCI_EVT_KEYPRESS_NOTIFY 0x3c
1664
struct bt_hci_evt_keypress_notify {
1665
uint8_t bdaddr[6];
1666
uint8_t type;
1667
} __attribute__ ((packed));
1668
1669
#define BT_HCI_EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3d
1670
struct bt_hci_evt_remote_host_features_notify {
1671
uint8_t bdaddr[6];
1672
uint8_t features[8];
1673
} __attribute__ ((packed));
1674
1675
#define BT_HCI_EVT_LE_META_EVENT 0x3e
1676
1677
#define BT_HCI_EVT_PHY_LINK_COMPLETE 0x40
1678
struct bt_hci_evt_phy_link_complete {
1679
uint8_t status;
1680
uint8_t phy_handle;
1681
} __attribute__ ((packed));
1682
1683
#define BT_HCI_EVT_CHANNEL_SELECTED 0x41
1684
struct bt_hci_evt_channel_selected {
1685
uint8_t phy_handle;
1686
} __attribute__ ((packed));
1687
1688
#define BT_HCI_EVT_DISCONN_PHY_LINK_COMPLETE 0x42
1689
struct bt_hci_evt_disconn_phy_link_complete {
1690
uint8_t status;
1691
uint8_t phy_handle;
1692
uint8_t reason;
1693
} __attribute__ ((packed));
1694
1695
#define BT_HCI_EVT_PHY_LINK_LOSS_EARLY_WARNING 0x43
1696
struct bt_hci_evt_phy_link_loss_early_warning {
1697
uint8_t phy_handle;
1698
uint8_t reason;
1699
} __attribute__ ((packed));
1700
1701
#define BT_HCI_EVT_PHY_LINK_RECOVERY 0x44
1702
struct bt_hci_evt_phy_link_recovery {
1703
uint8_t phy_handle;
1704
} __attribute__ ((packed));
1705
1706
#define BT_HCI_EVT_LOGIC_LINK_COMPLETE 0x45
1707
struct bt_hci_evt_logic_link_complete {
1708
uint8_t status;
1709
uint16_t handle;
1710
uint8_t phy_handle;
1711
uint8_t flow_spec;
1712
} __attribute__ ((packed));
1713
1714
#define BT_HCI_EVT_DISCONN_LOGIC_LINK_COMPLETE 0x46
1715
struct bt_hci_evt_disconn_logic_link_complete {
1716
uint8_t status;
1717
uint16_t handle;
1718
uint8_t reason;
1719
} __attribute__ ((packed));
1720
1721
#define BT_HCI_EVT_FLOW_SPEC_MODIFY_COMPLETE 0x47
1722
struct bt_hci_evt_flow_spec_modify_complete {
1723
uint8_t status;
1724
uint16_t handle;
1725
} __attribute__ ((packed));
1726
1727
#define BT_HCI_EVT_NUM_COMPLETED_DATA_BLOCKS 0x48
1728
struct bt_hci_evt_num_completed_data_blocks {
1729
uint16_t total_num_blocks;
1730
uint8_t num_handles;
1731
uint16_t handle;
1732
uint16_t num_packets;
1733
uint16_t num_blocks;
1734
} __attribute__ ((packed));
1735
1736
#define BT_HCI_EVT_SHORT_RANGE_MODE_CHANGE 0x4c
1737
struct bt_hci_evt_short_range_mode_change {
1738
uint8_t status;
1739
uint8_t phy_handle;
1740
uint8_t mode;
1741
} __attribute__ ((packed));
1742
1743
#define BT_HCI_EVT_AMP_STATUS_CHANGE 0x4d
1744
struct bt_hci_evt_amp_status_change {
1745
uint8_t status;
1746
uint8_t amp_status;
1747
} __attribute__ ((packed));
1748
1749
#define BT_HCI_EVT_LE_CONN_COMPLETE 0x01
1750
struct bt_hci_evt_le_conn_complete {
1751
uint8_t status;
1752
uint16_t handle;
1753
uint8_t role;
1754
uint8_t peer_addr_type;
1755
uint8_t peer_addr[6];
1756
uint16_t interval;
1757
uint16_t latency;
1758
uint16_t supv_timeout;
1759
uint8_t clock_accuracy;
1760
} __attribute__ ((packed));
1761
1762
#define BT_HCI_EVT_LE_ADV_REPORT 0x02
1763
struct bt_hci_evt_le_adv_report {
1764
uint8_t num_reports;
1765
uint8_t event_type;
1766
uint8_t addr_type;
1767
uint8_t addr[6];
1768
uint8_t data_len;
1769
uint8_t data[0];
1770
} __attribute__ ((packed));
1771
1772
#define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03
1773
struct bt_hci_evt_le_conn_update_complete {
1774
uint8_t status;
1775
uint16_t handle;
1776
uint16_t interval;
1777
uint16_t latency;
1778
uint16_t supv_timeout;
1779
} __attribute__ ((packed));
1780
1781
#define BT_HCI_EVT_LE_REMOTE_FEATURES_COMPLETE 0x04
1782
struct bt_hci_evt_le_remote_features_complete {
1783
uint8_t status;
1784
uint16_t handle;
1785
uint8_t features[8];
1786
} __attribute__ ((packed));
1787
1788
#define BT_HCI_EVT_LE_LONG_TERM_KEY_REQUEST 0x05
1789
struct bt_hci_evt_le_long_term_key_request {
1790
uint16_t handle;
1791
uint8_t number[8];
1792
uint16_t diversifier;
1793
} __attribute__ ((packed));
1794
1795
#define BT_HCI_ERR_SUCCESS 0x00
1796
#define BT_HCI_ERR_UNKNOWN_COMMAND 0x01
1797
#define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02
1798
#define BT_HCI_ERR_HARDWARE_FAILURE 0x03
1799
#define BT_HCI_ERR_PAGE_TIMEOUT 0x04
1800
#define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07
1801
#define BT_HCI_ERR_COMMAND_DISALLOWED 0x0c
1802
#define BT_HCI_ERR_UNSUPPORTED_FEATURE 0x11
1803
#define BT_HCI_ERR_INVALID_PARAMETERS 0x12
1804
#define BT_HCI_ERR_UNSPECIFIED_ERROR 0x1f
1805
#define BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH 0x3e
1806
1807
struct bt_l2cap_hdr {
1808
uint16_t len;
1809
uint16_t cid;
1810
} __attribute__ ((packed));
1811
1812
struct bt_l2cap_hdr_sig {
1813
uint8_t code;
1814
uint8_t ident;
1815
uint16_t len;
1816
} __attribute__ ((packed));
1817
1818
#define BT_L2CAP_PDU_CMD_REJECT 0x01
1819
struct bt_l2cap_pdu_cmd_reject {
1820
uint16_t reason;
1821
} __attribute__ ((packed));
1822
1823
#define BT_L2CAP_PDU_CONN_REQ 0x02
1824
struct bt_l2cap_pdu_conn_req {
1825
uint16_t psm;
1826
uint16_t scid;
1827
} __attribute__ ((packed));
1828
1829
#define BT_L2CAP_PDU_CONN_RSP 0x03
1830
struct bt_l2cap_pdu_conn_rsp {
1831
uint16_t dcid;
1832
uint16_t scid;
1833
uint16_t result;
1834
uint16_t status;
1835
} __attribute__ ((packed));
1836
1837
#define BT_L2CAP_PDU_CONFIG_REQ 0x04
1838
struct bt_l2cap_pdu_config_req {
1839
uint16_t dcid;
1840
uint16_t flags;
1841
} __attribute__ ((packed));
1842
1843
#define BT_L2CAP_PDU_CONFIG_RSP 0x05
1844
struct bt_l2cap_pdu_config_rsp {
1845
uint16_t scid;
1846
uint16_t flags;
1847
uint16_t result;
1848
} __attribute__ ((packed));
1849
1850
#define BT_L2CAP_PDU_DISCONN_REQ 0x06
1851
struct bt_l2cap_pdu_disconn_req {
1852
uint16_t dcid;
1853
uint16_t scid;
1854
} __attribute__ ((packed));
1855
1856
#define BT_L2CAP_PDU_DISCONN_RSP 0x07
1857
struct bt_l2cap_pdu_disconn_rsp {
1858
uint16_t dcid;
1859
uint16_t scid;
1860
} __attribute__ ((packed));
1861
1862
#define BT_L2CAP_PDU_ECHO_REQ 0x08
1863
1864
#define BT_L2CAP_PDU_ECHO_RSP 0x09
1865
1866
#define BT_L2CAP_PDU_INFO_REQ 0x0a
1867
struct bt_l2cap_pdu_info_req {
1868
uint16_t type;
1869
} __attribute__ ((packed));
1870
1871
#define BT_L2CAP_PDU_INFO_RSP 0x0b
1872
struct bt_l2cap_pdu_info_rsp {
1873
uint16_t type;
1874
uint16_t result;
1875
} __attribute__ ((packed));
1876
1877
#define BT_L2CAP_PDU_CREATE_CHAN_REQ 0x0c
1878
struct bt_l2cap_pdu_create_chan_req {
1879
uint16_t psm;
1880
uint16_t scid;
1881
uint8_t ctrlid;
1882
} __attribute__ ((packed));
1883
1884
#define BT_L2CAP_PDU_CREATE_CHAN_RSP 0x0d
1885
struct bt_l2cap_pdu_create_chan_rsp {
1886
uint16_t dcid;
1887
uint16_t scid;
1888
uint16_t result;
1889
uint16_t status;
1890
} __attribute__ ((packed));
1891
1892
#define BT_L2CAP_PDU_MOVE_CHAN_REQ 0x0e
1893
struct bt_l2cap_pdu_move_chan_req {
1894
uint16_t icid;
1895
uint8_t ctrlid;
1896
} __attribute__ ((packed));
1897
1898
#define BT_L2CAP_PDU_MOVE_CHAN_RSP 0x0f
1899
struct bt_l2cap_pdu_move_chan_rsp {
1900
uint16_t icid;
1901
uint16_t result;
1902
} __attribute__ ((packed));
1903
1904
#define BT_L2CAP_PDU_MOVE_CHAN_CFM 0x10
1905
struct bt_l2cap_pdu_move_chan_cfm {
1906
uint16_t icid;
1907
uint16_t result;
1908
} __attribute__ ((packed));
1909
1910
#define BT_L2CAP_PDU_MOVE_CHAN_CFM_RSP 0x11
1911
struct bt_l2cap_pdu_move_chan_cfm_rsp {
1912
uint16_t icid;
1913
} __attribute__ ((packed));
1914
1915
#define BT_L2CAP_PDU_CONN_PARAM_REQ 0x12
1916
struct bt_l2cap_pdu_conn_param_req {
1917
uint16_t min_interval;
1918
uint16_t max_interval;
1919
uint16_t latency;
1920
uint16_t timeout;
1921
} __attribute__ ((packed));
1922
1923
#define BT_L2CAP_PDU_CONN_PARAM_RSP 0x13
1924
struct bt_l2cap_pdu_conn_param_rsp {
1925
uint16_t result;
1926
} __attribute__ ((packed));
1927
1928
struct bt_l2cap_hdr_connless {
1929
uint16_t psm;
1930
} __attribute__ ((packed));
1931
1932
struct bt_l2cap_hdr_amp {
1933
uint8_t code;
1934
uint8_t ident;
1935
uint16_t len;
1936
} __attribute__ ((packed));
1937
1938
#define BT_L2CAP_AMP_CMD_REJECT 0x01
1939
struct bt_l2cap_amp_cmd_reject {
1940
uint16_t reason;
1941
} __attribute__ ((packed));
1942
1943
#define BT_L2CAP_AMP_DISCOVER_REQ 0x02
1944
struct bt_l2cap_amp_discover_req {
1945
uint16_t size;
1946
uint16_t features;
1947
} __attribute__ ((packed));
1948
1949
#define BT_L2CAP_AMP_DISCOVER_RSP 0x03
1950
struct bt_l2cap_amp_discover_rsp {
1951
uint16_t size;
1952
uint16_t features;
1953
} __attribute__ ((packed));
1954
1955
#define BT_L2CAP_AMP_CHANGE_NOTIFY 0x04
1956
1957
#define BT_L2CAP_AMP_CHANGE_RESPONSE 0x05
1958
1959
#define BT_L2CAP_AMP_GET_INFO_REQ 0x06
1960
struct bt_l2cap_amp_get_info_req {
1961
uint8_t ctrlid;
1962
} __attribute__ ((packed));
1963
1964
#define BT_L2CAP_AMP_GET_INFO_RSP 0x07
1965
struct bt_l2cap_amp_get_info_rsp {
1966
uint8_t ctrlid;
1967
uint8_t status;
1968
uint32_t total_bw;
1969
uint32_t max_bw;
1970
uint32_t min_latency;
1971
uint16_t pal_cap;
1972
uint16_t max_assoc_len;
1973
} __attribute__ ((packed));
1974
1975
#define BT_L2CAP_AMP_GET_ASSOC_REQ 0x08
1976
struct bt_l2cap_amp_get_assoc_req {
1977
uint8_t ctrlid;
1978
} __attribute__ ((packed));
1979
1980
#define BT_L2CAP_AMP_GET_ASSOC_RSP 0x09
1981
struct bt_l2cap_amp_get_assoc_rsp {
1982
uint8_t ctrlid;
1983
uint8_t status;
1984
} __attribute__ ((packed));
1985
1986
#define BT_L2CAP_AMP_CREATE_PHY_LINK_REQ 0x0a
1987
struct bt_l2cap_amp_create_phy_link_req {
1988
uint8_t local_ctrlid;
1989
uint8_t remote_ctrlid;
1990
} __attribute__ ((packed));
1991
1992
#define BT_L2CAP_AMP_CREATE_PHY_LINK_RSP 0x0b
1993
struct bt_l2cap_amp_create_phy_link_rsp {
1994
uint8_t local_ctrlid;
1995
uint8_t remote_ctrlid;
1996
uint8_t status;
1997
} __attribute__ ((packed));
1998
1999
#define BT_L2CAP_AMP_DISCONN_PHY_LINK_REQ 0x0c
2000
struct bt_l2cap_amp_disconn_phy_link_req {
2001
uint8_t local_ctrlid;
2002
uint8_t remote_ctrlid;
2003
} __attribute__ ((packed));
2004
2005
#define BT_L2CAP_AMP_DISCONN_PHY_LINK_RSP 0x0d
2006
struct bt_l2cap_amp_disconn_phy_link_rsp {
2007
uint8_t local_ctrlid;
2008
uint8_t remote_ctrlid;
2009
uint8_t status;
2010
} __attribute__ ((packed));
2011
2012
struct bt_l2cap_hdr_att {
2013
uint8_t code;
2014
} __attribute__ ((packed));
2015
2016
#define BT_L2CAP_ATT_ERROR_RESPONSE 0x01
2017
struct bt_l2cap_att_error_response {
2018
uint8_t request;
2019
uint16_t handle;
2020
uint8_t error;
2021
} __attribute__ ((packed));
2022
2023
#define BT_L2CAP_ATT_EXCHANGE_MTU_REQ 0x02
2024
struct bt_l2cap_att_exchange_mtu_req {
2025
uint16_t mtu;
2026
} __attribute__ ((packed));
2027
2028
#define BT_L2CAP_ATT_EXCHANGE_MTU_RSP 0x03
2029
struct bt_l2cap_att_exchange_mtu_rsp {
2030
uint16_t mtu;
2031
} __attribute__ ((packed));
2032
2033
#define BT_L2CAP_ATT_READ_TYPE_REQ 0x08
2034
struct bt_l2cap_att_read_type_req {
2035
uint16_t start_handle;
2036
uint16_t end_handle;
2037
} __attribute__ ((packed));
2038
2039
#define BT_L2CAP_ATT_READ_TYPE_RSP 0x09
2040
struct bt_l2cap_att_read_type_rsp {
2041
uint8_t length;
2042
} __attribute__ ((packed));
2043
2044
#define BT_L2CAP_ATT_READ_REQ 0x0a
2045
struct bt_l2cap_att_read_req {
2046
uint16_t handle;
2047
} __attribute__ ((packed));
2048
2049
#define BT_L2CAP_ATT_READ_RSP 0x0b
2050
2051
#define BT_L2CAP_ATT_READ_GROUP_TYPE_REQ 0x10
2052
struct bt_l2cap_att_read_group_type_req {
2053
uint16_t start_handle;
2054
uint16_t end_handle;
2055
} __attribute__ ((packed));
2056
2057
#define BT_L2CAP_ATT_READ_GROUP_TYPE_RSP 0x11
2058
struct bt_l2cap_att_read_group_type_rsp {
2059
uint8_t length;
2060
} __attribute__ ((packed));
2061
2062
#define BT_L2CAP_ATT_HANDLE_VALUE_NOTIFY 0x1b
2063
struct bt_l2cap_att_handle_value_notify {
2064
uint16_t handle;
2065
} __attribute__ ((packed));
2066
2067
#define BT_L2CAP_ATT_HANDLE_VALUE_IND 0x1d
2068
struct bt_l2cap_att_handle_value_ind {
2069
uint16_t handle;
2070
} __attribute__ ((packed));
2071
2072
#define BT_L2CAP_ATT_HANDLE_VALUE_CONF 0x1e
2073
2074
struct bt_l2cap_hdr_smp {
2075
uint8_t code;
2076
} __attribute__ ((packed));
2077
2078
#define BT_L2CAP_SMP_PAIRING_REQUEST 0x01
2079
struct bt_l2cap_smp_pairing_request {
2080
uint8_t io_capa;
2081
uint8_t oob_data;
2082
uint8_t auth_req;
2083
uint8_t max_key_size;
2084
uint8_t init_key_dist;
2085
uint8_t resp_key_dist;
2086
} __attribute__ ((packed));
2087
2088
#define BT_L2CAP_SMP_PAIRING_RESPONSE 0x02
2089
struct bt_l2cap_smp_pairing_response {
2090
uint8_t io_capa;
2091
uint8_t oob_data;
2092
uint8_t auth_req;
2093
uint8_t max_key_size;
2094
uint8_t init_key_dist;
2095
uint8_t resp_key_dist;
2096
} __attribute__ ((packed));
2097
2098
#define BT_L2CAP_SMP_PAIRING_CONFIRM 0x03
2099
struct bt_l2cap_smp_pairing_confirm {
2100
uint8_t value[16];
2101
} __attribute__ ((packed));
2102
2103
#define BT_L2CAP_SMP_PAIRING_RANDOM 0x04
2104
struct bt_l2cap_smp_pairing_random {
2105
uint8_t value[16];
2106
} __attribute__ ((packed));
2107
2108
#define BT_L2CAP_SMP_PAIRING_FAILED 0x05
2109
struct bt_l2cap_smp_pairing_failed {
2110
uint8_t reason;
2111
} __attribute__ ((packed));
2112
2113
#define BT_L2CAP_SMP_ENCRYPT_INFO 0x06
2114
struct bt_l2cap_smp_encrypt_info {
2115
uint8_t ltk[16];
2116
} __attribute__ ((packed));
2117
2118
#define BT_L2CAP_SMP_MASTER_IDENT 0x07
2119
struct bt_l2cap_smp_master_ident {
2120
uint16_t ediv;
2121
uint64_t rand;
2122
} __attribute__ ((packed));
2123
2124
#define BT_L2CAP_SMP_IDENT_INFO 0x08
2125
struct bt_l2cap_smp_ident_info {
2126
uint8_t irk[16];
2127
} __attribute__ ((packed));
2128
2129
#define BT_L2CAP_SMP_IDENT_ADDR_INFO 0x09
2130
struct bt_l2cap_smp_ident_addr_info {
2131
uint8_t addr_type;
2132
uint8_t addr[6];
2133
} __attribute__ ((packed));
2134
2135
#define BT_L2CAP_SMP_SIGNING_INFO 0x0a
2136
struct bt_l2cap_smp_signing_info {
2137
uint8_t csrk[16];
2138
} __attribute__ ((packed));
2139
2140
#define BT_L2CAP_SMP_SECURITY_REQUEST 0x0b
2141
struct bt_l2cap_smp_security_request {
2142
uint8_t auth_req;
2143
} __attribute__ ((packed));
2144
2145
struct bt_sdp_hdr {
2146
uint8_t pdu;
2147
uint16_t tid;
2148
uint16_t plen;
2149
} __attribute__ ((packed));
2150
2151