1 /* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the copyright holders nor the names of 14 * contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 4. Any redistribution, use, or modification is done solely for 17 * personal benefit and not for any commercial purpose or for 18 * monetary gain. 19 * 20 * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24 * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * Please inquire about commercial licensing options at 34 * [email protected] 35 * 36 */ 37 38 #define BTSTACK_FILE__ "hci_cmd.c" 39 40 /* 41 * hci_cmd.c 42 * 43 * Created by Matthias Ringwald on 7/23/09. 44 */ 45 46 #include "btstack_config.h" 47 48 #include "classic/sdp_util.h" 49 #include "hci.h" 50 #include "hci_cmd.h" 51 #include "btstack_debug.h" 52 53 #include <string.h> 54 55 // calculate combined ogf/ocf value 56 #define OPCODE(ogf, ocf) ((ocf) | ((ogf) << 10)) 57 58 /** 59 * construct HCI Command based on template 60 * 61 * Format: 62 * 1,2,3,4: one to four byte value 63 * H: HCI connection handle 64 * B: Bluetooth Baseband Address (BD_ADDR) 65 * D: 8 byte data block 66 * E: Extended Inquiry Result 67 * N: Name up to 248 chars, \0 terminated 68 * P: 16 byte data block. Pairing code, Simple Pairing Hash and Randomizer 69 * A: 31 bytes advertising data 70 * S: Service Record (Data Element Sequence) 71 * Q: 32 byte data block, e.g. for X and Y coordinates of P-256 public key 72 */ 73 uint16_t hci_cmd_create_from_template(uint8_t *hci_cmd_buffer, const hci_cmd_t *cmd, va_list argptr){ 74 75 hci_cmd_buffer[0] = cmd->opcode & 0xff; 76 hci_cmd_buffer[1] = cmd->opcode >> 8; 77 int pos = 3; 78 79 const char *format = cmd->format; 80 uint16_t word; 81 uint32_t longword; 82 uint8_t * ptr; 83 while (*format) { 84 switch(*format) { 85 case '1': // 8 bit value 86 case '2': // 16 bit value 87 case 'H': // hci_handle 88 word = va_arg(argptr, int); // minimal va_arg is int: 2 bytes on 8+16 bit CPUs 89 hci_cmd_buffer[pos++] = word & 0xff; 90 if (*format == '2') { 91 hci_cmd_buffer[pos++] = word >> 8; 92 } else if (*format == 'H') { 93 // TODO implement opaque client connection handles 94 // pass module handle for now 95 hci_cmd_buffer[pos++] = word >> 8; 96 } 97 break; 98 case '3': 99 case '4': 100 longword = va_arg(argptr, uint32_t); 101 // longword = va_arg(argptr, int); 102 hci_cmd_buffer[pos++] = longword; 103 hci_cmd_buffer[pos++] = longword >> 8; 104 hci_cmd_buffer[pos++] = longword >> 16; 105 if (*format == '4'){ 106 hci_cmd_buffer[pos++] = longword >> 24; 107 } 108 break; 109 case 'B': // bt-addr 110 ptr = va_arg(argptr, uint8_t *); 111 hci_cmd_buffer[pos++] = ptr[5]; 112 hci_cmd_buffer[pos++] = ptr[4]; 113 hci_cmd_buffer[pos++] = ptr[3]; 114 hci_cmd_buffer[pos++] = ptr[2]; 115 hci_cmd_buffer[pos++] = ptr[1]; 116 hci_cmd_buffer[pos++] = ptr[0]; 117 break; 118 case 'D': // 8 byte data block 119 ptr = va_arg(argptr, uint8_t *); 120 (void)memcpy(&hci_cmd_buffer[pos], ptr, 8); 121 pos += 8; 122 break; 123 case 'E': // Extended Inquiry Information 240 octets 124 ptr = va_arg(argptr, uint8_t *); 125 (void)memcpy(&hci_cmd_buffer[pos], ptr, 240); 126 pos += 240; 127 break; 128 case 'N': { // UTF-8 string, null terminated 129 ptr = va_arg(argptr, uint8_t *); 130 uint16_t len = strlen((const char*) ptr); 131 if (len > 248) { 132 len = 248; 133 } 134 (void)memcpy(&hci_cmd_buffer[pos], ptr, len); 135 if (len < 248) { 136 // fill remaining space with zeroes 137 memset(&hci_cmd_buffer[pos+len], 0, 248-len); 138 } 139 pos += 248; 140 break; 141 } 142 case 'P': // 16 byte PIN code or link key 143 ptr = va_arg(argptr, uint8_t *); 144 (void)memcpy(&hci_cmd_buffer[pos], ptr, 16); 145 pos += 16; 146 break; 147 #ifdef ENABLE_BLE 148 case 'A': // 31 bytes advertising data 149 ptr = va_arg(argptr, uint8_t *); 150 (void)memcpy(&hci_cmd_buffer[pos], ptr, 31); 151 pos += 31; 152 break; 153 #endif 154 #ifdef ENABLE_SDP 155 case 'S': { // Service Record (Data Element Sequence) 156 ptr = va_arg(argptr, uint8_t *); 157 uint16_t len = de_get_len(ptr); 158 (void)memcpy(&hci_cmd_buffer[pos], ptr, len); 159 pos += len; 160 break; 161 } 162 #endif 163 #ifdef ENABLE_LE_SECURE_CONNECTIONS 164 case 'Q': 165 ptr = va_arg(argptr, uint8_t *); 166 reverse_bytes(ptr, &hci_cmd_buffer[pos], 32); 167 pos += 32; 168 break; 169 #endif 170 default: 171 break; 172 } 173 format++; 174 }; 175 hci_cmd_buffer[2] = pos - 3; 176 return pos; 177 } 178 179 /** 180 * Link Control Commands 181 */ 182 183 /** 184 * @param lap 185 * @param inquiry_length 186 * @param num_responses 187 */ 188 const hci_cmd_t hci_inquiry = { 189 OPCODE(OGF_LINK_CONTROL, 0x01), "311" 190 }; 191 192 /** 193 */ 194 const hci_cmd_t hci_inquiry_cancel = { 195 OPCODE(OGF_LINK_CONTROL, 0x02), "" 196 }; 197 198 /** 199 * @param bd_addr 200 * @param packet_type 201 * @param page_scan_repetition_mode 202 * @param reserved 203 * @param clock_offset 204 * @param allow_role_switch 205 */ 206 const hci_cmd_t hci_create_connection = { 207 OPCODE(OGF_LINK_CONTROL, 0x05), "B21121" 208 }; 209 210 /** 211 * @param handle 212 * @param reason (0x05, 0x13-0x15, 0x1a, 0x29, see Errors Codes in BT Spec Part D) 213 */ 214 const hci_cmd_t hci_disconnect = { 215 OPCODE(OGF_LINK_CONTROL, 0x06), "H1" 216 }; 217 218 /** 219 * @param bd_addr 220 */ 221 const hci_cmd_t hci_create_connection_cancel = { 222 OPCODE(OGF_LINK_CONTROL, 0x08), "B" 223 }; 224 225 /** 226 * @param bd_addr 227 * @param role (become master, stay slave) 228 */ 229 const hci_cmd_t hci_accept_connection_request = { 230 OPCODE(OGF_LINK_CONTROL, 0x09), "B1" 231 }; 232 233 /** 234 * @param bd_addr 235 * @param reason (e.g. CONNECTION REJECTED DUE TO LIMITED RESOURCES (0x0d)) 236 */ 237 const hci_cmd_t hci_reject_connection_request = { 238 OPCODE(OGF_LINK_CONTROL, 0x0a), "B1" 239 }; 240 241 /** 242 * @param bd_addr 243 * @param link_key 244 */ 245 const hci_cmd_t hci_link_key_request_reply = { 246 OPCODE(OGF_LINK_CONTROL, 0x0b), "BP" 247 }; 248 249 /** 250 * @param bd_addr 251 */ 252 const hci_cmd_t hci_link_key_request_negative_reply = { 253 OPCODE(OGF_LINK_CONTROL, 0x0c), "B" 254 }; 255 256 /** 257 * @param bd_addr 258 * @param pin_length 259 * @param pin (c-string) 260 */ 261 const hci_cmd_t hci_pin_code_request_reply = { 262 OPCODE(OGF_LINK_CONTROL, 0x0d), "B1P" 263 }; 264 265 /** 266 * @param bd_addr 267 */ 268 const hci_cmd_t hci_pin_code_request_negative_reply = { 269 OPCODE(OGF_LINK_CONTROL, 0x0e), "B" 270 }; 271 272 /** 273 * @param handle 274 * @param packet_type 275 */ 276 const hci_cmd_t hci_change_connection_packet_type = { 277 OPCODE(OGF_LINK_CONTROL, 0x0f), "H2" 278 }; 279 280 /** 281 * @param handle 282 */ 283 const hci_cmd_t hci_authentication_requested = { 284 OPCODE(OGF_LINK_CONTROL, 0x11), "H" 285 }; 286 287 /** 288 * @param handle 289 * @param encryption_enable 290 */ 291 const hci_cmd_t hci_set_connection_encryption = { 292 OPCODE(OGF_LINK_CONTROL, 0x13), "H1" 293 }; 294 295 /** 296 * @param handle 297 */ 298 const hci_cmd_t hci_change_connection_link_key = { 299 OPCODE(OGF_LINK_CONTROL, 0x15), "H" 300 }; 301 302 /** 303 * @param bd_addr 304 * @param page_scan_repetition_mode 305 * @param reserved 306 * @param clock_offset 307 */ 308 const hci_cmd_t hci_remote_name_request = { 309 OPCODE(OGF_LINK_CONTROL, 0x19), "B112" 310 }; 311 312 313 /** 314 * @param bd_addr 315 */ 316 const hci_cmd_t hci_remote_name_request_cancel = { 317 OPCODE(OGF_LINK_CONTROL, 0x1A), "B" 318 }; 319 320 /** 321 * @param handle 322 */ 323 const hci_cmd_t hci_read_remote_supported_features_command = { 324 OPCODE(OGF_LINK_CONTROL, 0x1B), "H" 325 }; 326 327 /** 328 * @param handle 329 */ 330 const hci_cmd_t hci_read_remote_version_information = { 331 OPCODE(OGF_LINK_CONTROL, 0x1D), "H" 332 }; 333 334 /** 335 * @param handle 336 * @param transmit_bandwidth 8000(64kbps) 337 * @param receive_bandwidth 8000(64kbps) 338 * @param max_latency >= 7ms for eSCO, 0xFFFF do not care 339 * @param voice_settings e.g. CVSD, Input Coding: Linear, Input Data Format: 2’s complement, data 16bit: 00011000000 == 0x60 340 * @param retransmission_effort e.g. 0xFF do not care 341 * @param packet_type at least EV3 for eSCO 342 */ 343 const hci_cmd_t hci_setup_synchronous_connection = { 344 OPCODE(OGF_LINK_CONTROL, 0x0028), "H442212" 345 }; 346 347 /** 348 * @param bd_addr 349 * @param transmit_bandwidth 350 * @param receive_bandwidth 351 * @param max_latency 352 * @param voice_settings 353 * @param retransmission_effort 354 * @param packet_type 355 */ 356 const hci_cmd_t hci_accept_synchronous_connection = { 357 OPCODE(OGF_LINK_CONTROL, 0x0029), "B442212" 358 }; 359 360 /** 361 * @param bd_addr 362 * @param IO_capability 363 * @param OOB_data_present 364 * @param authentication_requirements 365 */ 366 const hci_cmd_t hci_io_capability_request_reply = { 367 OPCODE(OGF_LINK_CONTROL, 0x2b), "B111" 368 }; 369 370 /** 371 * @param bd_addr 372 */ 373 const hci_cmd_t hci_user_confirmation_request_reply = { 374 OPCODE(OGF_LINK_CONTROL, 0x2c), "B" 375 }; 376 377 /** 378 * @param bd_addr 379 */ 380 const hci_cmd_t hci_user_confirmation_request_negative_reply = { 381 OPCODE(OGF_LINK_CONTROL, 0x2d), "B" 382 }; 383 384 /** 385 * @param bd_addr 386 * @param numeric_value 387 */ 388 const hci_cmd_t hci_user_passkey_request_reply = { 389 OPCODE(OGF_LINK_CONTROL, 0x2e), "B4" 390 }; 391 392 /** 393 * @param bd_addr 394 */ 395 const hci_cmd_t hci_user_passkey_request_negative_reply = { 396 OPCODE(OGF_LINK_CONTROL, 0x2f), "B" 397 }; 398 399 /** 400 * @param bd_addr 401 * @param c Simple Pairing Hash C 402 * @param r Simple Pairing Randomizer R 403 */ 404 const hci_cmd_t hci_remote_oob_data_request_reply = { 405 OPCODE(OGF_LINK_CONTROL, 0x30), "BPP" 406 }; 407 408 /** 409 * @param bd_addr 410 */ 411 const hci_cmd_t hci_remote_oob_data_request_negative_reply = { 412 OPCODE(OGF_LINK_CONTROL, 0x33), "B" 413 }; 414 415 /** 416 * @param bd_addr 417 * @param reason (Part D, Error codes) 418 */ 419 const hci_cmd_t hci_io_capability_request_negative_reply = { 420 OPCODE(OGF_LINK_CONTROL, 0x34), "B1" 421 }; 422 423 /** 424 * @param handle 425 * @param transmit_bandwidth 426 * @param receive_bandwidth 427 * @param transmit_coding_format_type 428 * @param transmit_coding_format_company 429 * @param transmit_coding_format_codec 430 * @param receive_coding_format_type 431 * @param receive_coding_format_company 432 * @param receive_coding_format_codec 433 * @param transmit_coding_frame_size 434 * @param receive_coding_frame_size 435 * @param input_bandwidth 436 * @param output_bandwidth 437 * @param input_coding_format_type 438 * @param input_coding_format_company 439 * @param input_coding_format_codec 440 * @param output_coding_format_type 441 * @param output_coding_format_company 442 * @param output_coding_format_codec 443 * @param input_coded_data_size 444 * @param outupt_coded_data_size 445 * @param input_pcm_data_format 446 * @param output_pcm_data_format 447 * @param input_pcm_sample_payload_msb_position 448 * @param output_pcm_sample_payload_msb_position 449 * @param input_data_path 450 * @param output_data_path 451 * @param input_transport_unit_size 452 * @param output_transport_unit_size 453 * @param max_latency 454 * @param packet_type 455 * @param retransmission_effort 456 */ 457 const hci_cmd_t hci_enhanced_setup_synchronous_connection = { 458 OPCODE(OGF_LINK_CONTROL, 0x3d), "H4412212222441221222211111111221" 459 }; 460 461 /** 462 * @param bd_addr 463 * @param transmit_bandwidth 464 * @param receive_bandwidth 465 * @param transmit_coding_format_type 466 * @param transmit_coding_format_company 467 * @param transmit_coding_format_codec 468 * @param receive_coding_format_type 469 * @param receive_coding_format_company 470 * @param receive_coding_format_codec 471 * @param transmit_coding_frame_size 472 * @param receive_coding_frame_size 473 * @param input_bandwidth 474 * @param output_bandwidth 475 * @param input_coding_format_type 476 * @param input_coding_format_company 477 * @param input_coding_format_codec 478 * @param output_coding_format_type 479 * @param output_coding_format_company 480 * @param output_coding_format_codec 481 * @param input_coded_data_size 482 * @param outupt_coded_data_size 483 * @param input_pcm_data_format 484 * @param output_pcm_data_format 485 * @param input_pcm_sample_payload_msb_position 486 * @param output_pcm_sample_payload_msb_position 487 * @param input_data_path 488 * @param output_data_path 489 * @param input_transport_unit_size 490 * @param output_transport_unit_size 491 * @param max_latency 492 * @param packet_type 493 * @param retransmission_effort 494 */ 495 const hci_cmd_t hci_enhanced_accept_synchronous_connection = { 496 OPCODE(OGF_LINK_CONTROL, 0x3e), "B4412212222441221222211111111221" 497 }; 498 499 /** 500 * Link Policy Commands 501 */ 502 503 /** 504 * @param handle 505 * @param sniff_max_interval 506 * @param sniff_min_interval 507 * @param sniff_attempt 508 * @param sniff_timeout 509 */ 510 const hci_cmd_t hci_sniff_mode = { 511 OPCODE(OGF_LINK_POLICY, 0x03), "H2222" 512 }; 513 514 /** 515 * @param handle 516 */ 517 const hci_cmd_t hci_exit_sniff_mode = { 518 OPCODE(OGF_LINK_POLICY, 0x04), "H" 519 }; 520 521 /** 522 * @param handle 523 * @param flags 524 * @param service_type 525 * @param token_rate (bytes/s) 526 * @param peak_bandwith (bytes/s) 527 * @param latency (us) 528 * @param delay_variation (us) 529 */ 530 const hci_cmd_t hci_qos_setup = { 531 OPCODE(OGF_LINK_POLICY, 0x07), "H114444" 532 }; 533 534 /** 535 * @param handle 536 */ 537 const hci_cmd_t hci_role_discovery = { 538 OPCODE(OGF_LINK_POLICY, 0x09), "H" 539 }; 540 541 /** 542 * @param bd_addr 543 * @param role (0=master,1=slave) 544 */ 545 const hci_cmd_t hci_switch_role_command= { 546 OPCODE(OGF_LINK_POLICY, 0x0b), "B1" 547 }; 548 549 /** 550 * @param handle 551 */ 552 const hci_cmd_t hci_read_link_policy_settings = { 553 OPCODE(OGF_LINK_POLICY, 0x0c), "H" 554 }; 555 556 /** 557 * @param handle 558 * @param settings 559 */ 560 const hci_cmd_t hci_write_link_policy_settings = { 561 OPCODE(OGF_LINK_POLICY, 0x0d), "H2" 562 }; 563 564 /** 565 * @param policy 566 */ 567 const hci_cmd_t hci_write_default_link_policy_setting = { 568 OPCODE(OGF_LINK_POLICY, 0x0F), "2" 569 }; 570 571 572 /** 573 * Controller & Baseband Commands 574 */ 575 576 577 /** 578 * @param event_mask_lover_octets 579 * @param event_mask_higher_octets 580 */ 581 const hci_cmd_t hci_set_event_mask = { 582 OPCODE(OGF_CONTROLLER_BASEBAND, 0x01), "44" 583 }; 584 585 /** 586 */ 587 const hci_cmd_t hci_reset = { 588 OPCODE(OGF_CONTROLLER_BASEBAND, 0x03), "" 589 }; 590 591 /** 592 * @param handle 593 */ 594 const hci_cmd_t hci_flush = { 595 OPCODE(OGF_CONTROLLER_BASEBAND, 0x08), "H" 596 }; 597 598 /** 599 * @param handle 600 */ 601 const hci_cmd_t hci_read_pin_type = { 602 OPCODE(OGF_CONTROLLER_BASEBAND, 0x09), "" 603 }; 604 605 /** 606 * @param handle 607 */ 608 const hci_cmd_t hci_write_pin_type = { 609 OPCODE(OGF_CONTROLLER_BASEBAND, 0x0A), "1" 610 }; 611 612 /** 613 * @param bd_addr 614 * @param delete_all_flags 615 */ 616 const hci_cmd_t hci_delete_stored_link_key = { 617 OPCODE(OGF_CONTROLLER_BASEBAND, 0x12), "B1" 618 }; 619 620 #ifdef ENABLE_CLASSIC 621 /** 622 * @param local_name (UTF-8, Null Terminated, max 248 octets) 623 */ 624 const hci_cmd_t hci_write_local_name = { 625 OPCODE(OGF_CONTROLLER_BASEBAND, 0x13), "N" 626 }; 627 #endif 628 629 /** 630 */ 631 const hci_cmd_t hci_read_local_name = { 632 OPCODE(OGF_CONTROLLER_BASEBAND, 0x14), "" 633 }; 634 635 /** 636 */ 637 const hci_cmd_t hci_read_page_timeout = { 638 OPCODE(OGF_CONTROLLER_BASEBAND, 0x17), "" 639 }; 640 641 /** 642 * @param page_timeout (* 0.625 ms) 643 */ 644 const hci_cmd_t hci_write_page_timeout = { 645 OPCODE(OGF_CONTROLLER_BASEBAND, 0x18), "2" 646 }; 647 648 /** 649 * @param scan_enable (no, inq, page, inq+page) 650 */ 651 const hci_cmd_t hci_write_scan_enable = { 652 OPCODE(OGF_CONTROLLER_BASEBAND, 0x1A), "1" 653 }; 654 655 /** 656 */ 657 const hci_cmd_t hci_read_page_scan_activity = { 658 OPCODE(OGF_CONTROLLER_BASEBAND, 0x1B), "" 659 }; 660 661 /** 662 * @param page_scan_interval (* 0.625 ms) 663 * @param page_scan_window (* 0.625 ms, must be <= page_scan_interval) 664 */ 665 const hci_cmd_t hci_write_page_scan_activity = { 666 OPCODE(OGF_CONTROLLER_BASEBAND, 0x1C), "22" 667 }; 668 669 /** 670 */ 671 const hci_cmd_t hci_read_inquiry_scan_activity = { 672 OPCODE(OGF_CONTROLLER_BASEBAND, 0x1D), "" 673 }; 674 675 /** 676 * @param inquiry_scan_interval (* 0.625 ms) 677 * @param inquiry_scan_window (* 0.625 ms, must be <= inquiry_scan_interval) 678 */ 679 const hci_cmd_t hci_write_inquiry_scan_activity = { 680 OPCODE(OGF_CONTROLLER_BASEBAND, 0x1E), "22" 681 }; 682 683 /** 684 * @param authentication_enable 685 */ 686 const hci_cmd_t hci_write_authentication_enable = { 687 OPCODE(OGF_CONTROLLER_BASEBAND, 0x20), "1" 688 }; 689 690 /** 691 * @param class_of_device 692 */ 693 const hci_cmd_t hci_write_class_of_device = { 694 OPCODE(OGF_CONTROLLER_BASEBAND, 0x24), "3" 695 }; 696 697 /** 698 */ 699 const hci_cmd_t hci_read_num_broadcast_retransmissions = { 700 OPCODE(OGF_CONTROLLER_BASEBAND, 0x29), "" 701 }; 702 703 /** 704 * @param num_broadcast_retransmissions (e.g. 0 for a single broadcast) 705 */ 706 const hci_cmd_t hci_write_num_broadcast_retransmissions = { 707 OPCODE(OGF_CONTROLLER_BASEBAND, 0x2a), "1" 708 }; 709 710 /** 711 * @param connection_handle 712 * @param type 0 = current transmit level, 1 = max transmit level 713 */ 714 const hci_cmd_t hci_read_transmit_power_level = { 715 OPCODE(OGF_CONTROLLER_BASEBAND, 0x2D), "11" 716 }; 717 718 /** 719 * @param synchronous_flow_control_enable - if yes, num completed packet everts are sent for SCO packets 720 */ 721 const hci_cmd_t hci_write_synchronous_flow_control_enable = { 722 OPCODE(OGF_CONTROLLER_BASEBAND, 0x2f), "1" 723 }; 724 725 #ifdef ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL 726 727 /** 728 * @param flow_control_enable - 0: off, 1: ACL only, 2: SCO only, 3: ACL + SCO 729 */ 730 const hci_cmd_t hci_set_controller_to_host_flow_control = { 731 OPCODE(OGF_CONTROLLER_BASEBAND, 0x31), "1" 732 }; 733 734 /** 735 * @param host_acl_data_packet_length 736 * @param host_synchronous_data_packet_length 737 * @param host_total_num_acl_data_packets 738 * @param host_total_num_synchronous_data_packets 739 */ 740 const hci_cmd_t hci_host_buffer_size = { 741 OPCODE(OGF_CONTROLLER_BASEBAND, 0x33), "2122" 742 }; 743 744 745 #if 0 746 // 747 // command sent manually sent by hci_host_num_completed_packets 748 // 749 /** 750 * @note only single handle supported by BTstack command generator 751 * @param number_of_handles must be 1 752 * @param connection_handle 753 * @param host_num_of_completed_packets for the given connection handle 754 */ 755 const hci_cmd_t hci_host_number_of_completed_packets = { 756 OPCODE(OGF_CONTROLLER_BASEBAND, 0x35), "1H2" 757 }; 758 #endif 759 760 #endif 761 762 /** 763 * @param handle 764 */ 765 const hci_cmd_t hci_read_link_supervision_timeout = { 766 OPCODE(OGF_CONTROLLER_BASEBAND, 0x36), "H" 767 }; 768 769 /** 770 * @param handle 771 * @param timeout (0x0001 - 0xFFFF Time -> Range: 0.625ms - 40.9 sec) 772 */ 773 const hci_cmd_t hci_write_link_supervision_timeout = { 774 OPCODE(OGF_CONTROLLER_BASEBAND, 0x37), "H2" 775 }; 776 777 /** 778 * @param num_current_iac must be 2 779 * @param iac_lap1 780 * @param iac_lap2 781 */ 782 const hci_cmd_t hci_write_current_iac_lap_two_iacs = { 783 OPCODE(OGF_CONTROLLER_BASEBAND, 0x3A), "133" 784 }; 785 786 /** 787 * @param inquiry_mode (0x00 = standard, 0x01 = with RSSI, 0x02 = extended) 788 */ 789 const hci_cmd_t hci_write_inquiry_mode = { 790 OPCODE(OGF_CONTROLLER_BASEBAND, 0x45), "1" 791 }; 792 793 /** 794 * @param fec_required 795 * @param exstended_inquiry_response 796 */ 797 const hci_cmd_t hci_write_extended_inquiry_response = { 798 OPCODE(OGF_CONTROLLER_BASEBAND, 0x52), "1E" 799 }; 800 801 /** 802 * @param mode (0 = off, 1 = on) 803 */ 804 const hci_cmd_t hci_write_simple_pairing_mode = { 805 OPCODE(OGF_CONTROLLER_BASEBAND, 0x56), "1" 806 }; 807 808 /** 809 */ 810 const hci_cmd_t hci_read_local_oob_data = { 811 OPCODE(OGF_CONTROLLER_BASEBAND, 0x57), "" 812 // return status, C, R 813 }; 814 815 /** 816 * @param mode (0 = off, 1 = on) 817 */ 818 const hci_cmd_t hci_write_default_erroneous_data_reporting = { 819 OPCODE(OGF_CONTROLLER_BASEBAND, 0x5B), "1" 820 }; 821 822 /** 823 */ 824 const hci_cmd_t hci_read_le_host_supported = { 825 OPCODE(OGF_CONTROLLER_BASEBAND, 0x6c), "" 826 // return: status, le supported host, simultaneous le host 827 }; 828 829 /** 830 * @param le_supported_host 831 * @param simultaneous_le_host 832 */ 833 const hci_cmd_t hci_write_le_host_supported = { 834 OPCODE(OGF_CONTROLLER_BASEBAND, 0x6d), "11" 835 // return: status 836 }; 837 838 /** 839 */ 840 const hci_cmd_t hci_read_local_extended_ob_data = { 841 OPCODE(OGF_CONTROLLER_BASEBAND, 0x7d), "" 842 // return status, C_192, R_192, R_256, C_256 843 }; 844 845 846 /** 847 * Testing Commands 848 */ 849 850 851 /** 852 */ 853 const hci_cmd_t hci_read_loopback_mode = { 854 OPCODE(OGF_TESTING, 0x01), "" 855 // return: status, loopback mode (0 = off, 1 = local loopback, 2 = remote loopback) 856 }; 857 858 /** 859 * @param loopback_mode 860 */ 861 const hci_cmd_t hci_write_loopback_mode = { 862 OPCODE(OGF_TESTING, 0x02), "1" 863 // return: status 864 }; 865 866 /** 867 */ 868 const hci_cmd_t hci_enable_device_under_test_mode = { 869 OPCODE(OGF_TESTING, 0x03), "" 870 // return: status 871 }; 872 873 /** 874 * @param simple_pairing_debug_mode 875 */ 876 const hci_cmd_t hci_write_simple_pairing_debug_mode = { 877 OPCODE(OGF_TESTING, 0x04), "1" 878 // return: status 879 }; 880 881 /** 882 * @param handle 883 * @param dm1_acl_u_mode 884 * @param esco_loopback_mode 885 */ 886 const hci_cmd_t hci_write_secure_connections_test_mode = { 887 OPCODE(OGF_TESTING, 0x0a), "H11" 888 // return: status 889 }; 890 891 892 /** 893 * Informational Parameters 894 */ 895 896 const hci_cmd_t hci_read_local_version_information = { 897 OPCODE(OGF_INFORMATIONAL_PARAMETERS, 0x01), "" 898 }; 899 const hci_cmd_t hci_read_local_supported_commands = { 900 OPCODE(OGF_INFORMATIONAL_PARAMETERS, 0x02), "" 901 }; 902 const hci_cmd_t hci_read_local_supported_features = { 903 OPCODE(OGF_INFORMATIONAL_PARAMETERS, 0x03), "" 904 }; 905 const hci_cmd_t hci_read_buffer_size = { 906 OPCODE(OGF_INFORMATIONAL_PARAMETERS, 0x05), "" 907 }; 908 const hci_cmd_t hci_read_bd_addr = { 909 OPCODE(OGF_INFORMATIONAL_PARAMETERS, 0x09), "" 910 }; 911 912 /** 913 * Status Paramters 914 */ 915 916 /** 917 * @param handle 918 */ 919 const hci_cmd_t hci_read_rssi = { 920 OPCODE(OGF_STATUS_PARAMETERS, 0x05), "H" 921 }; 922 923 /** 924 * @param handle 925 */ 926 const hci_cmd_t hci_read_encryption_key_size = { 927 OPCODE(OGF_STATUS_PARAMETERS, 0x08), "H" 928 }; 929 930 931 #ifdef ENABLE_BLE 932 /** 933 * Low Energy Commands 934 */ 935 936 /** 937 * @param event_mask_lower_octets 938 * @param event_mask_higher_octets 939 */ 940 const hci_cmd_t hci_le_set_event_mask = { 941 OPCODE(OGF_LE_CONTROLLER, 0x01), "44" 942 // return: status 943 }; 944 945 const hci_cmd_t hci_le_read_buffer_size = { 946 OPCODE(OGF_LE_CONTROLLER, 0x02), "" 947 // return: status, le acl data packet len (16), total num le acl data packets(8) 948 }; 949 const hci_cmd_t hci_le_read_supported_features = { 950 OPCODE(OGF_LE_CONTROLLER, 0x03), "" 951 // return: LE_Features See [Vol 6] Part B, Section 4.6 952 }; 953 954 /** 955 * @param random_bd_addr 956 */ 957 const hci_cmd_t hci_le_set_random_address = { 958 OPCODE(OGF_LE_CONTROLLER, 0x05), "B" 959 // return: status 960 }; 961 962 /** 963 * @param advertising_interval_min ([0x0020,0x4000], default: 0x0800, unit: 0.625 msec) 964 * @param advertising_interval_max ([0x0020,0x4000], default: 0x0800, unit: 0.625 msec) 965 * @param advertising_type (enum from 0: ADV_IND, ADC_DIRECT_IND, ADV_SCAN_IND, ADV_NONCONN_IND) 966 * @param own_address_type (enum from 0: public device address, random device address) 967 * @param direct_address_type () 968 * @param direct_address (public or random address of device to be connecteed) 969 * @param advertising_channel_map (flags: chan_37(1), chan_38(2), chan_39(4)) 970 * @param advertising_filter_policy (enum from 0: scan any conn any, scan whitelist, con any, scan any conn whitelist, scan whitelist, con whitelist) 971 */ 972 const hci_cmd_t hci_le_set_advertising_parameters = { 973 OPCODE(OGF_LE_CONTROLLER, 0x06), "22111B11" 974 // return: status 975 }; 976 977 const hci_cmd_t hci_le_read_advertising_channel_tx_power = { 978 OPCODE(OGF_LE_CONTROLLER, 0x07), "" 979 // return: status, level [-20,10] signed int (8), units dBm 980 }; 981 982 /** 983 * @param advertising_data_length 984 * @param advertising_data (31 bytes) 985 */ 986 const hci_cmd_t hci_le_set_advertising_data= { 987 OPCODE(OGF_LE_CONTROLLER, 0x08), "1A" 988 // return: status 989 }; 990 991 /** 992 * @param scan_response_data_length 993 * @param scan_response_data (31 bytes) 994 */ 995 const hci_cmd_t hci_le_set_scan_response_data= { 996 OPCODE(OGF_LE_CONTROLLER, 0x09), "1A" 997 // return: status 998 }; 999 1000 /** 1001 * @param advertise_enable (off: 0, on: 1) 1002 */ 1003 const hci_cmd_t hci_le_set_advertise_enable = { 1004 OPCODE(OGF_LE_CONTROLLER, 0x0a), "1" 1005 // return: status 1006 }; 1007 1008 /** 1009 * @param le_scan_type (passive (0), active (1)) 1010 * @param le_scan_interval ([0x0004,0x4000], unit: 0.625 msec) 1011 * @param le_scan_window ([0x0004,0x4000], unit: 0.625 msec) 1012 * @param own_address_type (public (0), random (1)) 1013 * @param scanning_filter_policy (any (0), only whitelist (1)) 1014 */ 1015 const hci_cmd_t hci_le_set_scan_parameters = { 1016 OPCODE(OGF_LE_CONTROLLER, 0x0b), "12211" 1017 // return: status 1018 }; 1019 1020 /** 1021 * @param le_scan_enable (disabled (0), enabled (1)) 1022 * @param filter_duplices (disabled (0), enabled (1)) 1023 */ 1024 const hci_cmd_t hci_le_set_scan_enable = { 1025 OPCODE(OGF_LE_CONTROLLER, 0x0c), "11" 1026 // return: status 1027 }; 1028 1029 /** 1030 * @param le_scan_interval ([0x0004, 0x4000], unit: 0.625 msec) 1031 * @param le_scan_window ([0x0004, 0x4000], unit: 0.625 msec) 1032 * @param initiator_filter_policy (peer address type + peer address (0), whitelist (1)) 1033 * @param peer_address_type (public (0), random (1)) 1034 * @param peer_address 1035 * @param own_address_type (public (0), random (1)) 1036 * @param conn_interval_min ([0x0006, 0x0c80], unit: 1.25 msec) 1037 * @param conn_interval_max ([0x0006, 0x0c80], unit: 1.25 msec) 1038 * @param conn_latency (number of connection events [0x0000, 0x01f4]) 1039 * @param supervision_timeout ([0x000a, 0x0c80], unit: 10 msec) 1040 * @param minimum_CE_length ([0x0000, 0xffff], unit: 0.625 msec) 1041 * @param maximum_CE_length ([0x0000, 0xffff], unit: 0.625 msec) 1042 */ 1043 const hci_cmd_t hci_le_create_connection= { 1044 OPCODE(OGF_LE_CONTROLLER, 0x0d), "2211B1222222" 1045 // return: none -> le create connection complete event 1046 }; 1047 1048 const hci_cmd_t hci_le_create_connection_cancel = { 1049 OPCODE(OGF_LE_CONTROLLER, 0x0e), "" 1050 // return: status 1051 }; 1052 1053 const hci_cmd_t hci_le_read_white_list_size = { 1054 OPCODE(OGF_LE_CONTROLLER, 0x0f), "" 1055 // return: status, number of entries in controller whitelist 1056 }; 1057 1058 const hci_cmd_t hci_le_clear_white_list = { 1059 OPCODE(OGF_LE_CONTROLLER, 0x10), "" 1060 // return: status 1061 }; 1062 1063 /** 1064 * @param address_type (public (0), random (1)) 1065 * @param bd_addr 1066 */ 1067 const hci_cmd_t hci_le_add_device_to_white_list = { 1068 OPCODE(OGF_LE_CONTROLLER, 0x11), "1B" 1069 // return: status 1070 }; 1071 1072 /** 1073 * @param address_type (public (0), random (1)) 1074 * @param bd_addr 1075 */ 1076 const hci_cmd_t hci_le_remove_device_from_white_list = { 1077 OPCODE(OGF_LE_CONTROLLER, 0x12), "1B" 1078 // return: status 1079 }; 1080 1081 /** 1082 * @param conn_handle 1083 * @param conn_interval_min ([0x0006,0x0c80], unit: 1.25 msec) 1084 * @param conn_interval_max ([0x0006,0x0c80], unit: 1.25 msec) 1085 * @param conn_latency ([0x0000,0x03e8], number of connection events) 1086 * @param supervision_timeout ([0x000a,0x0c80], unit: 10 msec) 1087 * @param minimum_CE_length ([0x0000,0xffff], unit: 0.625 msec) 1088 * @param maximum_CE_length ([0x0000,0xffff], unit: 0.625 msec) 1089 */ 1090 const hci_cmd_t hci_le_connection_update = { 1091 OPCODE(OGF_LE_CONTROLLER, 0x13), "H222222" 1092 // return: none -> le connection update complete event 1093 }; 1094 1095 /** 1096 * @param channel_map_lower_32bits 1097 * @param channel_map_higher_5bits 1098 */ 1099 const hci_cmd_t hci_le_set_host_channel_classification = { 1100 OPCODE(OGF_LE_CONTROLLER, 0x14), "41" 1101 // return: status 1102 }; 1103 1104 /** 1105 * @param conn_handle 1106 */ 1107 const hci_cmd_t hci_le_read_channel_map = { 1108 OPCODE(OGF_LE_CONTROLLER, 0x15), "H" 1109 // return: status, connection handle, channel map (5 bytes, 37 used) 1110 }; 1111 1112 /** 1113 * @param conn_handle 1114 */ 1115 const hci_cmd_t hci_le_read_remote_used_features = { 1116 OPCODE(OGF_LE_CONTROLLER, 0x16), "H" 1117 // return: none -> le read remote used features complete event 1118 }; 1119 1120 /** 1121 * @param key ((128) for AES-128) 1122 * @param plain_text (128) 1123 */ 1124 const hci_cmd_t hci_le_encrypt = { 1125 OPCODE(OGF_LE_CONTROLLER, 0x17), "PP" 1126 // return: status, encrypted data (128) 1127 }; 1128 1129 const hci_cmd_t hci_le_rand = { 1130 OPCODE(OGF_LE_CONTROLLER, 0x18), "" 1131 // return: status, random number (64) 1132 }; 1133 1134 /** 1135 * @param conn_handle 1136 * @param random_number_lower_32bits 1137 * @param random_number_higher_32bits 1138 * @param encryption_diversifier (16) 1139 * @param long_term_key (128) 1140 */ 1141 const hci_cmd_t hci_le_start_encryption = { 1142 OPCODE(OGF_LE_CONTROLLER, 0x19), "H442P" 1143 // return: none -> encryption changed or encryption key refresh complete event 1144 }; 1145 1146 /** 1147 * @param connection_handle 1148 * @param long_term_key (128) 1149 */ 1150 const hci_cmd_t hci_le_long_term_key_request_reply = { 1151 OPCODE(OGF_LE_CONTROLLER, 0x1a), "HP" 1152 // return: status, connection handle 1153 }; 1154 1155 /** 1156 * @param conn_handle 1157 */ 1158 const hci_cmd_t hci_le_long_term_key_negative_reply = { 1159 OPCODE(OGF_LE_CONTROLLER, 0x1b), "H" 1160 // return: status, connection handle 1161 }; 1162 1163 /** 1164 * @param conn_handle 1165 */ 1166 const hci_cmd_t hci_le_read_supported_states = { 1167 OPCODE(OGF_LE_CONTROLLER, 0x1c), "H" 1168 // return: status, LE states (64) 1169 }; 1170 1171 /** 1172 * @param rx_frequency ([0x00 0x27], frequency (MHz): 2420 + N*2) 1173 */ 1174 const hci_cmd_t hci_le_receiver_test = { 1175 OPCODE(OGF_LE_CONTROLLER, 0x1d), "1" 1176 // return: status 1177 }; 1178 1179 /** 1180 * @param tx_frequency ([0x00 0x27], frequency (MHz): 2420 + N*2) 1181 * @param test_payload_lengh ([0x00,0x25]) 1182 * @param packet_payload ([0,7] different patterns) 1183 */ 1184 const hci_cmd_t hci_le_transmitter_test = { 1185 OPCODE(OGF_LE_CONTROLLER, 0x1e), "111" 1186 // return: status 1187 }; 1188 1189 /** 1190 * @param end_test_cmd 1191 */ 1192 const hci_cmd_t hci_le_test_end = { 1193 OPCODE(OGF_LE_CONTROLLER, 0x1f), "1" 1194 // return: status, number of packets (8) 1195 }; 1196 1197 /** 1198 * @param conn_handle 1199 * @param conn_interval_min ([0x0006,0x0c80], unit: 1.25 msec) 1200 * @param conn_interval_max ([0x0006,0x0c80], unit: 1.25 msec) 1201 * @param conn_latency ([0x0000,0x03e8], number of connection events) 1202 * @param supervision_timeout ([0x000a,0x0c80], unit: 10 msec) 1203 * @param minimum_CE_length ([0x0000,0xffff], unit: 0.625 msec) 1204 * @param maximum_CE_length ([0x0000,0xffff], unit: 0.625 msec) 1205 */ 1206 const hci_cmd_t hci_le_remote_connection_parameter_request_reply = { 1207 OPCODE(OGF_LE_CONTROLLER, 0x20), "H222222" 1208 // return: status, connection handle 1209 }; 1210 1211 /** 1212 * @param con_handle 1213 * @param reason 1214 */ 1215 const hci_cmd_t hci_le_remote_connection_parameter_request_negative_reply = { 1216 OPCODE(OGF_LE_CONTROLLER, 0x21), "H1" 1217 // return: status, connection handle 1218 }; 1219 1220 /** 1221 * @param con_handle 1222 * @param tx_octets 1223 * @param tx_time 1224 */ 1225 const hci_cmd_t hci_le_set_data_length = { 1226 OPCODE(OGF_LE_CONTROLLER, 0x22), "H22" 1227 // return: status, connection handle 1228 }; 1229 1230 /** 1231 */ 1232 const hci_cmd_t hci_le_read_suggested_default_data_length = { 1233 OPCODE(OGF_LE_CONTROLLER, 0x23), "" 1234 // return: status, suggested max tx octets, suggested max tx time 1235 }; 1236 1237 /** 1238 * @param suggested_max_tx_octets 1239 * @param suggested_max_tx_time 1240 */ 1241 const hci_cmd_t hci_le_write_suggested_default_data_length = { 1242 OPCODE(OGF_LE_CONTROLLER, 0x24), "22" 1243 // return: status 1244 }; 1245 1246 /** 1247 */ 1248 const hci_cmd_t hci_le_read_local_p256_public_key = { 1249 OPCODE(OGF_LE_CONTROLLER, 0x25), "" 1250 // LE Read Local P-256 Public Key Complete is generated on completion 1251 }; 1252 1253 /** 1254 * @param public key 1255 * @param private key 1256 */ 1257 const hci_cmd_t hci_le_generate_dhkey = { 1258 OPCODE(OGF_LE_CONTROLLER, 0x26), "QQ" 1259 // LE Generate DHKey Complete is generated on completion 1260 }; 1261 1262 /** 1263 */ 1264 const hci_cmd_t hci_le_read_maximum_data_length = { 1265 OPCODE(OGF_LE_CONTROLLER, 0x2F), "" 1266 // return: status, supported max tx octets, supported max tx time, supported max rx octets, supported max rx time 1267 }; 1268 1269 /** 1270 * @param con_handle 1271 */ 1272 const hci_cmd_t hci_le_read_phy = { 1273 OPCODE(OGF_LE_CONTROLLER, 0x30), "H" 1274 // return: status, connection handler, tx phy, rx phy 1275 }; 1276 1277 /** 1278 * @param all_phys 1279 * @param tx_phys 1280 * @param rx_phys 1281 */ 1282 const hci_cmd_t hci_le_set_default_phy = { 1283 OPCODE(OGF_LE_CONTROLLER, 0x31), "111" 1284 // return: status 1285 }; 1286 1287 /** 1288 * @param con_handle 1289 * @param all_phys 1290 * @param tx_phys 1291 * @param rx_phys 1292 * @param phy_options 1293 */ 1294 const hci_cmd_t hci_le_set_phy = { 1295 OPCODE(OGF_LE_CONTROLLER, 0x32), "H1111" 1296 // LE PHY Update Complete is generated on completion 1297 }; 1298 1299 1300 #endif 1301 1302 // Broadcom / Cypress specific HCI commands 1303 1304 /** 1305 * @brief Configure SCO Routing (BCM) 1306 * @param sco_routing is 0 for PCM, 1 for Transport, 2 for Codec and 3 for I2S 1307 * @param pcm_interface_rate is 0 for 128KBps, 1 for 256 KBps, 2 for 512KBps, 3 for 1024KBps, and 4 for 2048Kbps 1308 * @param frame_type is 0 for short and 1 for long 1309 * @param sync_mode is 0 for slave and 1 for master 1310 * @param clock_mode is 0 for slabe and 1 for master 1311 */ 1312 const hci_cmd_t hci_bcm_write_sco_pcm_int = { 1313 OPCODE(0x3f, 0x1c), "11111" 1314 // return: status 1315 }; 1316 1317 /** 1318 * @brief Activates selected Sleep Mode 1319 * @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 1320 * @param idle_threshold_host (modes 1,2,5,7) time until considered idle, unit roughly 300 ms 1321 * @param idle_threshold_controller (modes 1-7,9) time until considered idle, unit roughly 300 ms 1322 * @param bt_wake_active_mode (modes 1,2,7) 0 = BT_WAKE line is active high, 1 = BT_WAKE is active low 1323 * @param host_wake_active_mode (modes 1,2,5,7) 0 = HOST_WAKE line is active high, 1 = HOST_WAKE is active low 1324 * @param allow_host_sleep_during_sco (modes 1,2,3,5,7) 1325 * @param combine_sleep_mode_and_lpm (modes 1,2,3,5,7) 1326 * @param enable_tristate_control_of_uart_tx_line (modes 1,2,7) 1327 * @param active_connection_handling_on_suspend (modes 3,5) 1328 * @param resume_timeout (modes 3,5) 1329 * @param enable_break_to_host (mode 12) 1330 * @param pulsed_host_wake (modes 1,12) 1331 */ 1332 const hci_cmd_t hci_bcm_set_sleep_mode = { 1333 OPCODE(0x3f, 0x0027), "111111111111" 1334 }; 1335 1336 /** 1337 * @brief Set TX Power Table 1338 * @param is_le 0=classic, 1=LE 1339 * @param chip_max_tx_pwr_db chip level max TX power in dBM 1340 */ 1341 const hci_cmd_t hci_bcm_write_tx_power_table = { 1342 OPCODE(0x3f, 0x1C9), "11" 1343 }; 1344 1345 const hci_cmd_t hci_bcm_set_tx_pwr = { 1346 OPCODE(0x3f, 0x1A5), "11H" 1347 }; 1348 1349 /** 1350 * 1351 * 1352 * @brief This command tests the RF transceiver in continuous transmission mode. 1353 * The transmitter is activated by configuring the transmission parameters such as pattern, 1354 * modulation, and frequency. 1355 * @see processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_DRPb_Tester_Con_TX.280xFD84.29 1356 * @param modulation 1357 * @param test_patern 1358 * @param frequency 1359 * @param power_level 1360 * @param reserved1 1361 * @param reserved2 1362 */ 1363 const hci_cmd_t hci_ti_drpb_tester_con_tx = { 1364 0xFD84, "111144" 1365 }; 1366 1367 /** 1368 * @brief This command starts sending/receiving packets using packet transmission parameters such as 1369 * frequency channel, packet type, and packet length. It is used for Packet TX/RX. 1370 * @see processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_DRPb_Tester_Packet_TX_RX_.280xFD85.29 1371 * @param frequency_mode 1372 * @param tx_single_frequency 1373 * @param rx_single_frequency 1374 * @param acl_packet_type 1375 * @paarm acl_packet_data_pattern 1376 * @param reserved 1377 * @param power_level 1378 * @param disable_whitening 1379 * @param prbs9_initialization_value 1380 */ 1381 const hci_cmd_t hci_ti_drpb_tester_packet_tx_rx = { 1382 0xFD85, "1111112112" 1383 }; 1384 1385