1 /* 2 * Copyright (C) 2015 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 /* 39 * btstack-defines.h 40 * 41 * BTstack definitions, events, and error codes */ 42 43 #ifndef __BTSTACK_DEFINES_H 44 #define __BTSTACK_DEFINES_H 45 46 #include <stdint.h> 47 #include "btstack_linked_list.h" 48 49 // TYPES 50 51 // packet handler 52 typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); 53 54 // packet callback supporting multiple registrations 55 typedef struct { 56 btstack_linked_item_t item; 57 btstack_packet_handler_t callback; 58 } btstack_packet_callback_registration_t; 59 60 /** 61 * @brief 128 bit key used with AES128 in Security Manager 62 */ 63 typedef uint8_t sm_key_t[16]; 64 65 // DEFINES 66 67 #define DAEMON_EVENT_PACKET 0x05 68 69 // L2CAP data 70 #define L2CAP_DATA_PACKET 0x06 71 72 // RFCOMM data 73 #define RFCOMM_DATA_PACKET 0x07 74 75 // Attribute protocol data 76 #define ATT_DATA_PACKET 0x08 77 78 // Security Manager protocol data 79 #define SM_DATA_PACKET 0x09 80 81 // SDP query result 82 // format: type (8), record_id (16), attribute_id (16), attribute_length (16), attribute_value (max 1k) 83 #define SDP_CLIENT_PACKET 0x0a 84 85 // BNEP data 86 #define BNEP_DATA_PACKET 0x0b 87 88 // Unicast Connectionless Data 89 #define UCD_DATA_PACKET 0x0c 90 91 // debug log messages 92 #define LOG_MESSAGE_PACKET 0xfc 93 94 95 // ERRORS 96 97 // last error code in 2.1 is 0x38 - we start with 0x50 for BTstack errors 98 #define BTSTACK_CONNECTION_TO_BTDAEMON_FAILED 0x50 99 #define BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH 0x51 100 #define BTSTACK_ACTIVATION_POWERON_FAILED 0x52 101 #define BTSTACK_ACTIVATION_FAILED_UNKNOWN 0x53 102 #define BTSTACK_NOT_ACTIVATED 0x54 103 #define BTSTACK_BUSY 0x55 104 #define BTSTACK_MEMORY_ALLOC_FAILED 0x56 105 #define BTSTACK_ACL_BUFFERS_FULL 0x57 106 107 // l2cap errors - enumeration by the command that created them 108 #define L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60 109 #define L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61 110 #define L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62 111 112 #define L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL 0x63 113 #define L2CAP_CONNECTION_RESPONSE_RESULT_PENDING 0x64 114 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM 0x65 115 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY 0x66 116 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x67 117 #define L2CAP_CONNECTION_RESPONSE_RESULT_RTX_TIMEOUT 0x68 118 119 #define L2CAP_SERVICE_ALREADY_REGISTERED 0x69 120 #define L2CAP_DATA_LEN_EXCEEDS_REMOTE_MTU 0x6A 121 122 #define RFCOMM_MULTIPLEXER_STOPPED 0x70 123 #define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 124 #define RFCOMM_NO_OUTGOING_CREDITS 0x72 125 #define RFCOMM_AGGREGATE_FLOW_OFF 0x73 126 #define RFCOMM_DATA_LEN_EXCEEDS_MTU 0x74 127 128 #define SDP_HANDLE_ALREADY_REGISTERED 0x80 129 #define SDP_QUERY_INCOMPLETE 0x81 130 #define SDP_SERVICE_NOT_FOUND 0x82 131 #define SDP_HANDLE_INVALID 0x83 132 133 #define ATT_HANDLE_VALUE_INDICATION_IN_PORGRESS 0x90 134 #define ATT_HANDLE_VALUE_INDICATION_TIMEOUT 0x91 135 136 #define GATT_CLIENT_NOT_CONNECTED 0x93 137 #define GATT_CLIENT_BUSY 0x94 138 #define GATT_CLIENT_IN_WRONG_STATE 0x95 139 #define GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS 0x96 140 #define GATT_CLIENT_VALUE_TOO_LONG 0x97 141 #define GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED 0x98 142 #define GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED 0x99 143 144 #define BNEP_SERVICE_ALREADY_REGISTERED 0xA0 145 #define BNEP_CHANNEL_NOT_CONNECTED 0xA1 146 #define BNEP_DATA_LEN_EXCEEDS_MTU 0xA2 147 148 // COMMANDS 149 150 #define OGF_BTSTACK 0x3d 151 152 // cmds for BTstack 153 // get state: @returns HCI_STATE 154 #define BTSTACK_GET_STATE 0x01 155 156 // set power mode: @param HCI_POWER_MODE 157 #define BTSTACK_SET_POWER_MODE 0x02 158 159 // set capture mode: @param on 160 #define BTSTACK_SET_ACL_CAPTURE_MODE 0x03 161 162 // get BTstack version 163 #define BTSTACK_GET_VERSION 0x04 164 165 // get system Bluetooth state 166 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED 0x05 167 168 // set system Bluetooth state 169 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED 0x06 170 171 // enable inquiry scan for this client 172 #define BTSTACK_SET_DISCOVERABLE 0x07 173 174 // set global Bluetooth state 175 #define BTSTACK_SET_BLUETOOTH_ENABLED 0x08 176 177 // create l2cap channel: @param bd_addr(48), psm (16) 178 #define L2CAP_CREATE_CHANNEL 0x20 179 180 // disconnect l2cap disconnect, @param channel(16), reason(8) 181 #define L2CAP_DISCONNECT 0x21 182 183 // register l2cap service: @param psm(16), mtu (16) 184 #define L2CAP_REGISTER_SERVICE 0x22 185 186 // unregister l2cap disconnect, @param psm(16) 187 #define L2CAP_UNREGISTER_SERVICE 0x23 188 189 // accept connection @param bd_addr(48), dest cid (16) 190 #define L2CAP_ACCEPT_CONNECTION 0x24 191 192 // decline l2cap disconnect,@param bd_addr(48), dest cid (16), reason(8) 193 #define L2CAP_DECLINE_CONNECTION 0x25 194 195 // create l2cap channel: @param bd_addr(48), psm (16), mtu (16) 196 #define L2CAP_CREATE_CHANNEL_MTU 0x26 197 198 // register SDP Service Record: service record (size) 199 #define SDP_REGISTER_SERVICE_RECORD 0x30 200 201 // unregister SDP Service Record 202 #define SDP_UNREGISTER_SERVICE_RECORD 0x31 203 204 // Get remote RFCOMM services 205 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES 0x32 206 207 // Get remote SDP services 208 #define SDP_CLIENT_QUERY_SERVICES 0x33 209 210 // RFCOMM "HCI" Commands 211 #define RFCOMM_CREATE_CHANNEL 0x40 212 #define RFCOMM_DISCONNECT 0x41 213 #define RFCOMM_REGISTER_SERVICE 0x42 214 #define RFCOMM_UNREGISTER_SERVICE 0x43 215 #define RFCOMM_ACCEPT_CONNECTION 0x44 216 #define RFCOMM_DECLINE_CONNECTION 0x45 217 #define RFCOMM_PERSISTENT_CHANNEL 0x46 218 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS 0x47 219 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS 0x48 220 #define RFCOMM_GRANT_CREDITS 0x49 221 222 // GAP Classic 0x50 223 #define GAP_DISCONNECT 0x50 224 225 // GAP LE 0x60 226 #define GAP_LE_SCAN_START 0x60 227 #define GAP_LE_SCAN_STOP 0x61 228 #define GAP_LE_CONNECT 0x62 229 #define GAP_LE_CONNECT_CANCEL 0x63 230 #define GAP_LE_SET_SCAN_PARAMETERS 0x64 231 232 // GATT (Client) 0x70 233 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70 234 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16 0x71 235 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128 0x72 236 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE 0x73 237 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE 0x74 238 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128 0x75 239 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS 0x76 240 #define GATT_READ_VALUE_OF_CHARACTERISTIC 0x77 241 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC 0x78 242 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE 0x79 243 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC 0x7A 244 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7B 245 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7C 246 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR 0X7D 247 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR 0X7E 248 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR 0X7F 249 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR 0X80 250 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION 0X81 251 #define GATT_GET_MTU 0x82 252 253 254 // EVENTS 255 256 /** 257 * @format 1 258 * @param state 259 */ 260 #define BTSTACK_EVENT_STATE 0x60 261 262 // data: event(8), len(8), nr hci connections 263 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 264 265 /** 266 * @format 267 */ 268 #define BTSTACK_EVENT_POWERON_FAILED 0x62 269 270 /** 271 * @format 112 272 * @param major 273 * @param minor 274 @ @param revision 275 */ 276 #define BTSTACK_EVENT_VERSION 0x63 277 278 // data: system bluetooth on/off (bool) 279 #define BTSTACK_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 280 281 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes) 282 #define BTSTACK_EVENT_REMOTE_NAME_CACHED 0x65 283 284 // data: discoverable enabled (bool) 285 #define BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 286 287 // Daemon Events used internally 288 289 // data: event(8) 290 #define DAEMON_EVENT_CONNECTION_OPENED 0x68 291 292 // data: event(8) 293 #define DAEMON_EVENT_CONNECTION_CLOSED 0x69 294 295 // data: event(8), nr_connections(8) 296 #define DAEMON_NR_CONNECTIONS_CHANGED 0x6A 297 298 // data: event(8) 299 #define DAEMON_EVENT_NEW_RFCOMM_CREDITS 0x6B 300 301 // data: event(8) 302 #define DAEMON_EVENT_HCI_PACKET_SENT 0x6C 303 304 // additional HCI events 305 /** 306 * @format B 307 * @param handle 308 */ 309 #define HCI_EVENT_SCO_CAN_SEND_NOW 0x6F 310 311 // L2CAP EVENTS 312 313 /** 314 * @format 1BH222222 315 * @param status 316 * @param address 317 * @param handle 318 * @param psm 319 * @param local_cid 320 * @param remote_cid 321 * @param local_mtu 322 * @param remote_mtu 323 * @param flush_timeout 324 */ 325 #define L2CAP_EVENT_CHANNEL_OPENED 0x70 326 327 /* 328 * @format 2 329 * @param local_cid 330 */ 331 #define L2CAP_EVENT_CHANNEL_CLOSED 0x71 332 333 /** 334 * @format 1BH222 335 * @param status 336 * @param address 337 * @param handle 338 * @param psm 339 * @param local_cid 340 * @param remote_cid 341 */ 342 #define L2CAP_EVENT_INCOMING_CONNECTION 0x72 343 344 // ?? 345 // data: event(8), len(8), handle(16) 346 #define L2CAP_EVENT_TIMEOUT_CHECK 0x73 347 348 // ?? 349 // data: event(8), len(8), local_cid(16), credits(8) 350 #define L2CAP_EVENT_CREDITS 0x74 351 352 /** 353 * @format 12 354 * @param status 355 * @param psm 356 */ 357 #define L2CAP_EVENT_SERVICE_REGISTERED 0x75 358 359 /** 360 * @format H2222 361 * @param handle 362 * @param interval_min 363 * @param interval_max 364 * @param latencey 365 * @param timeout_multiplier 366 */ 367 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 0x76 368 369 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail) 370 /** 371 * @format H2 372 * @param handle 373 * @result 374 */ 375 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 0x77 376 377 /** 378 * @format 2 379 * @param local_cid 380 */ 381 #define L2CAP_EVENT_CAN_SEND_NOW 0x78 382 383 // RFCOMM EVENTS 384 385 /** 386 * @format 1B2122 387 * @param status 388 * @param bd_addr 389 * @param con_handle 390 * @param server_channel 391 * @param rfcomm_cid 392 * @param max_frame_size 393 */ 394 #define RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE 0x80 395 396 /** 397 * @format 2 398 * @param rfcomm_cid 399 */ 400 #define RFCOMM_EVENT_CHANNEL_CLOSED 0x81 401 402 /** 403 * @format B12 404 * @param bd_addr 405 * @param server_channel 406 * @param rfcomm_cid 407 */ 408 #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 409 410 /** 411 * @format 21 412 * @param rfcomm_cid 413 * @param line_status 414 */ 415 #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 416 417 /** 418 * @format 21 419 * @param rfcomm_cid 420 * @param credits 421 */ 422 #define RFCOMM_EVENT_CREDITS 0x84 423 424 /** 425 * @format 11 426 * @param status 427 * @param channel_id 428 */ 429 #define RFCOMM_EVENT_SERVICE_REGISTERED 0x85 430 431 /** 432 * @format 11 433 * @param status 434 * @param server_channel_id 435 */ 436 #define RFCOMM_EVENT_PERSISTENT_CHANNEL 0x86 437 438 /** 439 * @format 21 440 * @param rfcomm_cid 441 * @param modem_status 442 */ 443 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 444 445 /** 446 * TODO: format for variable data 2? 447 * @param rfcomm_cid 448 * @param rpn_data 449 */ 450 #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 451 452 /** 453 * @format 2 454 * @param local_cid 455 */ 456 #define RFCOMM_EVENT_CAN_SEND_NOW 0x89 457 458 459 /** 460 * @format 14 461 * @param status 462 * @param service_record_handle 463 */ 464 #define SDP_EVENT_SERVICE_REGISTERED 0x90 465 466 /** 467 * @format 1 468 * @param status 469 */ 470 #define SDP_EVENT_QUERY_COMPLETE 0x91 471 472 /** 473 * @format 1T 474 * @param rfcomm_channel 475 * @param name 476 */ 477 #define SDP_EVENT_QUERY_RFCOMM_SERVICE 0x92 478 479 /** 480 * @format 22221 481 * @param record_id 482 * @param attribute_id 483 * @param attribute_length 484 * @param data_offset 485 * @param data 486 */ 487 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE 0x93 488 489 /** 490 * @format 22LV 491 * @param record_id 492 * @param attribute_id 493 * @param attribute_length 494 * @param attribute_value 495 */ 496 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE 0x94 497 498 /** 499 * @format 224 500 * @param total_count 501 * @param record_index 502 * @param record_handle 503 * @note Not provided by daemon, only used for internal testing 504 */ 505 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 0x95 506 507 /** 508 * @format H1 509 * @param handle 510 * @param status 511 */ 512 #define GATT_EVENT_QUERY_COMPLETE 0xA0 513 514 /** 515 * @format HX 516 * @param handle 517 * @param service 518 */ 519 #define GATT_EVENT_SERVICE_QUERY_RESULT 0xA1 520 521 /** 522 * @format HY 523 * @param handle 524 * @param characteristic 525 */ 526 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 0xA2 527 528 /** 529 * @format H2X 530 * @param handle 531 * @param include_handle 532 * @param service 533 */ 534 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 0xA3 535 536 /** 537 * @format HZ 538 * @param handle 539 * @param characteristic_descriptor 540 */ 541 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 0xA4 542 543 /** 544 * @format H2LV 545 * @param handle 546 * @param value_handle 547 * @param value_length 548 * @param value 549 */ 550 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA5 551 552 /** 553 * @format H22LV 554 * @param handle 555 * @param value_handle 556 * @param value_offset 557 * @param value_length 558 * @param value 559 */ 560 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA6 561 562 /** 563 * @format H2LV 564 * @param handle 565 * @param value_handle 566 * @param value_length 567 * @param value 568 */ 569 #define GATT_EVENT_NOTIFICATION 0xA7 570 571 /** 572 * @format H2LV 573 * @param handle 574 * @param value_handle 575 * @param value_length 576 * @param value 577 */ 578 #define GATT_EVENT_INDICATION 0xA8 579 580 /** 581 * @format H2LV 582 * @param descriptor_handle 583 * @param descriptor_length 584 * @param descriptor 585 */ 586 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xA9 587 588 /** 589 * @format H2LV 590 * @param handle 591 * @param descriptor_offset 592 * @param descriptor_length 593 * @param descriptor 594 */ 595 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xAA 596 597 /** 598 * @format H2 599 * @param handle 600 * @param MTU 601 */ 602 #define GATT_EVENT_MTU 0xAB 603 604 /** 605 * @format H2 606 * @param handle 607 * @param MTU 608 */ 609 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE 0xB5 610 611 // data: event(8), len(8), status (8), hci_handle (16), attribute_handle (16) 612 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 0xB6 613 614 615 // data: event(8), len(8), status (8), bnep service uuid (16) 616 #define BNEP_EVENT_SERVICE_REGISTERED 0xC0 617 618 // data: event(8), len(8), status (8), bnep source uuid (16), bnep destination uuid (16), mtu (16), remote_address (48) 619 #define BNEP_EVENT_OPEN_CHANNEL_COMPLETE 0xC1 620 621 // data: event(8), len(8), bnep source uuid (16), bnep destination uuid (16), remote_address (48) 622 #define BNEP_EVENT_CHANNEL_CLOSED 0xC2 623 624 // data: event(8), len(8), bnep source uuid (16), bnep destination uuid (16), remote_address (48), channel state (8) 625 #define BNEP_EVENT_CHANNEL_TIMEOUT 0xC3 626 627 // data: event(8), len(8) 628 #define BNEP_EVENT_READY_TO_SEND 0xC4 629 630 /** 631 * @format H1B 632 * @param handle 633 * @param addr_type 634 * @param address 635 */ 636 #define SM_EVENT_JUST_WORKS_REQUEST 0xD0 637 638 /** 639 * @format H1B 640 * @param handle 641 * @param addr_type 642 * @param address 643 */ 644 #define SM_EVENT_JUST_WORKS_CANCEL 0xD1 645 646 /** 647 * @format H1B4 648 * @param handle 649 * @param addr_type 650 * @param address 651 * @param passkey 652 */ 653 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER 0xD2 654 655 /** 656 * @format H1B 657 * @param handle 658 * @param addr_type 659 * @param address 660 */ 661 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL 0xD3 662 663 /** 664 * @format H1B421 665 * @param handle 666 * @param addr_type 667 * @param address 668 */ 669 #define SM_EVENT_PASSKEY_INPUT_NUMBER 0xD4 670 671 /** 672 * @format H1B 673 * @param handle 674 * @param addr_type 675 * @param address 676 */ 677 #define SM_EVENT_PASSKEY_INPUT_CANCEL 0xD5 678 679 /** 680 * @format H1B 681 * @param handle 682 * @param addr_type 683 * @param address 684 */ 685 #define SM_EVENT_IDENTITY_RESOLVING_STARTED 0xD6 686 687 /** 688 * @format H1B 689 * @param handle 690 * @param addr_type 691 * @param address 692 */ 693 #define SM_EVENT_IDENTITY_RESOLVING_FAILED 0xD7 694 695 /** 696 * @format H1B2 697 * @param handle 698 * @param addr_type 699 * @param address 700 * @param le_device_db_index 701 */ 702 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 0xD8 703 704 /** 705 * @format H1B 706 * @param handle 707 * @param addr_type 708 * @param address 709 */ 710 #define SM_EVENT_AUTHORIZATION_REQUEST 0xD9 711 712 /** 713 * @format H1B1 714 * @param handle 715 * @param addr_type 716 * @param address 717 * @param authorization_result 718 */ 719 #define SM_EVENT_AUTHORIZATION_RESULT 0xDA 720 721 // GAP 722 723 // data: event(8), len(8), hci_handle (16), security_level (8) 724 #define GAP_EVENT_SECURITY_LEVEL 0xE0 725 726 // data: event(8), len(8), status (8), bd_addr(48) 727 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED 0xE1 728 729 /** 730 * @format 11B1JV 731 * @param advertising_event_type 732 * @param address_type 733 * @param address 734 * @param rssi 735 * @param data_length 736 * @param data 737 */ 738 #define GAP_LE_EVENT_ADVERTISING_REPORT 0xE2 739 740 #define HCI_EVENT_HSP_META 0xE8 741 742 #define HSP_SUBEVENT_ERROR 0x01 743 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x02 744 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x03 745 #define HSP_SUBEVENT_RING 0x04 746 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x05 747 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x06 748 #define HSP_SUBEVENT_HS_COMMAND 0x07 749 #define HSP_SUBEVENT_AG_INDICATION 0x08 750 751 #define HCI_EVENT_HFP_META 0xE9 752 753 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 0x01 754 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 755 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 756 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED 0x04 757 #define HFP_SUBEVENT_COMPLETE 0x05 758 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 0x06 759 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 0x07 760 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 0x08 761 #define HFP_SUBEVENT_CODECS_CONNECTION_COMPLETE 0x09 762 #define HFP_SUBEVENT_START_RINGINIG 0x0A 763 #define HFP_SUBEVENT_STOP_RINGINIG 0x0B 764 #define HFP_SUBEVENT_CALL_TERMINATED 0x0C 765 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 0x0D 766 #define HFP_SUBEVENT_REDIAL_LAST_NUMBER 0x0E 767 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG 0x0F 768 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 0x10 769 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES 0x11 770 #define HFP_SUBEVENT_TRANSMIT_STATUS_OF_CURRENT_CALL 0x12 771 #define HFP_SUBEVENT_CALL_ANSWERED 0x13 772 #define HFP_SUBEVENT_CONFERENCE_CALL 0x14 773 #define HFP_SUBEVENT_RING 0x15 774 #define HFP_SUBEVENT_SPEAKER_VOLUME 0x16 775 #define HFP_SUBEVENT_MICROPHONE_VOLUME 0x17 776 777 // ANCS Client 778 779 /** 780 * @format H 781 * @param handle 782 */ 783 #define ANCS_EVENT_CLIENT_CONNECTED 0xF0 784 785 /** 786 * @format H2T 787 * @param handle 788 * @param attribute_id 789 * @param text 790 */ 791 #define ANCS_EVENT_CLIENT_NOTIFICATION 0xF1 792 793 /** 794 * @format H 795 * @param handle 796 */ 797 #define ANCS_EVENT_CLIENT_DISCONNECTED 0xF2 798 799 // #define HCI_EVENT_HFP_META 0xxx 800 // #define HCI_EVENT_GATT_META 0xxx 801 // #define HCI_EVENT_SDP_META 0xxx 802 // #define HCI_EVENT_ANCS_META 0xxx 803 // #define HCI_EVENT_SM_META 0xxx 804 // #define HCI_EVENT_GAP_META 0xxx 805 // #define HCI_EVENT_BNEP_META 0xxx 806 // #define HCI_EVENT_PAN_META 0xxx 807 808 #endif 809