Select one of the symbols to view example projects that use it.
 
Outline
#define BTSTACK_FILE__
#include "btstack_config.h"
#include "hci.h"
#include "hci_cmd.h"
#include "btstack_debug.h"
#include <string.h>
#include "classic/sdp_util.h"
#define OPCODE
#define INVALID_VAR_LEN
#define MAX_NR_ARRAY_FIELDS
#define INVALID_ARRAY_LEN
hci_cmd_create_from_template(uint8_t *, const hci_cmd_t *, va_list)
hci_cmd_create_from_template_with_vargs(uint8_t *, const hci_cmd_t *, ...)
hci_inquiry
hci_inquiry_cancel
hci_periodic_inquiry_mode
hci_exit_periodic_inquiry_mode
hci_create_connection
hci_disconnect
hci_create_connection_cancel
hci_accept_connection_request
hci_reject_connection_request
hci_link_key_request_reply
hci_link_key_request_negative_reply
hci_pin_code_request_reply
hci_pin_code_request_negative_reply
hci_change_connection_packet_type
hci_authentication_requested
hci_set_connection_encryption
hci_change_connection_link_key
hci_remote_name_request
hci_remote_name_request_cancel
hci_read_remote_supported_features_command
hci_read_remote_extended_features_command
hci_read_remote_version_information
hci_read_clock_offset
hci_setup_synchronous_connection
hci_accept_synchronous_connection
hci_io_capability_request_reply
hci_user_confirmation_request_reply
hci_user_confirmation_request_negative_reply
hci_user_passkey_request_reply
hci_user_passkey_request_negative_reply
hci_remote_oob_data_request_reply
hci_remote_oob_data_request_negative_reply
hci_io_capability_request_negative_reply
hci_enhanced_setup_synchronous_connection
hci_enhanced_accept_synchronous_connection
hci_remote_oob_extended_data_request_reply
hci_hold_mode
hci_sniff_mode
hci_exit_sniff_mode
hci_park_state
hci_exit_park_state
hci_qos_setup
hci_role_discovery
hci_switch_role_command
hci_read_link_policy_settings
hci_write_link_policy_settings
hci_sniff_subrating
hci_write_default_link_policy_setting
hci_flow_specification
hci_set_event_mask
hci_reset
hci_flush
hci_read_pin_type
hci_write_pin_type
hci_delete_stored_link_key
hci_read_local_name
hci_read_page_timeout
hci_write_page_timeout
hci_write_scan_enable
hci_read_page_scan_activity
hci_write_page_scan_activity
hci_read_inquiry_scan_activity
hci_write_inquiry_scan_activity
hci_write_authentication_enable
hci_write_automatic_flush_timeout
hci_write_class_of_device
hci_read_num_broadcast_retransmissions
hci_write_num_broadcast_retransmissions
hci_read_transmit_power_level
hci_write_synchronous_flow_control_enable
hci_set_controller_to_host_flow_control
hci_host_buffer_size
hci_read_link_supervision_timeout
hci_write_link_supervision_timeout
hci_write_current_iac_lap_two_iacs
hci_write_inquiry_scan_type
hci_write_inquiry_mode
hci_write_page_scan_type
hci_write_extended_inquiry_response
hci_write_simple_pairing_mode
hci_read_local_oob_data
hci_read_inquiry_response_transmit_power_level
hci_write_inquiry_transmit_power_level
hci_write_default_erroneous_data_reporting
hci_set_event_mask_2
hci_read_le_host_supported
hci_write_le_host_supported
hci_write_secure_connections_host_support
hci_read_local_extended_oob_data
hci_read_extended_page_timeout
hci_write_extended_page_timeout
hci_read_extended_inquiry_length
hci_write_extended_inquiry_length
hci_set_ecosystem_base_interval
hci_configure_data_path
hci_set_min_encryption_key_size
hci_read_loopback_mode
hci_write_loopback_mode
hci_enable_device_under_test_mode
hci_write_simple_pairing_debug_mode
hci_write_secure_connections_test_mode
hci_read_local_version_information
hci_read_local_supported_commands
hci_read_local_supported_features
hci_read_buffer_size
hci_read_bd_addr
hci_read_failed_contact_counter
hci_reset_failed_contact_counter
hci_read_link_quality
hci_read_rssi
hci_read_clock
hci_read_encryption_key_size
hci_le_set_event_mask
hci_le_read_buffer_size
hci_le_read_local_supported_features
hci_le_set_random_address
hci_le_set_advertising_parameters
hci_le_read_advertising_channel_tx_power
hci_le_set_advertising_data
hci_le_set_scan_response_data
hci_le_set_advertise_enable
hci_le_set_scan_parameters
hci_le_set_scan_enable
hci_le_create_connection
hci_le_create_connection_cancel
hci_le_read_white_list_size
hci_le_clear_white_list
hci_le_add_device_to_white_list
hci_le_remove_device_from_white_list
hci_le_connection_update
hci_le_set_host_channel_classification
hci_le_read_channel_map
hci_le_read_remote_used_features
hci_le_encrypt
hci_le_rand
hci_le_start_encryption
hci_le_long_term_key_request_reply
hci_le_long_term_key_negative_reply
hci_le_read_supported_states
hci_le_receiver_test
hci_le_transmitter_test
hci_le_test_end
hci_le_remote_connection_parameter_request_reply
hci_le_remote_connection_parameter_request_negative_reply
hci_le_set_data_length
hci_le_read_suggested_default_data_length
hci_le_write_suggested_default_data_length
hci_le_read_local_p256_public_key
hci_le_generate_dhkey
hci_le_add_device_to_resolving_list
hci_le_remove_device_from_resolving_list
hci_le_clear_resolving_list
hci_le_read_resolving_list_size
hci_le_read_peer_resolvable_address
hci_le_read_local_resolvable_address
hci_le_set_address_resolution_enabled
hci_le_set_resolvable_private_address_timeout
hci_le_read_maximum_data_length
hci_le_read_phy
hci_le_set_default_phy
hci_le_set_phy
hci_le_receiver_test_v2
hci_le_transmitter_test_v2
hci_le_set_advertising_set_random_address
hci_le_set_extended_advertising_parameters
hci_le_set_extended_advertising_data
hci_le_set_extended_scan_response_data
hci_le_set_extended_advertising_enable
hci_le_read_maximum_advertising_data_length
hci_le_read_number_of_supported_advertising_sets
hci_le_remove_advertising_set
hci_le_clear_advertising_sets
hci_le_set_periodic_advertising_parameters
hci_le_set_periodic_advertising_data
hci_le_set_periodic_advertising_enable
hci_le_set_extended_scan_parameters
hci_le_set_extended_scan_enable
hci_le_extended_create_connection
hci_le_periodic_advertising_create_sync
hci_le_periodic_advertising_create_sync_cancel
hci_le_periodic_advertising_terminate_sync
hci_le_add_device_to_periodic_advertiser_list
hci_le_remove_device_from_periodic_advertiser_list
hci_le_clear_periodic_advertiser_list
hci_le_read_periodic_advertiser_list_size
hci_le_read_transmit_power
hci_le_read_rf_path_compensation
hci_le_write_rf_path_compensation
hci_le_set_privacy_mode
hci_le_receiver_test_v3
hci_le_transmitter_test_v3
hci_le_set_connectionless_cte_transmit_parameters
hci_le_set_connectionless_cte_transmit_enable
hci_le_set_connectionless_iq_sampling_enable
hci_le_set_connection_cte_receive_parameters
hci_le_set_connection_cte_transmit_parameters
hci_le_connection_cte_request_enable
hci_le_connection_cte_response_enable
hci_le_read_antenna_information
hci_le_set_periodic_advertising_receive_enable
hci_le_periodic_advertising_sync_transfer
hci_le_periodic_advertising_set_info_transfer
hci_le_set_periodic_advertising_sync_transfer_parameters
hci_le_set_default_periodic_advertising_sync_transfer_parameters
hci_le_generate_dhkey_v2
hci_le_modify_sleep_clock_accuracy
hci_le_read_buffer_size_v2
hci_le_read_iso_tx_sync
hci_le_set_cig_parameters
hci_le_set_cig_parameters_test
hci_le_create_cis
hci_le_remove_cig
hci_le_accept_cis_request
hci_le_reject_cis_request
hci_le_create_big
hci_le_create_big_test
hci_le_terminate_big
hci_le_big_create_sync
hci_le_big_terminate_sync
hci_le_request_peer_sca
hci_le_setup_iso_data_path
hci_le_remove_iso_data_path
hci_le_iso_transmit_test
hci_le_iso_receive_test
hci_le_iso_read_test_counters
hci_le_iso_test_end
hci_le_set_host_feature
hci_le_read_iso_link_quality
hci_le_enhanced_read_transmit_power_level
hci_le_read_remote_transmit_power_level
hci_le_set_path_loss_reporting_parameters
hci_le_set_path_loss_reporting_enable
hci_le_set_transmit_power_reporting_enable
hci_le_transmitter_test_v4
hci_bcm_enable_wbs
hci_bcm_pcm2_setup
hci_bcm_write_sco_pcm_int
hci_bcm_write_pcm_data_format_param
hci_bcm_write_i2spcm_interface_param
hci_bcm_set_sleep_mode
hci_bcm_write_tx_power_table
hci_bcm_set_tx_pwr
hci_ti_drpb_tester_con_rx
hci_ti_drpb_tester_con_tx
hci_ti_drpb_tester_packet_tx_rx
hci_ti_configure_ddip
hci_ti_avrp_enable
hci_ti_wbs_associate
hci_ti_wbs_disassociate
hci_ti_write_codec_config
hci_ti_drpb_enable_rf_calibration
hci_ti_write_hardware_register
hci_rtk_configure_sco_routing
hci_rtk_read_card_info
hci_nxp_set_sco_data_path
hci_nxp_write_pcm_i2s_settings
hci_nxp_write_pcm_i2s_sync_settings
hci_nxp_write_pcm_link_settings
hci_nxp_set_wbs_connection
hci_nxp_host_pcm_i2s_audio_config
hci_nxp_host_pcm_i2s_control_enable
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesBluetooth LE Stacksrc/hci_cmd.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Copyright (C) 2014 BlueKitchen GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * 4. Any redistribution, use, or modification is done solely for * personal benefit and not for any commercial purpose or for * monetary gain. * * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Please inquire about commercial licensing options at * contact@bluekitchen-gmbh.com * *//* ... */ #define BTSTACK_FILE__ "hci_cmd.c" /* * hci_cmd.c * * Created by Matthias Ringwald on 7/23/09. *//* ... */ #include "btstack_config.h" #include "hci.h" #include "hci_cmd.h" #include "btstack_debug.h" #include <string.h> 5 includes #ifdef ENABLE_SDP #include "classic/sdp_util.h" #endif // calculate combined ogf/ocf value #define OPCODE(ogf, ocf) ((ocf) | ((ogf) << 10)) #define INVALID_VAR_LEN 0xffffu // hci_le_set_cig_parameters_test has 10 arrayed parameters #define MAX_NR_ARRAY_FIELDS 10 #define INVALID_ARRAY_LEN 0xff /** * construct HCI Command based on template * * Format: * 1,2,3,4: one to four byte value * H: HCI connection handle * B: Bluetooth Baseband Address (BD_ADDR) * D: 8 byte data block * E: Extended Inquiry Result * N: Name up to 248 chars, \0 terminated * P: 16 byte data block. Pairing code, Simple Pairing Hash and Randomizer * A: 31 bytes advertising data * S: Service Record (Data Element Sequence) * Q: 32 byte data block, e.g. for X and Y coordinates of P-256 public key * J: 8-bit length of variable size element * V: variable size element, len was given with param 'J' * a: number of elements in following arrayed parameters(s), specified as '[...]' * b: bit field indicating number of arrayed parameters(s), specified as '[...]' * [: start of arrayed param sequence * ]: end of arrayed param sequence *//* ... */ uint16_t hci_cmd_create_from_template(uint8_t *hci_cmd_buffer, const hci_cmd_t *cmd, va_list argptr){ hci_cmd_buffer[0] = cmd->opcode & 0xffu; hci_cmd_buffer[1] = cmd->opcode >> 8; uint16_t pos = 3; const char *format = cmd->format; uint16_t word; uint32_t longword; uint8_t * ptr; #ifdef ENABLE_BLE // variable size data uint16_t var_len = INVALID_VAR_LEN; // array processing const char * array_format = NULL; void * array_data[MAX_NR_ARRAY_FIELDS]; uint8_t array_num_elements = INVALID_ARRAY_LEN; uint8_t array_num_fields; uint8_t array_element_index; bool array_done;/* ... */ #endif bool done_format = false; while (!done_format) { switch(*format) { case 0: done_format = true; break;case 0: case '1': // 8 bit value word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = word & 0xffu; break;case '1': case '2': // 16 bit value word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = word & 0xffu; hci_cmd_buffer[pos++] = word >> 8; break;case '2': case 'H': // hci_handle word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = word & 0xffu; hci_cmd_buffer[pos++] = word >> 8; break;case 'H': case '3': longword = va_arg(argptr, uint32_t); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = longword; hci_cmd_buffer[pos++] = longword >> 8; hci_cmd_buffer[pos++] = longword >> 16; break;case '3': case '4': longword = va_arg(argptr, uint32_t); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = longword; hci_cmd_buffer[pos++] = longword >> 8; hci_cmd_buffer[pos++] = longword >> 16; hci_cmd_buffer[pos++] = longword >> 24; break;case '4': case 'B': // bt-addr ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = ptr[5]; hci_cmd_buffer[pos++] = ptr[4]; hci_cmd_buffer[pos++] = ptr[3]; hci_cmd_buffer[pos++] = ptr[2]; hci_cmd_buffer[pos++] = ptr[1]; hci_cmd_buffer[pos++] = ptr[0]; break;case 'B': case 'D': // 8 byte data block ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE (void)memcpy(&hci_cmd_buffer[pos], ptr, 8); pos += 8; break;case 'D': case 'E': // Extended Inquiry Information 240 octets ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE (void)memcpy(&hci_cmd_buffer[pos], ptr, 240); pos += 240; break;case 'E': case 'N': { // UTF-8 string, null terminated ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE uint16_t len = (uint16_t) strlen((const char*) ptr); if (len > 248u) { len = 248; }if (len > 248u) { ... } (void)memcpy(&hci_cmd_buffer[pos], ptr, len); if (len < 248u) { // fill remaining space with zeroes memset(&hci_cmd_buffer[pos+len], 0u, 248u-len); }if (len < 248u) { ... } pos += 248; break; ...}case 'N': case 'P': // 16 byte PIN code or link key in little endian ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE (void)memcpy(&hci_cmd_buffer[pos], ptr, 16); pos += 16; break;case 'P': case 'K': // 16 byte OOB Data or Link Key in big endian ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE reverse_bytes(ptr, &hci_cmd_buffer[pos], 16); pos += 16; break; #ifdef ENABLE_BLEcase 'K': case 'A': // 31 bytes advertising data ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE (void)memcpy(&hci_cmd_buffer[pos], ptr, 31); pos += 31; break;case 'A': case 'J': // 8 bit variable length indicator for 'V' word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE var_len = word & 0xffu; hci_cmd_buffer[pos++] = (uint8_t) var_len; break;case 'J': case 'V': btstack_assert(var_len != INVALID_VAR_LEN); ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE (void)memcpy(&hci_cmd_buffer[pos], ptr, var_len); pos += var_len; var_len = INVALID_VAR_LEN; break;case 'V': case 'a': btstack_assert(array_num_elements == INVALID_ARRAY_LEN); word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = word & 0xff; array_num_elements = word & 0xffu; break;case 'a': case 'b': btstack_assert(array_num_elements == INVALID_ARRAY_LEN); word = va_arg(argptr, int); // LCOV_EXCL_BR_LINE hci_cmd_buffer[pos++] = word & 0xff; array_num_elements = count_set_bits_uint32(word & 0xffu); break;case 'b': case '[': btstack_assert(array_num_elements != INVALID_ARRAY_LEN); // process array format++; array_format = format; array_num_fields = 0; array_done = false; while (!array_done){ switch (*format){ case 0: array_done = true; done_format = true; break;case 0: case ']': array_done = true; break;case ']': case '1': case '2': // all arrayed parameters are passed in as arrays ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE array_data[array_num_fields++] = ptr; format++; break;case '2': default: btstack_unreachable(); break;default }switch (*format) { ... } }while (!array_done) { ... } for (array_element_index = 0; array_element_index < array_num_elements ; array_element_index++){ uint8_t array_field_index; for (array_field_index = 0; array_field_index < array_num_fields ; array_field_index++){ switch (array_format[array_field_index]){ case '1': hci_cmd_buffer[pos++] = ((const uint8_t *) array_data[array_field_index])[array_element_index]; break;case '1': case '2': little_endian_store_16(hci_cmd_buffer, pos, ((const uint16_t *) array_data[array_field_index])[array_element_index]); pos += 2; break;case '2': default: btstack_unreachable(); break;default }switch (array_format[array_field_index]) { ... } }for (array_field_index = 0; array_field_index < array_num_fields ; array_field_index++) { ... } }for (array_element_index = 0; array_element_index < array_num_elements ; array_element_index++) { ... } break;/* ... */ #endif #ifdef ENABLE_LE_SECURE_CONNECTIONS case 'Q': ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE reverse_bytes(ptr, &hci_cmd_buffer[pos], 32); pos += 32; break;/* ... */ #endif #ifdef ENABLE_SDP // used by daemon case 'S': { // Service Record (Data Element Sequence) ptr = va_arg(argptr, uint8_t *); // LCOV_EXCL_BR_LINE uint16_t len = de_get_len(ptr); (void)memcpy(&hci_cmd_buffer[pos], ptr, len); pos += len; break; ...}/* ... */ #endif default: btstack_unreachable(); break;default }switch (*format) { ... } format++; }while (!done_format) { ... }; hci_cmd_buffer[2] = pos - 3; return pos; }{ ... } uint16_t hci_cmd_create_from_template_with_vargs(uint8_t * hci_cmd_buffer, const hci_cmd_t * cmd, ...){ va_list argptr; va_start(argptr, cmd); uint16_t size = hci_cmd_create_from_template(hci_cmd_buffer, cmd, argptr); va_end(argptr); return size; }{ ... } /** * Link Control Commands *//* ... */ /** * @param lap * @param inquiry_length * @param num_responses *//* ... */ const hci_cmd_t hci_inquiry = { HCI_OPCODE_HCI_INQUIRY, "311" ...}; /** *//* ... */ const hci_cmd_t hci_inquiry_cancel = { HCI_OPCODE_HCI_INQUIRY_CANCEL, "" ...}; /** * @param max_period_length * @param min_period_length * @param lap * @param inquiry_length * @param num_responses *//* ... */ const hci_cmd_t hci_periodic_inquiry_mode = { HCI_OPCODE_HCI_PERIODIC_INQUIRY_MODE, "22311" ...}; /** *//* ... */ const hci_cmd_t hci_exit_periodic_inquiry_mode = { HCI_OPCODE_HCI_EXIT_PERIODIC_INQUIRY_MODE, "" ...}; /** * @param bd_addr * @param packet_type * @param page_scan_repetition_mode * @param reserved * @param clock_offset * @param allow_role_switch *//* ... */ const hci_cmd_t hci_create_connection = { HCI_OPCODE_HCI_CREATE_CONNECTION, "B21121" ...}; /** * @param handle * @param reason (0x05, 0x13-0x15, 0x1a, 0x29, see Errors Codes in BT Spec Part D) *//* ... */ const hci_cmd_t hci_disconnect = { HCI_OPCODE_HCI_DISCONNECT, "H1" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_create_connection_cancel = { HCI_OPCODE_HCI_CREATE_CONNECTION_CANCEL, "B" ...}; /** * @param bd_addr * @param role (become master, stay slave) *//* ... */ const hci_cmd_t hci_accept_connection_request = { HCI_OPCODE_HCI_ACCEPT_CONNECTION_REQUEST, "B1" ...}; /** * @param bd_addr * @param reason (e.g. CONNECTION REJECTED DUE TO LIMITED RESOURCES (0x0d)) *//* ... */ const hci_cmd_t hci_reject_connection_request = { HCI_OPCODE_HCI_REJECT_CONNECTION_REQUEST, "B1" ...}; /** * @param bd_addr * @param link_key *//* ... */ const hci_cmd_t hci_link_key_request_reply = { HCI_OPCODE_HCI_LINK_KEY_REQUEST_REPLY, "BP" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_link_key_request_negative_reply = { HCI_OPCODE_HCI_LINK_KEY_REQUEST_NEGATIVE_REPLY, "B" ...}; /** * @param bd_addr * @param pin_length * @param pin (c-string) *//* ... */ const hci_cmd_t hci_pin_code_request_reply = { HCI_OPCODE_HCI_PIN_CODE_REQUEST_REPLY, "B1P" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_pin_code_request_negative_reply = { HCI_OPCODE_HCI_PIN_CODE_REQUEST_NEGATIVE_REPLY, "B" ...}; /** * @param handle * @param packet_type *//* ... */ const hci_cmd_t hci_change_connection_packet_type = { HCI_OPCODE_HCI_CHANGE_CONNECTION_PACKET_TYPE, "H2" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_authentication_requested = { HCI_OPCODE_HCI_AUTHENTICATION_REQUESTED, "H" ...}; /** * @param handle * @param encryption_enable *//* ... */ const hci_cmd_t hci_set_connection_encryption = { HCI_OPCODE_HCI_SET_CONNECTION_ENCRYPTION, "H1" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_change_connection_link_key = { HCI_OPCODE_HCI_CHANGE_CONNECTION_LINK_KEY, "H" ...}; /** * @param bd_addr * @param page_scan_repetition_mode * @param reserved * @param clock_offset *//* ... */ const hci_cmd_t hci_remote_name_request = { HCI_OPCODE_HCI_REMOTE_NAME_REQUEST, "B112" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_remote_name_request_cancel = { HCI_OPCODE_HCI_REMOTE_NAME_REQUEST_CANCEL, "B" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_remote_supported_features_command = { HCI_OPCODE_HCI_READ_REMOTE_SUPPORTED_FEATURES_COMMAND, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_remote_extended_features_command = { HCI_OPCODE_HCI_READ_REMOTE_EXTENDED_FEATURES_COMMAND, "H1" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_remote_version_information = { HCI_OPCODE_HCI_READ_REMOTE_VERSION_INFORMATION, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_clock_offset = { HCI_OPCODE_HCI_READ_CLOCK_OFFSET, "H" ...}; /** * @param handle * @param transmit_bandwidth 8000(64kbps) * @param receive_bandwidth 8000(64kbps) * @param max_latency >= 7ms for eSCO, 0xFFFF do not care * @param voice_settings e.g. CVSD, Input Coding: Linear, Input Data Format: 2’s complement, data 16bit: 00011000000 == 0x60 * @param retransmission_effort e.g. 0xFF do not care * @param packet_type at least EV3 for eSCO *//* ... */ const hci_cmd_t hci_setup_synchronous_connection = { HCI_OPCODE_HCI_SETUP_SYNCHRONOUS_CONNECTION, "H442212" ...}; /** * @param bd_addr * @param transmit_bandwidth * @param receive_bandwidth * @param max_latency * @param voice_settings * @param retransmission_effort * @param packet_type *//* ... */ const hci_cmd_t hci_accept_synchronous_connection = { HCI_OPCODE_HCI_ACCEPT_SYNCHRONOUS_CONNECTION, "B442212" ...}; /** * @param bd_addr * @param IO_capability * @param OOB_data_present * @param authentication_requirements *//* ... */ const hci_cmd_t hci_io_capability_request_reply = { HCI_OPCODE_HCI_IO_CAPABILITY_REQUEST_REPLY, "B111" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_user_confirmation_request_reply = { HCI_OPCODE_HCI_USER_CONFIRMATION_REQUEST_REPLY, "B" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_user_confirmation_request_negative_reply = { HCI_OPCODE_HCI_USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY, "B" ...}; /** * @param bd_addr * @param numeric_value *//* ... */ const hci_cmd_t hci_user_passkey_request_reply = { HCI_OPCODE_HCI_USER_PASSKEY_REQUEST_REPLY, "B4" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_user_passkey_request_negative_reply = { HCI_OPCODE_HCI_USER_PASSKEY_REQUEST_NEGATIVE_REPLY, "B" ...}; /** * @param bd_addr * @param c Simple Pairing Hash C * @param r Simple Pairing Randomizer R *//* ... */ const hci_cmd_t hci_remote_oob_data_request_reply = { HCI_OPCODE_HCI_REMOTE_OOB_DATA_REQUEST_REPLY, "BKK" ...}; /** * @param bd_addr *//* ... */ const hci_cmd_t hci_remote_oob_data_request_negative_reply = { HCI_OPCODE_HCI_REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY, "B" ...}; /** * @param bd_addr * @param reason (Part D, Error codes) *//* ... */ const hci_cmd_t hci_io_capability_request_negative_reply = { HCI_OPCODE_HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY, "B1" ...}; /** * @param handle * @param transmit_bandwidth * @param receive_bandwidth * @param transmit_coding_format_type * @param transmit_coding_format_company * @param transmit_coding_format_codec * @param receive_coding_format_type * @param receive_coding_format_company * @param receive_coding_format_codec * @param transmit_coding_frame_size * @param receive_coding_frame_size * @param input_bandwidth * @param output_bandwidth * @param input_coding_format_type * @param input_coding_format_company * @param input_coding_format_codec * @param output_coding_format_type * @param output_coding_format_company * @param output_coding_format_codec * @param input_coded_data_size * @param outupt_coded_data_size * @param input_pcm_data_format * @param output_pcm_data_format * @param input_pcm_sample_payload_msb_position * @param output_pcm_sample_payload_msb_position * @param input_data_path * @param output_data_path * @param input_transport_unit_size * @param output_transport_unit_size * @param max_latency * @param packet_type * @param retransmission_effort *//* ... */ const hci_cmd_t hci_enhanced_setup_synchronous_connection = { HCI_OPCODE_HCI_ENHANCED_SETUP_SYNCHRONOUS_CONNECTION, "H4412212222441221222211111111221" ...}; /** * @param bd_addr * @param transmit_bandwidth * @param receive_bandwidth * @param transmit_coding_format_type * @param transmit_coding_format_company * @param transmit_coding_format_codec * @param receive_coding_format_type * @param receive_coding_format_company * @param receive_coding_format_codec * @param transmit_coding_frame_size * @param receive_coding_frame_size * @param input_bandwidth * @param output_bandwidth * @param input_coding_format_type * @param input_coding_format_company * @param input_coding_format_codec * @param output_coding_format_type * @param output_coding_format_company * @param output_coding_format_codec * @param input_coded_data_size * @param outupt_coded_data_size * @param input_pcm_data_format * @param output_pcm_data_format * @param input_pcm_sample_payload_msb_position * @param output_pcm_sample_payload_msb_position * @param input_data_path * @param output_data_path * @param input_transport_unit_size * @param output_transport_unit_size * @param max_latency * @param packet_type * @param retransmission_effort *//* ... */ const hci_cmd_t hci_enhanced_accept_synchronous_connection = { HCI_OPCODE_HCI_ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION, "B4412212222441221222211111111221" ...}; /** * @param bd_addr * @param c_192 Simple Pairing Hash C derived from P-192 public key * @param r_192 Simple Pairing Randomizer derived from P-192 public key * @param c_256 Simple Pairing Hash C derived from P-256 public key * @param r_256 Simple Pairing Randomizer derived from P-256 public key *//* ... */ const hci_cmd_t hci_remote_oob_extended_data_request_reply = { HCI_OPCODE_HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY, "BKKKK" ...}; /** * Link Policy Commands *//* ... */ /** * @param handle * @param hold_mode_max_interval * 0.625 ms, range: 0x0002..0xFFFE; only even values are valid. * @param hold_mode_min_interval * 0.625 ms, range: 0x0002..0xFFFE; only even values are valid. *//* ... */ const hci_cmd_t hci_hold_mode = { HCI_OPCODE_HCI_HOLD_MODE, "H22" ...}; /** * @param handle * @param sniff_max_interval * @param sniff_min_interval * @param sniff_attempt * @param sniff_timeout *//* ... */ const hci_cmd_t hci_sniff_mode = { HCI_OPCODE_HCI_SNIFF_MODE, "H2222" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_exit_sniff_mode = { HCI_OPCODE_HCI_EXIT_SNIFF_MODE, "H" ...}; /** * @note Removed in Bluetooth Core v5.0 * @param handle * @param beacon_max_interval * 0.625 ms, range: 0x000E..0xFFFE; only even values are valid. * @param beacon_max_interval * 0.625 ms, range: 0x000E..0xFFFE; only even values are valid. *//* ... */ const hci_cmd_t hci_park_state = { HCI_OPCODE_HCI_PARK_STATE, "H22" ...}; /** * @note Removed in Bluetooth Core v5.0 * @param handle *//* ... */ const hci_cmd_t hci_exit_park_state = { HCI_OPCODE_HCI_EXIT_PARK_STATE, "H" ...}; /** * @param handle * @param flags * @param service_type * @param token_rate (bytes/s) * @param peak_bandwith (bytes/s) * @param latency (us) * @param delay_variation (us) *//* ... */ const hci_cmd_t hci_qos_setup = { HCI_OPCODE_HCI_QOS_SETUP, "H114444" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_role_discovery = { HCI_OPCODE_HCI_ROLE_DISCOVERY, "H" ...}; /** * @param bd_addr * @param role (0=master,1=slave) *//* ... */ const hci_cmd_t hci_switch_role_command= { HCI_OPCODE_HCI_SWITCH_ROLE_COMMAND, "B1" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_link_policy_settings = { HCI_OPCODE_HCI_READ_LINK_POLICY_SETTINGS, "H" ...}; /** * @param handle * @param settings *//* ... */ const hci_cmd_t hci_write_link_policy_settings = { HCI_OPCODE_HCI_WRITE_LINK_POLICY_SETTINGS, "H2" ...}; /** * @param handle * @param max_latency * @param min_remote_timeout * @param min_local_timeout *//* ... */ const hci_cmd_t hci_sniff_subrating = { HCI_OPCODE_HCI_SNIFF_SUBRATING, "H222" ...}; /** * @param policy *//* ... */ const hci_cmd_t hci_write_default_link_policy_setting = { HCI_OPCODE_HCI_WRITE_DEFAULT_LINK_POLICY_SETTING, "2" ...}; /** * @param handle * @param unused * @param flow_direction * @param service_type * @param token_rate * @param token_bucket_size * @param peak_bandwidth * @param access_latency *//* ... */ const hci_cmd_t hci_flow_specification = { HCI_OPCODE_HCI_FLOW_SPECIFICATION, "H1114444" ...}; /** * Controller & Baseband Commands *//* ... */ /** * @param event_mask_lower_octets * @param event_mask_higher_octets *//* ... */ const hci_cmd_t hci_set_event_mask = { HCI_OPCODE_HCI_SET_EVENT_MASK, "44" ...}; /** *//* ... */ const hci_cmd_t hci_reset = { HCI_OPCODE_HCI_RESET, "" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_flush = { HCI_OPCODE_HCI_FLUSH, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_pin_type = { HCI_OPCODE_HCI_READ_PIN_TYPE, "" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_write_pin_type = { HCI_OPCODE_HCI_WRITE_PIN_TYPE, "1" ...}; /** * @param bd_addr * @param delete_all_flags *//* ... */ const hci_cmd_t hci_delete_stored_link_key = { HCI_OPCODE_HCI_DELETE_STORED_LINK_KEY, "B1" ...}; #ifdef ENABLE_CLASSIC /** * @param local_name (UTF-8, Null Terminated, max 248 octets) *//* ... */ const hci_cmd_t hci_write_local_name = { HCI_OPCODE_HCI_WRITE_LOCAL_NAME, "N" ...};/* ... */ #endif /** *//* ... */ const hci_cmd_t hci_read_local_name = { HCI_OPCODE_HCI_READ_LOCAL_NAME, "" ...}; /** *//* ... */ const hci_cmd_t hci_read_page_timeout = { HCI_OPCODE_HCI_READ_PAGE_TIMEOUT, "" ...}; /** * @param page_timeout (* 0.625 ms) *//* ... */ const hci_cmd_t hci_write_page_timeout = { HCI_OPCODE_HCI_WRITE_PAGE_TIMEOUT, "2" ...}; /** * @param scan_enable (no, inq, page, inq+page) *//* ... */ const hci_cmd_t hci_write_scan_enable = { HCI_OPCODE_HCI_WRITE_SCAN_ENABLE, "1" ...}; /** *//* ... */ const hci_cmd_t hci_read_page_scan_activity = { HCI_OPCODE_HCI_READ_PAGE_SCAN_ACTIVITY, "" ...}; /** * @param page_scan_interval (* 0.625 ms) * @param page_scan_window (* 0.625 ms, must be <= page_scan_interval) *//* ... */ const hci_cmd_t hci_write_page_scan_activity = { HCI_OPCODE_HCI_WRITE_PAGE_SCAN_ACTIVITY, "22" ...}; /** *//* ... */ const hci_cmd_t hci_read_inquiry_scan_activity = { HCI_OPCODE_HCI_READ_INQUIRY_SCAN_ACTIVITY, "" ...}; /** * @param inquiry_scan_interval (* 0.625 ms) * @param inquiry_scan_window (* 0.625 ms, must be <= inquiry_scan_interval) *//* ... */ const hci_cmd_t hci_write_inquiry_scan_activity = { HCI_OPCODE_HCI_WRITE_INQUIRY_SCAN_ACTIVITY, "22" ...}; /** * @param authentication_enable *//* ... */ const hci_cmd_t hci_write_authentication_enable = { HCI_OPCODE_HCI_WRITE_AUTHENTICATION_ENABLE, "1" ...}; /** * @param handle * @param timeout, max 0x07FF *//* ... */ const hci_cmd_t hci_write_automatic_flush_timeout = { HCI_OPCODE_HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT, "H2" ...}; /** * @param class_of_device *//* ... */ const hci_cmd_t hci_write_class_of_device = { HCI_OPCODE_HCI_WRITE_CLASS_OF_DEVICE, "3" ...}; /** *//* ... */ const hci_cmd_t hci_read_num_broadcast_retransmissions = { HCI_OPCODE_HCI_READ_NUM_BROADCAST_RETRANSMISSIONS, "" ...}; /** * @param num_broadcast_retransmissions (e.g. 0 for a single broadcast) *//* ... */ const hci_cmd_t hci_write_num_broadcast_retransmissions = { HCI_OPCODE_HCI_WRITE_NUM_BROADCAST_RETRANSMISSIONS, "1" ...}; /** * @param connection_handle * @param type 0 = current transmit level, 1 = max transmit level *//* ... */ const hci_cmd_t hci_read_transmit_power_level = { HCI_OPCODE_HCI_READ_TRANSMIT_POWER_LEVEL, "H1" ...}; /** * @param synchronous_flow_control_enable - if yes, num completed packet everts are sent for SCO packets *//* ... */ const hci_cmd_t hci_write_synchronous_flow_control_enable = { HCI_OPCODE_HCI_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE, "1" ...}; #ifdef ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL /** * @param flow_control_enable - 0: off, 1: ACL only, 2: SCO only, 3: ACL + SCO *//* ... */ const hci_cmd_t hci_set_controller_to_host_flow_control = { HCI_OPCODE_HCI_SET_CONTROLLER_TO_HOST_FLOW_CONTROL, "1" ...}; /** * @param host_acl_data_packet_length * @param host_synchronous_data_packet_length * @param host_total_num_acl_data_packets * @param host_total_num_synchronous_data_packets *//* ... */ const hci_cmd_t hci_host_buffer_size = { HCI_OPCODE_HCI_HOST_BUFFER_SIZE, "2122" ...}; #if 0 // // command sent manually sent by hci_host_num_completed_packets // /** * @note only single handle supported by BTstack command generator * @param number_of_handles must be 1 * @param connection_handle * @param host_num_of_completed_packets for the given connection handle *//* ... */ const hci_cmd_t hci_host_number_of_completed_packets = { HCI_OPCODE_HCI_HOST_NUMBER_OF_COMPLETED_PACKETS, "1H2" ...};/* ... */ #endif /* ... */ #endif /** * @param handle *//* ... */ const hci_cmd_t hci_read_link_supervision_timeout = { HCI_OPCODE_HCI_READ_LINK_SUPERVISION_TIMEOUT, "H" ...}; /** * @param handle * @param timeout (0x0001 - 0xFFFF Time -> Range: 0.625ms - 40.9 sec) *//* ... */ const hci_cmd_t hci_write_link_supervision_timeout = { HCI_OPCODE_HCI_WRITE_LINK_SUPERVISION_TIMEOUT, "H2" ...}; /** * @param num_current_iac must be 2 * @param iac_lap1 * @param iac_lap2 *//* ... */ const hci_cmd_t hci_write_current_iac_lap_two_iacs = { HCI_OPCODE_HCI_WRITE_CURRENT_IAC_LAP_TWO_IACS, "133" ...}; /** * @param inquiry_scan_type (0x00 = standard, 0x01 = interlaced) *//* ... */ const hci_cmd_t hci_write_inquiry_scan_type = { HCI_OPCODE_HCI_WRITE_INQUIRY_SCAN_TYPE, "1" ...}; /** * @param inquiry_mode (0x00 = standard, 0x01 = with RSSI, 0x02 = extended) *//* ... */ const hci_cmd_t hci_write_inquiry_mode = { HCI_OPCODE_HCI_WRITE_INQUIRY_MODE, "1" ...}; /** * @param page_scan_type (0x00 = standard, 0x01 = interlaced) *//* ... */ const hci_cmd_t hci_write_page_scan_type = { HCI_OPCODE_HCI_WRITE_PAGE_SCAN_TYPE, "1" ...}; /** * @param fec_required * @param exstended_inquiry_response *//* ... */ const hci_cmd_t hci_write_extended_inquiry_response = { HCI_OPCODE_HCI_WRITE_EXTENDED_INQUIRY_RESPONSE, "1E" ...}; /** * @param mode (0 = off, 1 = on) *//* ... */ const hci_cmd_t hci_write_simple_pairing_mode = { HCI_OPCODE_HCI_WRITE_SIMPLE_PAIRING_MODE, "1" ...}; /** *//* ... */ const hci_cmd_t hci_read_local_oob_data = { HCI_OPCODE_HCI_READ_LOCAL_OOB_DATA, "" // return status, C, R ...}; /** *//* ... */ const hci_cmd_t hci_read_inquiry_response_transmit_power_level = { HCI_OPCODE_HCI_READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL, "" // return status, pwr level ...}; /** *//* ... */ const hci_cmd_t hci_write_inquiry_transmit_power_level = { HCI_OPCODE_HCI_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL, "1" // return status ...}; /** * @param mode (0 = off, 1 = on) *//* ... */ const hci_cmd_t hci_write_default_erroneous_data_reporting = { HCI_OPCODE_HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING, "1" ...}; /** * @param event_mask_page_2_lower_octets * @param event_mask_page_2_higher_octets *//* ... */ const hci_cmd_t hci_set_event_mask_2 = { HCI_OPCODE_HCI_SET_EVENT_MASK_2, "44" ...}; /** *//* ... */ const hci_cmd_t hci_read_le_host_supported = { HCI_OPCODE_HCI_READ_LE_HOST_SUPPORTED, "" // return: status, le supported host, simultaneous le host ...}; /** * @param le_supported_host * @param simultaneous_le_host *//* ... */ const hci_cmd_t hci_write_le_host_supported = { HCI_OPCODE_HCI_WRITE_LE_HOST_SUPPORTED, "11" // return: status ...}; /** * @param secure_connections_host_support *//* ... */ const hci_cmd_t hci_write_secure_connections_host_support = { HCI_OPCODE_HCI_WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, "1" // return: status ...}; /** *//* ... */ const hci_cmd_t hci_read_local_extended_oob_data = { HCI_OPCODE_HCI_READ_LOCAL_EXTENDED_OOB_DATA, "" // return status, C_192, R_192, R_256, C_256 ...}; /** *//* ... */ const hci_cmd_t hci_read_extended_page_timeout = { HCI_OPCODE_HCI_READ_EXTENDED_PAGE_TIMEOUT, "" // return: status, extender page timeout ...}; /** * @param extended_page_timeout *//* ... */ const hci_cmd_t hci_write_extended_page_timeout = { HCI_OPCODE_HCI_WRITE_EXTENDED_PAGE_TIMEOUT, "2" // return: status ...}; /** *//* ... */ const hci_cmd_t hci_read_extended_inquiry_length = { HCI_OPCODE_HCI_READ_EXTENDED_INQUIRY_LENGTH, "" // return: status, extended_inquiry_length ...}; /** * @param extended_inquiry_length *//* ... */ const hci_cmd_t hci_write_extended_inquiry_length = { HCI_OPCODE_HCI_WRITE_EXTENDED_INQUIRY_LENGTH, "2" // return: status ...}; /** * @param interval *//* ... */ const hci_cmd_t hci_set_ecosystem_base_interval = { HCI_OPCODE_HCI_SET_ECOSYSTEM_BASE_INTERVAL, "2" // return: status ...}; /** * @param data_path_direction * @param data_path_id * @param vendor_specific_config_length * @param vendor_specific_config *//* ... */ const hci_cmd_t hci_configure_data_path = { HCI_OPCODE_HCI_CONFIGURE_DATA_PATH, "11JV" // return: status ...}; /** * @param min_encryption_key_size *//* ... */ const hci_cmd_t hci_set_min_encryption_key_size = { HCI_OPCODE_HCI_SET_MIN_ENCRYPTION_KEY_SIZE, "1" // return: status ...}; /** * Testing Commands *//* ... */ /** *//* ... */ const hci_cmd_t hci_read_loopback_mode = { HCI_OPCODE_HCI_READ_LOOPBACK_MODE, "" // return: status, loopback mode (0 = off, 1 = local loopback, 2 = remote loopback) ...}; /** * @param loopback_mode *//* ... */ const hci_cmd_t hci_write_loopback_mode = { HCI_OPCODE_HCI_WRITE_LOOPBACK_MODE, "1" // return: status ...}; /** *//* ... */ const hci_cmd_t hci_enable_device_under_test_mode = { HCI_OPCODE_HCI_ENABLE_DEVICE_UNDER_TEST_MODE, "" // return: status ...}; /** * @param simple_pairing_debug_mode *//* ... */ const hci_cmd_t hci_write_simple_pairing_debug_mode = { HCI_OPCODE_HCI_WRITE_SIMPLE_PAIRING_DEBUG_MODE, "1" // return: status ...}; /** * @param handle * @param dm1_acl_u_mode * @param esco_loopback_mode *//* ... */ const hci_cmd_t hci_write_secure_connections_test_mode = { HCI_OPCODE_HCI_WRITE_SECURE_CONNECTIONS_TEST_MODE, "H11" // return: status ...}; /** * Informational Parameters *//* ... */ const hci_cmd_t hci_read_local_version_information = { HCI_OPCODE_HCI_READ_LOCAL_VERSION_INFORMATION, "" ...}; const hci_cmd_t hci_read_local_supported_commands = { HCI_OPCODE_HCI_READ_LOCAL_SUPPORTED_COMMANDS, "" ...}; const hci_cmd_t hci_read_local_supported_features = { HCI_OPCODE_HCI_READ_LOCAL_SUPPORTED_FEATURES, "" ...}; const hci_cmd_t hci_read_buffer_size = { HCI_OPCODE_HCI_READ_BUFFER_SIZE, "" ...}; const hci_cmd_t hci_read_bd_addr = { HCI_OPCODE_HCI_READ_BD_ADDR, "" ...}; /** * Status Paramteers *//* ... */ /** * @param handle *//* ... */ const hci_cmd_t hci_read_failed_contact_counter = { HCI_OPCODE_HCI_READ_FAILED_CONTACT_COUNTER, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_reset_failed_contact_counter = { HCI_OPCODE_HCI_RESET_FAILED_CONTACT_COUNTER, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_link_quality = { HCI_OPCODE_HCI_READ_LINK_QUALITY, "H" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_rssi = { HCI_OPCODE_HCI_READ_RSSI, "H" ...}; /** * @param handle * @param which_clock *//* ... */ const hci_cmd_t hci_read_clock = { HCI_OPCODE_HCI_READ_CLOCK, "H1" ...}; /** * @param handle *//* ... */ const hci_cmd_t hci_read_encryption_key_size = { HCI_OPCODE_HCI_READ_ENCRYPTION_KEY_SIZE, "H" ...}; #ifdef ENABLE_BLE /** * Low Energy Commands *//* ... */ /** * @param event_mask_lower_octets * @param event_mask_higher_octets *//* ... */ const hci_cmd_t hci_le_set_event_mask = { HCI_OPCODE_HCI_LE_SET_EVENT_MASK, "44" // return: status ...}; const hci_cmd_t hci_le_read_buffer_size = { HCI_OPCODE_HCI_LE_READ_BUFFER_SIZE, "" // return: status, le acl data packet len (16), total num le acl data packets(8) ...}; const hci_cmd_t hci_le_read_local_supported_features = { HCI_OPCODE_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES, "" // return: LE_Features See [Vol 6] Part B, Section 4.6 ...}; /** * @param random_bd_addr *//* ... */ const hci_cmd_t hci_le_set_random_address = { HCI_OPCODE_HCI_LE_SET_RANDOM_ADDRESS, "B" // return: status ...}; /** * @param advertising_interval_min ([0x0020,0x4000], default: 0x0800, unit: 0.625 msec) * @param advertising_interval_max ([0x0020,0x4000], default: 0x0800, unit: 0.625 msec) * @param advertising_type (enum from 0: ADV_IND, ADC_DIRECT_IND, ADV_SCAN_IND, ADV_NONCONN_IND) * @param own_address_type (enum from 0: public device address, random device address) * @param direct_address_type () * @param direct_address (public or random address of device to be connecteed) * @param advertising_channel_map (flags: chan_37(1), chan_38(2), chan_39(4)) * @param advertising_filter_policy (enum from 0: scan any conn any, scan whitelist, con any, scan any conn whitelist, scan whitelist, con whitelist) *//* ... */ const hci_cmd_t hci_le_set_advertising_parameters = { HCI_OPCODE_HCI_LE_SET_ADVERTISING_PARAMETERS, "22111B11" // return: status ...}; const hci_cmd_t hci_le_read_advertising_channel_tx_power = { HCI_OPCODE_HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER, "" // return: status, level [-20,10] signed int (8), units dBm ...}; /** * @param advertising_data_length * @param advertising_data (31 bytes) *//* ... */ const hci_cmd_t hci_le_set_advertising_data= { HCI_OPCODE_HCI_LE_SET_ADVERTISING_DATA, "1A" // return: status ...}; /** * @param scan_response_data_length * @param scan_response_data (31 bytes) *//* ... */ const hci_cmd_t hci_le_set_scan_response_data= { HCI_OPCODE_HCI_LE_SET_SCAN_RESPONSE_DATA, "1A" // return: status ...}; /** * @param advertise_enable (off: 0, on: 1) *//* ... */ const hci_cmd_t hci_le_set_advertise_enable = { HCI_OPCODE_HCI_LE_SET_ADVERTISE_ENABLE, "1" // return: status ...}; /** * @param le_scan_type (passive (0), active (1)) * @param le_scan_interval ([0x0004,0x4000], unit: 0.625 msec) * @param le_scan_window ([0x0004,0x4000], unit: 0.625 msec) * @param own_address_type (public (0), random (1)) * @param scanning_filter_policy (any (0), only whitelist (1)) *//* ... */ const hci_cmd_t hci_le_set_scan_parameters = { HCI_OPCODE_HCI_LE_SET_SCAN_PARAMETERS, "12211" // return: status ...}; /** * @param le_scan_enable (disabled (0), enabled (1)) * @param filter_duplices (disabled (0), enabled (1)) *//* ... */ const hci_cmd_t hci_le_set_scan_enable = { HCI_OPCODE_HCI_LE_SET_SCAN_ENABLE, "11" // return: status ...}; /** * @param le_scan_interval ([0x0004, 0x4000], unit: 0.625 msec) * @param le_scan_window ([0x0004, 0x4000], unit: 0.625 msec) * @param initiator_filter_policy (peer address type + peer address (0), whitelist (1)) * @param peer_address_type (public (0), random (1)) * @param peer_address * @param own_address_type (public (0), random (1)) * @param conn_interval_min ([0x0006, 0x0c80], unit: 1.25 msec) * @param conn_interval_max ([0x0006, 0x0c80], unit: 1.25 msec) * @param conn_latency (number of connection events [0x0000, 0x01f4]) * @param supervision_timeout ([0x000a, 0x0c80], unit: 10 msec) * @param minimum_CE_length ([0x0000, 0xffff], unit: 0.625 msec) * @param maximum_CE_length ([0x0000, 0xffff], unit: 0.625 msec) *//* ... */ const hci_cmd_t hci_le_create_connection= { HCI_OPCODE_HCI_LE_CREATE_CONNECTION, "2211B1222222" // return: none -> le create connection complete event ...}; const hci_cmd_t hci_le_create_connection_cancel = { HCI_OPCODE_HCI_LE_CREATE_CONNECTION_CANCEL, "" // return: status ...}; const hci_cmd_t hci_le_read_white_list_size = { HCI_OPCODE_HCI_LE_READ_WHITE_LIST_SIZE, "" // return: status, number of entries in controller whitelist ...}; const hci_cmd_t hci_le_clear_white_list = { HCI_OPCODE_HCI_LE_CLEAR_WHITE_LIST, "" // return: status ...}; /** * @param address_type (public (0), random (1)) * @param bd_addr *//* ... */ const hci_cmd_t hci_le_add_device_to_white_list = { HCI_OPCODE_HCI_LE_ADD_DEVICE_TO_WHITE_LIST, "1B" // return: status ...}; /** * @param address_type (public (0), random (1)) * @param bd_addr *//* ... */ const hci_cmd_t hci_le_remove_device_from_white_list = { HCI_OPCODE_HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST, "1B" // return: status ...}; /** * @param conn_handle * @param conn_interval_min ([0x0006,0x0c80], unit: 1.25 msec) * @param conn_interval_max ([0x0006,0x0c80], unit: 1.25 msec) * @param conn_latency ([0x0000,0x03e8], number of connection events) * @param supervision_timeout ([0x000a,0x0c80], unit: 10 msec) * @param minimum_CE_length ([0x0000,0xffff], unit: 0.625 msec) * @param maximum_CE_length ([0x0000,0xffff], unit: 0.625 msec) *//* ... */ const hci_cmd_t hci_le_connection_update = { HCI_OPCODE_HCI_LE_CONNECTION_UPDATE, "H222222" // return: none -> le connection update complete event ...}; /** * @param channel_map_lower_32bits * @param channel_map_higher_5bits *//* ... */ const hci_cmd_t hci_le_set_host_channel_classification = { HCI_OPCODE_HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION, "41" // return: status ...}; /** * @param conn_handle *//* ... */ const hci_cmd_t hci_le_read_channel_map = { HCI_OPCODE_HCI_LE_READ_CHANNEL_MAP, "H" // return: status, connection handle, channel map (5 bytes, 37 used) ...}; /** * @param conn_handle *//* ... */ const hci_cmd_t hci_le_read_remote_used_features = { HCI_OPCODE_HCI_LE_READ_REMOTE_USED_FEATURES, "H" // return: none -> le read remote used features complete event ...}; /** * @param key ((128) for AES-128) * @param plain_text (128) *//* ... */ const hci_cmd_t hci_le_encrypt = { HCI_OPCODE_HCI_LE_ENCRYPT, "PP" // return: status, encrypted data (128) ...}; const hci_cmd_t hci_le_rand = { HCI_OPCODE_HCI_LE_RAND, "" // return: status, random number (64) ...}; /** * @param conn_handle * @param random_number_lower_32bits * @param random_number_higher_32bits * @param encryption_diversifier (16) * @param long_term_key (128) *//* ... */ const hci_cmd_t hci_le_start_encryption = { HCI_OPCODE_HCI_LE_START_ENCRYPTION, "H442P" // return: none -> encryption changed or encryption key refresh complete event ...}; /** * @param connection_handle * @param long_term_key (128) *//* ... */ const hci_cmd_t hci_le_long_term_key_request_reply = { HCI_OPCODE_HCI_LE_LONG_TERM_KEY_REQUEST_REPLY, "HP" // return: status, connection handle ...}; /** * @param conn_handle *//* ... */ const hci_cmd_t hci_le_long_term_key_negative_reply = { HCI_OPCODE_HCI_LE_LONG_TERM_KEY_NEGATIVE_REPLY, "H" // return: status, connection handle ...}; /** * @param conn_handle *//* ... */ const hci_cmd_t hci_le_read_supported_states = { HCI_OPCODE_HCI_LE_READ_SUPPORTED_STATES, "H" // return: status, LE states (64) ...}; /** * @param rx_frequency ([0x00 0x27], frequency (MHz): 2420 + N*2) *//* ... */ const hci_cmd_t hci_le_receiver_test = { HCI_OPCODE_HCI_LE_RECEIVER_TEST, "1" // return: status ...}; /** * @param tx_frequency ([0x00 0x27], frequency (MHz): 2420 + N*2) * @param test_payload_lengh ([0x00,0x25]) * @param packet_payload ([0,7] different patterns) *//* ... */ const hci_cmd_t hci_le_transmitter_test = { HCI_OPCODE_HCI_LE_TRANSMITTER_TEST, "111" // return: status ...}; /** * @param end_test_cmd *//* ... */ const hci_cmd_t hci_le_test_end = { HCI_OPCODE_HCI_LE_TEST_END, "1" // return: status, number of packets (8) ...}; /** * @param conn_handle * @param conn_interval_min ([0x0006,0x0c80], unit: 1.25 msec) * @param conn_interval_max ([0x0006,0x0c80], unit: 1.25 msec) * @param conn_latency ([0x0000,0x03e8], number of connection events) * @param supervision_timeout ([0x000a,0x0c80], unit: 10 msec) * @param minimum_CE_length ([0x0000,0xffff], unit: 0.625 msec) * @param maximum_CE_length ([0x0000,0xffff], unit: 0.625 msec) *//* ... */ const hci_cmd_t hci_le_remote_connection_parameter_request_reply = { HCI_OPCODE_HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY, "H222222" // return: status, connection handle ...}; /** * @param con_handle * @param reason *//* ... */ const hci_cmd_t hci_le_remote_connection_parameter_request_negative_reply = { HCI_OPCODE_HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY, "H1" // return: status, connection handle ...}; /** * @param con_handle * @param tx_octets * @param tx_time *//* ... */ const hci_cmd_t hci_le_set_data_length = { HCI_OPCODE_HCI_LE_SET_DATA_LENGTH, "H22" // return: status, connection handle ...}; /** *//* ... */ const hci_cmd_t hci_le_read_suggested_default_data_length = { HCI_OPCODE_HCI_LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH, "" // return: status, suggested max tx octets, suggested max tx time ...}; /** * @param suggested_max_tx_octets * @param suggested_max_tx_time *//* ... */ const hci_cmd_t hci_le_write_suggested_default_data_length = { HCI_OPCODE_HCI_LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH, "22" // return: status ...}; /** *//* ... */ const hci_cmd_t hci_le_read_local_p256_public_key = { HCI_OPCODE_HCI_LE_READ_LOCAL_P256_PUBLIC_KEY, "" // LE Read Local P-256 Public Key Complete is generated on completion ...}; /** * @param public key * @param private key *//* ... */ const hci_cmd_t hci_le_generate_dhkey = { HCI_OPCODE_HCI_LE_GENERATE_DHKEY, "QQ" // LE Generate DHKey Complete is generated on completion ...}; /** * @param Peer_Identity_Address_Type * @param Peer_Identity_Address * @param Peer_IRK * @param Local_IRK *//* ... */ const hci_cmd_t hci_le_add_device_to_resolving_list = { HCI_OPCODE_HCI_LE_ADD_DEVICE_TO_RESOLVING_LIST, "1BPP" ...}; /** * @param Peer_Identity_Address_Type * @param Peer_Identity_Address *//* ... */ const hci_cmd_t hci_le_remove_device_from_resolving_list = { HCI_OPCODE_HCI_LE_REMOVE_DEVICE_FROM_RESOLVING_LIST, "1B" ...}; /** *//* ... */ const hci_cmd_t hci_le_clear_resolving_list = { HCI_OPCODE_HCI_LE_CLEAR_RESOLVING_LIST, "" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_resolving_list_size = { HCI_OPCODE_HCI_LE_READ_RESOLVING_LIST_SIZE, "" ...}; /** * @param Peer_Identity_Address_Type * @param Peer_Identity_Address *//* ... */ const hci_cmd_t hci_le_read_peer_resolvable_address = { HCI_OPCODE_HCI_LE_READ_PEER_RESOLVABLE_ADDRESS, "" ...}; /** * @param Peer_Identity_Address_Type * @param Peer_Identity_Address *//* ... */ const hci_cmd_t hci_le_read_local_resolvable_address = { HCI_OPCODE_HCI_LE_READ_LOCAL_RESOLVABLE_ADDRESS, "" ...}; /** * @param Address_Resolution_Enable *//* ... */ const hci_cmd_t hci_le_set_address_resolution_enabled= { HCI_OPCODE_HCI_LE_SET_ADDRESS_RESOLUTION_ENABLED, "1" ...}; /** * @param RPA_Timeout in seconds, range 0x0001 to 0x0E10, default: 900 s *//* ... */ const hci_cmd_t hci_le_set_resolvable_private_address_timeout= { HCI_OPCODE_HCI_LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, "2" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_maximum_data_length = { HCI_OPCODE_HCI_LE_READ_MAXIMUM_DATA_LENGTH, "" // return: status, supported max tx octets, supported max tx time, supported max rx octets, supported max rx time ...}; /** * @param con_handle *//* ... */ const hci_cmd_t hci_le_read_phy = { HCI_OPCODE_HCI_LE_READ_PHY, "H" // return: status, connection handler, tx phy, rx phy ...}; /** * @param all_phys * @param tx_phys * @param rx_phys *//* ... */ const hci_cmd_t hci_le_set_default_phy = { HCI_OPCODE_HCI_LE_SET_DEFAULT_PHY, "111" // return: status ...}; /** * @param con_handle * @param all_phys * @param tx_phys * @param rx_phys * @param phy_options *//* ... */ const hci_cmd_t hci_le_set_phy = { HCI_OPCODE_HCI_LE_SET_PHY, "H1112" // LE PHY Update Complete is generated on completion ...}; /** * @param rx_channel * @param phy * @param modulation_index *//* ... */ const hci_cmd_t hci_le_receiver_test_v2 = { HCI_OPCODE_HCI_LE_RECEIVER_TEST_V2, "111" ...}; /** * @param tx_channel * @param test_data_length * @param packet_payload * @param phy *//* ... */ const hci_cmd_t hci_le_transmitter_test_v2 = { HCI_OPCODE_HCI_LE_TRANSMITTER_TEST_V2, "1111" ...}; /** * @param advertising_handle * @param random_address *//* ... */ const hci_cmd_t hci_le_set_advertising_set_random_address = { HCI_OPCODE_HCI_LE_SET_ADVERTISING_SET_RANDOM_ADDRESS, "1B" ...}; /** * @param advertising_handle * @param advertising_event_properties * @param primary_advertising_interval_min in 0.625 ms, range: 0x000020..0xffffff * @param primary_advertising_interval_max in 0.625 ms, range: 0x000020..0xffffff * @param primary_advertising_channel_map * @param own_address_type * @param peer_address_type * @param peer_address * @param advertising_filter_policy * @param advertising_tx_power in dBm, range: -127..20 * @param primary_advertising_phy * @param secondary_advertising_max_skip * @param secondary_advertising_phy * @param advertising_sid * @param scan_request_notification_enable *//* ... */ const hci_cmd_t hci_le_set_extended_advertising_parameters = { HCI_OPCODE_HCI_LE_SET_EXTENDED_ADVERTISING_PARAMETERS, "1233111B1111111" ...}; /** * @param advertising_handle * @param operation * @param fragment_preference * @param advertising_data_length * @param advertising_data *//* ... */ const hci_cmd_t hci_le_set_extended_advertising_data = { HCI_OPCODE_HCI_LE_SET_EXTENDED_ADVERTISING_DATA, "111JV" ...}; /** * @param advertising_handle * @param operation * @param fragment_preference * @param scan_response_data_length * @param scan_response_data *//* ... */ const hci_cmd_t hci_le_set_extended_scan_response_data = { HCI_OPCODE_HCI_LE_SET_EXTENDED_SCAN_RESPONSE_DATA, "111JV" ...}; /** * @param enable * @param num_sets * @param advertising_handle[i] * @param duration[i] * @param max_extended_advertising_events[i] *//* ... */ const hci_cmd_t hci_le_set_extended_advertising_enable = { HCI_OPCODE_HCI_LE_SET_EXTENDED_ADVERTISING_ENABLE, "1a[121]" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_maximum_advertising_data_length = { HCI_OPCODE_HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH, "" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_number_of_supported_advertising_sets = { HCI_OPCODE_HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS, "" ...}; /** * @param advertising_handle *//* ... */ const hci_cmd_t hci_le_remove_advertising_set = { HCI_OPCODE_HCI_LE_REMOVE_ADVERTISING_SET, "1" ...}; /** *//* ... */ const hci_cmd_t hci_le_clear_advertising_sets = { HCI_OPCODE_HCI_LE_CLEAR_ADVERTISING_SETS, "" ...}; /** * @param advertising_handle * @param periodic_advertising_interval_min * 1.25 ms, range 0x0006..0xffff * @param periodic_advertising_interval_max * 1.25 ms, range 0x0006..0xffff * @param periodic_advertising_properties *//* ... */ const hci_cmd_t hci_le_set_periodic_advertising_parameters = { HCI_OPCODE_HCI_LE_SET_PERIODIC_ADVERTISING_PARAMETERS, "1222" ...}; /** * @param advertising_handle * @param operation * @param advertising_data_length * @param advertising_data *//* ... */ const hci_cmd_t hci_le_set_periodic_advertising_data = { HCI_OPCODE_HCI_LE_SET_PERIODIC_ADVERTISING_DATA, "11JV" ...}; /** * @param enable * @param advertising_handle *//* ... */ const hci_cmd_t hci_le_set_periodic_advertising_enable = { HCI_OPCODE_HCI_LE_SET_PERIODIC_ADVERTISING_ENABLE, "11" ...}; /** * @param own_address_type * @param scanning_filter_policy * @param scanning_phys 0 = LE 1M PHY | 2 = LE Coded PHY * @param scan_type[i] * @param scan_interval[i] * 0.625, range = 0x0004..0xffff * @param scan_window[i] * 0.625, range = 0x0004..0xffff *//* ... */ const hci_cmd_t hci_le_set_extended_scan_parameters = { HCI_OPCODE_HCI_LE_SET_EXTENDED_SCAN_PARAMETERS, "11b[122]" ...}; /** * @param enable * @param filter_duplicates * @param duration 0 = Scan continuously until explicitly disable, 10 ms * @param period 0 = Scan continuously, 1.28 s *//* ... */ const hci_cmd_t hci_le_set_extended_scan_enable = { HCI_OPCODE_HCI_LE_SET_EXTENDED_SCAN_ENABLE, "1122" ...}; /** * @param initiator_filter_policy * @param own_address_type * @param peer_address_type * @param peer_address * @param initiating_phys with bit 0 = LE 1M PHY, bit 1 = LE 2M PHY, bit 2 = Coded PHY * @param scan_interval[i] * 0.625 ms * @param scan_window[i] * 0.625 ms * @param connection_interval_min[i] * 1.25 ms * @param connection_interval_max[i] * 1.25 ms * @param connection_latency[i] * @param supervision_timeout[i] * 10 ms * @param min_ce_length[i] * 0.625 ms * @param max_ce_length[i] * 0.625 ms *//* ... */ const hci_cmd_t hci_le_extended_create_connection = { HCI_OPCODE_HCI_LE_EXTENDED_CREATE_CONNECTION, "111Bb[22222222]" ...}; /** * @param options * @param advertising_sid * @param advertiser_address_type * @param advertiser_address * @param skip * @param sync_timeout * 10 ms * @param sync_cte_type *//* ... */ const hci_cmd_t hci_le_periodic_advertising_create_sync = { HCI_OPCODE_HCI_LE_PERIODIC_ADVERTISING_CREATE_SYNC, "111B221" ...}; /** *//* ... */ const hci_cmd_t hci_le_periodic_advertising_create_sync_cancel = { HCI_OPCODE_HCI_LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL, "" ...}; /** * @param sync_handle *//* ... */ const hci_cmd_t hci_le_periodic_advertising_terminate_sync = { HCI_OPCODE_HCI_LE_PERIODIC_ADVERTISING_TERMINATE_SYNC, "2" ...}; /** * @param advertiser_address_type * @param advertiser_address * @param advertising_sid *//* ... */ const hci_cmd_t hci_le_add_device_to_periodic_advertiser_list = { HCI_OPCODE_HCI_LE_ADD_DEVICE_TO_PERIODIC_ADVERTISER_LIST, "1B1" ...}; /** * @param advertiser_address_type * @param advertiser_address * @param advertising_sid *//* ... */ const hci_cmd_t hci_le_remove_device_from_periodic_advertiser_list = { HCI_OPCODE_HCI_LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISER_LIST, "1B1" ...}; /** *//* ... */ const hci_cmd_t hci_le_clear_periodic_advertiser_list = { HCI_OPCODE_HCI_LE_CLEAR_PERIODIC_ADVERTISER_LIST, "" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_periodic_advertiser_list_size = { HCI_OPCODE_HCI_LE_READ_PERIODIC_ADVERTISER_LIST_SIZE, "" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_transmit_power = { HCI_OPCODE_HCI_LE_READ_TRANSMIT_POWER, "" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_rf_path_compensation = { HCI_OPCODE_HCI_LE_READ_RF_PATH_COMPENSATION, "" ...}; /** * @param rf_tx_path_compensation_value * 0.1 dB, signed * @param rf_rx_path_compensation_value * 0.1 dB, signed *//* ... */ const hci_cmd_t hci_le_write_rf_path_compensation = { HCI_OPCODE_HCI_LE_WRITE_RF_PATH_COMPENSATION, "22" ...}; /** * @param peer_identity_address_type * @param peer_identity_address * @param privacy_mode *//* ... */ const hci_cmd_t hci_le_set_privacy_mode = { HCI_OPCODE_HCI_LE_SET_PRIVACY_MODE, "1B1" ...}; /** * @param rx_channel * @param phy * @param modulation_index * @param expected_cte_length * @param expected_cte_type * @param slot_durations * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_receiver_test_v3 = { HCI_OPCODE_HCI_LE_RECEIVER_TEST_V3, "111111a[1]" ...}; /** * @param tx_channel * @param test_data_length * @param packet_payload * @param phy * @param cte_length * @param cte_type * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_transmitter_test_v3 = { HCI_OPCODE_HCI_LE_TRANSMITTER_TEST_V3, "111111a[1]" ...}; /** * @param advertising_handle * @param cte_length * @param cte_type * @param cte_count * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_set_connectionless_cte_transmit_parameters = { HCI_OPCODE_HCI_LE_SET_CONNECTIONLESS_CTE_TRANSMIT_PARAMETERS, "1111a[1]" ...}; /** * @param advertising_handle * @param cte_enable *//* ... */ const hci_cmd_t hci_le_set_connectionless_cte_transmit_enable = { HCI_OPCODE_HCI_LE_SET_CONNECTIONLESS_CTE_TRANSMIT_ENABLE, "11" ...}; /** * @param sync_handle * @param sampling_enable * @param slot_durations * @param max_sampled_ctes * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_set_connectionless_iq_sampling_enable = { HCI_OPCODE_HCI_LE_SET_CONNECTIONLESS_IQ_SAMPLING_ENABLE, "2111a[i]" ...}; /** * @param connection_handle * @param sampling_enable * @param slot_durations * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_set_connection_cte_receive_parameters = { HCI_OPCODE_HCI_LE_SET_CONNECTION_CTE_RECEIVE_PARAMETERS, "211a[1]" ...}; /** * @param connection_handle * @param cte_types * @param switching_pattern_length * @param antenna_ids[i] *//* ... */ const hci_cmd_t hci_le_set_connection_cte_transmit_parameters = { HCI_OPCODE_HCI_LE_SET_CONNECTION_CTE_TRANSMIT_PARAMETERS, "21a[1]" ...}; /** * @param connection_handle * @param enable * @param cte_request_interval * @param requested_cte_length * @param requested_cte_type *//* ... */ const hci_cmd_t hci_le_connection_cte_request_enable = { HCI_OPCODE_HCI_LE_CONNECTION_CTE_REQUEST_ENABLE, "H1211" ...}; /** * @param connection_handle * @param enable *//* ... */ const hci_cmd_t hci_le_connection_cte_response_enable = { HCI_OPCODE_HCI_LE_CONNECTION_CTE_RESPONSE_ENABLE, "H1" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_antenna_information = { HCI_OPCODE_HCI_LE_READ_ANTENNA_INFORMATION, "" ...}; /** * @param sync_handle * @param enable *//* ... */ const hci_cmd_t hci_le_set_periodic_advertising_receive_enable = { HCI_OPCODE_HCI_LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE, "H1" ...}; /** * @param connection_handle * @param service_data * @param sync_handle *//* ... */ const hci_cmd_t hci_le_periodic_advertising_sync_transfer = { HCI_OPCODE_HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER, "H22" ...}; /** * @param connection_handle * @param service_data * @param advertising_handle *//* ... */ const hci_cmd_t hci_le_periodic_advertising_set_info_transfer = { HCI_OPCODE_HCI_LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER, "H21" ...}; /** * @param connection_handle * @param mode * @param skip * @param sync_timeout * @param cte_type *//* ... */ const hci_cmd_t hci_le_set_periodic_advertising_sync_transfer_parameters = { HCI_OPCODE_HCI_LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS, "H1221" ...}; /** * @param mode * @param skip * @param sync_timeout * @param cte_type *//* ... */ const hci_cmd_t hci_le_set_default_periodic_advertising_sync_transfer_parameters = { HCI_OPCODE_HCI_LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS, "1221" ...}; /** * @param 256Remote_P-256_public_key_x * @param 256Remote_P-256_public_key_y * @param key_type *//* ... */ const hci_cmd_t hci_le_generate_dhkey_v2 = { HCI_OPCODE_HCI_LE_GENERATE_DHKEY_V2, "QQ1" ...}; /** * @param action *//* ... */ const hci_cmd_t hci_le_modify_sleep_clock_accuracy = { HCI_OPCODE_HCI_LE_MODIFY_SLEEP_CLOCK_ACCURACY, "1" ...}; /** *//* ... */ const hci_cmd_t hci_le_read_buffer_size_v2 = { HCI_OPCODE_HCI_LE_READ_BUFFER_SIZE_V2, "" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_read_iso_tx_sync = { HCI_OPCODE_HCI_LE_READ_ISO_TX_SYNC, "H" ...}; /** * @param cig_id * @param sdu_interval_m_to_s * @param sdu_interval_s_to_m * @param slaves_clock_accuracy * @param packing * @param framing * @param max_transport_latency_m_to_s * @param max_transport_latency_s_to_m * @param cis_count * @param cis_id[i] * @param max_sdu_m_to_s[i] * @param max_sdu_s_to_m[i] * @param phy_m_to_s[i] * @param phy_s_to_m[i] * @param rtn_m_to_s[i] * @param rtn_s_to_m[i] *//* ... */ const hci_cmd_t hci_le_set_cig_parameters = { HCI_OPCODE_HCI_LE_SET_CIG_PARAMETERS, "13311122a[1221111]" ...}; /** * @param cig_id * @param sdu_interval_m_to_s * @param sdu_interval_s_to_m * @param ft_m_to_s * @param ft_s_to_m * @param iso_interval * @param slaves_clock_accuracy * @param packing * @param framing * @param max_transport_latency_m_to_s * @param max_transport_latency_s_to_m * @param cis_count * @param cis_id[i] * @param nse[i] * @param max_sdu_m_to_s[i] * @param max_sdu_s_to_m[i] * @param max_pdu_m_to_s[i] * @param max_pdu_s_to_m[i] * @param phy_m_to_s[i] * @param phy_s_to_m[i] * @param bn_m_to_s[i] * @param bn_s_to_m[i] *//* ... */ const hci_cmd_t hci_le_set_cig_parameters_test = { HCI_OPCODE_HCI_LE_SET_CIG_PARAMETERS_TEST, "133112111a[1122221111]" ...}; /** * @param cis_count * @param cis_connection_handle[i] * @param acl_connection_handle[i] *//* ... */ const hci_cmd_t hci_le_create_cis = { HCI_OPCODE_HCI_LE_CREATE_CIS, "a[22]" ...}; /** * @param cig_id *//* ... */ const hci_cmd_t hci_le_remove_cig = { HCI_OPCODE_HCI_LE_REMOVE_CIG, "1" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_accept_cis_request = { HCI_OPCODE_HCI_LE_ACCEPT_CIS_REQUEST, "H" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_reject_cis_request = { HCI_OPCODE_HCI_LE_REJECT_CIS_REQUEST, "H1" ...}; /** * @param big_handle * @param advertising_handle * @param num_bis * @param sdu_interval * @param max_sdu * @param max_transport_latency * @param rtn * @param phy * @param packing * @param framing * @param encryption * @param broadcast_code *//* ... */ const hci_cmd_t hci_le_create_big = { HCI_OPCODE_HCI_LE_CREATE_BIG, "11132211111K" ...}; /** * @param big_handle * @param advertising_handle * @param num_bis * @param sdu_interval * @param iso_interval * @param nse * @param max_sdu * @param max_PDU * @param phy * @param packing * @param framing * @param bn * @param irc * @param pto * @param encryption * @param broadcast_code *//* ... */ const hci_cmd_t hci_le_create_big_test = { HCI_OPCODE_HCI_LE_CREATE_BIG_TEST, "111321221111111K" ...}; /** * @param big_handle * @param reason *//* ... */ const hci_cmd_t hci_le_terminate_big = { HCI_OPCODE_HCI_LE_TERMINATE_BIG, "11" ...}; /** * @param big_handle * @param sync_handle * @param encryption * @param broadcast_code * @param mse * @param big_sync_timeout * @param num_bis * @param bis[i] *//* ... */ const hci_cmd_t hci_le_big_create_sync = { HCI_OPCODE_HCI_LE_BIG_CREATE_SYNC, "1H1K12a[1]" ...}; /** * @param big_handle *//* ... */ const hci_cmd_t hci_le_big_terminate_sync = { HCI_OPCODE_HCI_LE_BIG_TERMINATE_SYNC, "1" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_request_peer_sca = { HCI_OPCODE_HCI_LE_REQUEST_PEER_SCA, "H" ...}; /** * @param connection_handle * @param data_path_direction * @param data_path_id * @param codec_id_coding_format * @param codec_id_company_identifier (Shall be ignored if codec_id_coding_format is not 0xFF) * @param codec_id_vendor_codec_id (Shall be ignored if codec_id_coding_format is not 0xFF) * @param controller_delay * @param codec_configuration_length * @param codec_configuration *//* ... */ const hci_cmd_t hci_le_setup_iso_data_path = { HCI_OPCODE_HCI_LE_SETUP_ISO_DATA_PATH, "H111223JV" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_remove_iso_data_path = { HCI_OPCODE_HCI_LE_REMOVE_ISO_DATA_PATH, "H1" ...}; /** * @param connection_handle * @param paylaod_type *//* ... */ const hci_cmd_t hci_le_iso_transmit_test = { HCI_OPCODE_HCI_LE_ISO_TRANSMIT_TEST, "H1" ...}; /** * @param connection_handle * @param paylaod_type *//* ... */ const hci_cmd_t hci_le_iso_receive_test = { HCI_OPCODE_HCI_LE_ISO_RECEIVE_TEST, "H1" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_iso_read_test_counters = { HCI_OPCODE_HCI_LE_ISO_READ_TEST_COUNTERS, "H" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_iso_test_end = { HCI_OPCODE_HCI_LE_ISO_TEST_END, "H" ...}; /** * @param bit_number * @param bit_value *//* ... */ const hci_cmd_t hci_le_set_host_feature = { HCI_OPCODE_HCI_LE_SET_HOST_FEATURE, "11" ...}; /** * @param connection_handle *//* ... */ const hci_cmd_t hci_le_read_iso_link_quality = { HCI_OPCODE_HCI_LE_READ_ISO_LINK_QUALITY, "H" ...}; /** * @param connection_handle * @param phy *//* ... */ const hci_cmd_t hci_le_enhanced_read_transmit_power_level = { HCI_OPCODE_HCI_LE_ENHANCED_READ_TRANSMIT_POWER_LEVEL, "H1" ...}; /** * @param connection_handle * @param phy *//* ... */ const hci_cmd_t hci_le_read_remote_transmit_power_level = { HCI_OPCODE_HCI_LE_READ_REMOTE_TRANSMIT_POWER_LEVEL, "H1" ...}; /** * @param connection_handle * @param high_threshold * @param high_hysteresis * @param low_threshold * @param low_hysteresis * @param min_time_spent *//* ... */ const hci_cmd_t hci_le_set_path_loss_reporting_parameters = { HCI_OPCODE_HCI_LE_SET_PATH_LOSS_REPORTING_PARAMETERS, "211112" ...}; /** * @param connection_handle * @param enable *//* ... */ const hci_cmd_t hci_le_set_path_loss_reporting_enable = { HCI_OPCODE_HCI_LE_SET_PATH_LOSS_REPORTING_ENABLE, "H1" ...}; /** * @param connection_handle * @param local_enable * @param remote_enable *//* ... */ const hci_cmd_t hci_le_set_transmit_power_reporting_enable = { HCI_OPCODE_HCI_LE_SET_TRANSMIT_POWER_REPORTING_ENABLE, "H11" ...}; /** * @param tx_channel * @param test_data_length * @param packet_payload * @param phy * @param cte_length * @param cte_type * @param switching_pattern_length * @param antenna_ids[i] * @param transmit_power_level *//* ... */ const hci_cmd_t hci_le_transmitter_test_v4 = { HCI_OPCODE_HCI_LE_TRANSMITTER_TEST_V4, "111111a[1]1" ...}; /* ... */ #endif // Broadcom / Cypress specific HCI commands /** * @brief Enable Wide-Band Speech / mSBC decoding for PCM * @param enable_wbs is 0 for disable, 1 for enable * @param uuid_wbs is 2 for EV2/EV3 *//* ... */ const hci_cmd_t hci_bcm_enable_wbs = { HCI_OPCODE_HCI_BCM_ENABLE_WBS, "12" // return: status ...}; /** * @brief Configure PCM2, see Cypress AN214937 * @param action * @param test_options * @param op_mode * @param sync_and_clock_options * @param pcm_clock_freq * @param sync_signal_width * @param slot_width * @param number_of_slots * @param bank_0_fill_mode * @param bank_0_number_of_fill_bits * @param bank_0_programmable_fill_data * @param bank_1_fill_mode * @param bank_1_number_of_fill_bits * @param bank_1_programmable_fill_data * @param data_justify_and_bit_order_options * @param ch_0_slot_number * @param ch_1_slot_number * @param ch_2_slot_number * @param ch_3_slot_number * @param ch_4_slot_number * @param ch_0_period * @param ch_1_period * @param ch_2_period * *//* ... */ const hci_cmd_t hci_bcm_pcm2_setup = { HCI_OPCODE_HCI_BCM_PCM2_SETUP, "11114111111111111111111" ...}; /** * @brief Configure SCO Routing (BCM) * @param sco_routing is 0 for PCM, 1 for Transport, 2 for Codec and 3 for I2S * @param pcm_interface_rate is 0 for 128KBps, 1 for 256 KBps, 2 for 512KBps, 3 for 1024KBps, and 4 for 2048Kbps * @param frame_type is 0 for short and 1 for long * @param sync_mode is 0 for slave and 1 for master * @param clock_mode is 0 for slabe and 1 for master *//* ... */ const hci_cmd_t hci_bcm_write_sco_pcm_int = { HCI_OPCODE_HCI_BCM_WRITE_SCO_PCM_INT, "11111" // return: status ...}; /** * @brief Configure PCM Data Format (BCM) * @param lsb_position 0x00 – LSB last/MSB first, 0x01 – LSB first/MSB last * @param fill_bits_value three bit value defines the fill bits used by the PCM interface,only if fill_data_selection == programmable * @param fill_data_selection 0x00 zeros, 0x01 ones, 0x02 sign bit, 0x03 programmable * @param number_of_fill_bits 0..3 * @param right_left_justification 0x00 left justified, 0x01 right justified *//* ... */ const hci_cmd_t hci_bcm_write_pcm_data_format_param = { HCI_OPCODE_HCI_BCM_WRITE_PCM_DATA_FORMAT_PARAM, "11111" // return: status ...}; /** * @brief Configure the I2S/PCM interface (BCM) * @param i2s_enable is 0 for off, 1 for on * @param is_master is 0 for slave, is 1 for master * @param sample_rate is 0 for 8 kHz, 1 for 16 kHz, 2 for 4 kHz * @param clock_rate is 0 for 128 kz, 1 for 256 kHz, 2 for 512 khz, 3 for 1024 kHz, 4 for 2048 khz *//* ... */ const hci_cmd_t hci_bcm_write_i2spcm_interface_param = { HCI_OPCODE_HCI_BCM_WRITE_I2SPCM_INTERFACE_PARAM, "1111" // return: status ...}; /** * @brief Activates selected Sleep Mode * @param sleep_mode: 0=no sleep, 1=UART, 2=UART with Messaging, 3=USB, 4=H4IBSS, USB with Host Wake, 6=SDIO, 7=UART CS-N, 8=SPI, 9=H5, 10=H4DS, 12=UART with BREAK * @param idle_threshold_host (modes 1,2,5,7) time until considered idle, unit roughly 300 ms * @param idle_threshold_controller (modes 1-7,9) time until considered idle, unit roughly 300 ms * @param bt_wake_active_mode (modes 1,2,7) 0 = BT_WAKE line is active high, 1 = BT_WAKE is active low * @param host_wake_active_mode (modes 1,2,5,7) 0 = HOST_WAKE line is active high, 1 = HOST_WAKE is active low * @param allow_host_sleep_during_sco (modes 1,2,3,5,7) * @param combine_sleep_mode_and_lpm (modes 1,2,3,5,7) * @param enable_tristate_control_of_uart_tx_line (modes 1,2,7) * @param active_connection_handling_on_suspend (modes 3,5) * @param resume_timeout (modes 3,5) * @param enable_break_to_host (mode 12) * @param pulsed_host_wake (modes 1,12) *//* ... */ const hci_cmd_t hci_bcm_set_sleep_mode = { HCI_OPCODE_HCI_BCM_SET_SLEEP_MODE, "111111111111" ...}; /** * @brief Set TX Power Table * @param is_le 0=classic, 1=LE * @param chip_max_tx_pwr_db chip level max TX power in dBM *//* ... */ const hci_cmd_t hci_bcm_write_tx_power_table = { HCI_OPCODE_HCI_BCM_WRITE_TX_POWER_TABLE, "11" ...}; const hci_cmd_t hci_bcm_set_tx_pwr = { HCI_OPCODE_HCI_BCM_SET_TX_PWR, "11H" ...}; /** * @brief This command starts receiving packets using packet transmission parameters such as * frequency channel, packet type, and packet length. It is used for Packet RX. * @see processors.wiki.ti.com/index.php/CC256x_Testing_Guide#Continuous_RX * @param frequency * @param ADPLL loop mode *//* ... */ const hci_cmd_t hci_ti_drpb_tester_con_rx = { 0xFD17, "11" ...}; /** * * * @brief This command tests the RF transceiver in continuous transmission mode. * The transmitter is activated by configuring the transmission parameters such as pattern, * modulation, and frequency. * @see processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_DRPb_Tester_Con_TX.280xFD84.29 * @param modulation * @param test_pattern * @param frequency * @param power_level * @param reserved1 * @param reserved2 *//* ... */ const hci_cmd_t hci_ti_drpb_tester_con_tx = { 0xFD84, "111144" ...}; /** * @brief This command starts sending/receiving packets using packet transmission parameters such as * frequency channel, packet type, and packet length. It is used for Packet TX/RX. * @see processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_DRPb_Tester_Packet_TX_RX_.280xFD85.29 * @param frequency_mode * @param tx_single_frequency * @param rx_single_frequency * @param acl_packet_type * @paarm acl_packet_data_pattern * @param reserved * @param power_level * @param disable_whitening * @param prbs9_initialization_value *//* ... */ const hci_cmd_t hci_ti_drpb_tester_packet_tx_rx = { 0xFD85, "1111112112" ...}; /** * @param best effort access percentage * @param guaranteed access percentage * @param poll period * @param slave burst after tx * @param slave master search count * @param master burst after tx enable * @param master burst after rx limit *//* ... */ const hci_cmd_t hci_ti_configure_ddip = { HCI_OPCODE_HCI_TI_VS_CONFIGURE_DDIP, "1111111" ...}; /** * @brief This command is used to associate the requested ACL handle with Wide Band Speech configuration. * @param enable 0=disable, 1=enable * @param a3dp_role (NL5500, WL128x only) 0=source,1=sink * @param code_upload (NL5500, WL128x only) 0=do not load a3dp code, 1=load a3dp code * @param reserved for future use *//* ... */ const hci_cmd_t hci_ti_avrp_enable = { 0xFD92, "1112" ...}; /** * @brief This command is used to associate the requested ACL handle with Wide Band Speech configuration. * @param acl_con_handle *//* ... */ const hci_cmd_t hci_ti_wbs_associate = { 0xFD78, "H" ...}; /** * @brief This command is used to disassociate Wide Band Speech configuration from any ACL handle. *//* ... */ const hci_cmd_t hci_ti_wbs_disassociate = { 0xFD79, "" ...}; /** * @brief This command configures the codec interface parameters and the PCM clock rate, which is relevant when the Bluetooth core generates the clock. This command must be used by the host to use the PCM interface. * @param clock_rate in kHz * @param clock_direction 0=master/output, 1=slave/input * @param frame_sync_frequency in Hz * @param frame_sync_duty_cycle 0=50% (I2S Format), 0x0001-0xffff number of cycles of PCM clock * @param frame_sync_edge 0=driven/sampled at rising edge, 1=driven/sampled at falling edge of PCM clock * @param frame_sync_polariy 0=active high, 1=active low * @param reserved1 * @param channel_1_data_out_size sample size in bits * @param channel_1_data_out_offset number of PCM clock cycles between rising of frame sync and data start * @param channel_1_data_out_edge 0=data driven at rising edge, 1=data driven at falling edge of PCM clock * @param channel_1_data_in_size sample size in bits * @param channel_1_data_in_offset number of PCM clock cycles between rising of frame sync and data start * @param channel_1_data_in_edge 0=data sampled at rising edge, 1=data sampled at falling edge of PCM clock * @param fsync_multiplier this field is only relevant to CC256XB from service pack 0.2 !!! -> use 0x00 * @param channel_2_data_out_size sample size in bits * @param channel_2_data_out_offset number of PCM clock cycles between rising of frame sync and data start * @param channel_2_data_out_edge 0=data driven at rising edge, 1=data driven at falling edge of PCM clock * @param channel_2_data_in_size sample size in bits * @param channel_2_data_in_offset number of PCM clock cycles between rising of frame sync and data start * @param channel_2_data_in_edge 0=data sampled at rising edge, 1=data sampled at falling edge of PCM clock * @param reserved2 * *//* ... */ const hci_cmd_t hci_ti_write_codec_config = { 0xFD06, "214211122122112212211" ...}; /** * @brief This command is used only for internal testing. * @see processors.wiki.ti.com/index.php/CC256x_Testing_Guide#Continuous_TX * @param frequency * @param ADPLL loop mode *//* ... */ const hci_cmd_t hci_ti_drpb_enable_rf_calibration = { 0xFD80, "141" ...}; /** * @brief This command command is only required for the continuous TX test of modulated * (GFSK, π/4-DQPSK or 8DPSK) signal. This command should be skipped when performing continuous TX test for CW. * @see processors.wiki.ti.com/index.php/CC256x_Testing_Guide#Continuous_RX * @param frequency * @param ADPLL loop mode *//* ... */ const hci_cmd_t hci_ti_write_hardware_register = { 0xFF01, "42" ...}; /** * @brief Configure SCO routing on Realtek Controllers *//* ... */ const hci_cmd_t hci_rtk_configure_sco_routing = { HCI_OPCODE_HCI_RTK_CONFIGURE_SCO_ROUTING, "111111111" ...}; /** * @brief Read Card Information *//* ... */ const hci_cmd_t hci_rtk_read_card_info = { HCI_OPCODE_HCI_RTK_READ_CARD_INFO, "11111" ...}; /** * @param voice_path 0x00 - transport, 0x01 - I2S/PCM *//* ... */ const hci_cmd_t hci_nxp_set_sco_data_path = { HCI_OPCODE_HCI_NXP_SET_SCO_DATA_PATH, "1" ...}; /** * @param settings bits 7-5: reserved, bit 4: pcm clock on, bit 3: reserved, bit 2: pcm sync source, bit 1: master/slave, bit 0: pcm direction *//* ... */ const hci_cmd_t hci_nxp_write_pcm_i2s_settings = { HCI_OPCODE_HCI_NXP_WRITE_PCM_I2S_SETTINGS, "1" ...}; /** * @param sync_settings_1 bits 7-2: reserved, bit 1: ISR, bit 0: ISR * @param sync_settings_2 bits 15-11: reserved, bit 10: 16k synchronization, bit 9: clock setting, bit 8: main clock, bits 7-5: reserved, bit 4: i2s sent in right channel, bit 3: clock alignment DIN, bit 2: clock alignment DOUT, bits 1-0: mode *//* ... */ const hci_cmd_t hci_nxp_write_pcm_i2s_sync_settings = { HCI_OPCODE_HCI_NXP_WRITE_PCM_I2S_SYNC_SETTINGS, "12" ...}; /** * @param settings bits 15-14: reserved, bit 13-10: each bit == one PCM time slot,, bits 9-2: slot relative to PCM synchronization, bits 1-0: PCM slots to be used *//* ... */ const hci_cmd_t hci_nxp_write_pcm_link_settings = { HCI_OPCODE_HCI_NXP_WRITE_PCM_LINK_SETTINGS, "2" ...}; /** * @param next_connection_wbs 0: CVSD, 1: mSBC *//* ... */ const hci_cmd_t hci_nxp_set_wbs_connection = { HCI_OPCODE_HCI_NXP_SET_WBS_CONNECTION, "1" ...}; /** * @param action * @param operation mode * @param sco_handle_1 * @param sco_handle_2 *//* ... */ const hci_cmd_t hci_nxp_host_pcm_i2s_audio_config = { HCI_OPCODE_HCI_NXP_HOST_PCM_I2S_AUDIO_CONFIG, "11HH" ...}; /** * @param action *//* ... */ const hci_cmd_t hci_nxp_host_pcm_i2s_control_enable = { HCI_OPCODE_HCI_NXP_HOST_PCM_I2S_CONTROL_ENABLE, "1" ...};
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.