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 50 // UNUSED macro 51 #ifndef UNUSED 52 #define UNUSED(x) (void)(sizeof(x)) 53 #endif 54 55 // TYPES 56 57 // packet handler 58 typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); 59 60 // packet callback supporting multiple registrations 61 typedef struct { 62 btstack_linked_item_t item; 63 btstack_packet_handler_t callback; 64 } btstack_packet_callback_registration_t; 65 66 // context callback supporting multiple registrations 67 typedef struct { 68 btstack_linked_item_t * item; 69 void (*callback)(void * context); 70 void * context; 71 } btstack_context_callback_registration_t; 72 73 /** 74 * @brief 128 bit key used with AES128 in Security Manager 75 */ 76 typedef uint8_t sm_key_t[16]; 77 78 // DEFINES 79 80 // hci con handles (12 bit): 0x0000..0x0fff 81 #define HCI_CON_HANDLE_INVALID 0xffff 82 83 84 #define DAEMON_EVENT_PACKET 0x05 85 86 // L2CAP data 87 #define L2CAP_DATA_PACKET 0x06 88 89 // RFCOMM data 90 #define RFCOMM_DATA_PACKET 0x07 91 92 // Attribute protocol data 93 #define ATT_DATA_PACKET 0x08 94 95 // Security Manager protocol data 96 #define SM_DATA_PACKET 0x09 97 98 // SDP query result - only used by daemon 99 // format: type (8), record_id (16), attribute_id (16), attribute_length (16), attribute_value (max 1k) 100 #define SDP_CLIENT_PACKET 0x0a 101 102 // BNEP data 103 #define BNEP_DATA_PACKET 0x0b 104 105 // Unicast Connectionless Data 106 #define UCD_DATA_PACKET 0x0c 107 108 // GOEP data 109 #define GOEP_DATA_PACKET 0x0d 110 111 // PBAP data 112 #define PBAP_DATA_PACKET 0x0e 113 114 // AVRCP browsing data 115 #define AVRCP_BROWSING_DATA_PACKET 0x0f 116 117 118 // debug log messages 119 #define LOG_MESSAGE_PACKET 0xfc 120 121 122 // ERRORS 123 // last error code in 2.1 is 0x38 - we start with 0x50 for BTstack errors 124 125 /* ENUM_START: BTSTACK_ERROR_CODE */ 126 #define BTSTACK_CONNECTION_TO_BTDAEMON_FAILED 0x50 127 #define BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH 0x51 128 #define BTSTACK_ACTIVATION_POWERON_FAILED 0x52 129 #define BTSTACK_ACTIVATION_FAILED_UNKNOWN 0x53 130 #define BTSTACK_NOT_ACTIVATED 0x54 131 #define BTSTACK_BUSY 0x55 132 #define BTSTACK_MEMORY_ALLOC_FAILED 0x56 133 #define BTSTACK_ACL_BUFFERS_FULL 0x57 134 135 // l2cap errors - enumeration by the command that created them 136 #define L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60 137 #define L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61 138 #define L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62 139 140 #define L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL 0x63 141 #define L2CAP_CONNECTION_RESPONSE_RESULT_PENDING 0x64 142 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM 0x65 143 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY 0x66 144 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x67 145 #define L2CAP_CONNECTION_RESPONSE_RESULT_ERTM_NOT_SUPPORTED 0x68 146 // should be L2CAP_CONNECTION_RTX_TIMEOUT 147 #define L2CAP_CONNECTION_RESPONSE_RESULT_RTX_TIMEOUT 0x69 148 #define L2CAP_CONNECTION_BASEBAND_DISCONNECT 0x6A 149 #define L2CAP_SERVICE_ALREADY_REGISTERED 0x6B 150 #define L2CAP_DATA_LEN_EXCEEDS_REMOTE_MTU 0x6C 151 #define L2CAP_SERVICE_DOES_NOT_EXIST 0x6D 152 #define L2CAP_LOCAL_CID_DOES_NOT_EXIST 0x6E 153 154 #define RFCOMM_MULTIPLEXER_STOPPED 0x70 155 #define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 156 #define RFCOMM_NO_OUTGOING_CREDITS 0x72 157 #define RFCOMM_AGGREGATE_FLOW_OFF 0x73 158 #define RFCOMM_DATA_LEN_EXCEEDS_MTU 0x74 159 160 #define SDP_HANDLE_ALREADY_REGISTERED 0x80 161 #define SDP_QUERY_INCOMPLETE 0x81 162 #define SDP_SERVICE_NOT_FOUND 0x82 163 #define SDP_HANDLE_INVALID 0x83 164 #define SDP_QUERY_BUSY 0x84 165 166 #define ATT_HANDLE_VALUE_INDICATION_IN_PROGRESS 0x90 167 #define ATT_HANDLE_VALUE_INDICATION_TIMEOUT 0x91 168 #define ATT_HANDLE_VALUE_INDICATION_DISCONNECT 0x92 169 170 #define GATT_CLIENT_NOT_CONNECTED 0x93 171 #define GATT_CLIENT_BUSY 0x94 172 #define GATT_CLIENT_IN_WRONG_STATE 0x95 173 #define GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS 0x96 174 #define GATT_CLIENT_VALUE_TOO_LONG 0x97 175 #define GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED 0x98 176 #define GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED 0x99 177 178 #define BNEP_SERVICE_ALREADY_REGISTERED 0xA0 179 #define BNEP_CHANNEL_NOT_CONNECTED 0xA1 180 #define BNEP_DATA_LEN_EXCEEDS_MTU 0xA2 181 182 // OBEX ERRORS 183 #define OBEX_UNKNOWN_ERROR 0xB0 184 #define OBEX_CONNECT_FAILED 0xB1 185 #define OBEX_DISCONNECTED 0xB2 186 #define OBEX_NOT_FOUND 0xB3 187 #define OBEX_NOT_ACCEPTABLE 0xB4 188 189 #define AVDTP_SEID_DOES_NOT_EXIST 0xC0 190 #define AVDTP_CONNECTION_DOES_NOT_EXIST 0xC1 191 #define AVDTP_CONNECTION_IN_WRONG_STATE 0xC2 192 #define AVDTP_STREAM_ENDPOINT_IN_WRONG_STATE 0xC3 193 #define AVDTP_STREAM_ENDPOINT_DOES_NOT_EXIST 0xC4 194 #define AVDTP_MEDIA_CONNECTION_DOES_NOT_EXIST 0xC5 195 /* ENUM_END */ 196 197 // DAEMON COMMANDS 198 199 #define OGF_BTSTACK 0x3d 200 201 // cmds for BTstack 202 // get state: @returns HCI_STATE 203 #define BTSTACK_GET_STATE 0x01 204 205 // set power mode: param HCI_POWER_MODE 206 #define BTSTACK_SET_POWER_MODE 0x02 207 208 // set capture mode: param on 209 #define BTSTACK_SET_ACL_CAPTURE_MODE 0x03 210 211 // get BTstack version 212 #define BTSTACK_GET_VERSION 0x04 213 214 // get system Bluetooth state 215 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED 0x05 216 217 // set system Bluetooth state 218 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED 0x06 219 220 // enable inquiry scan for this client 221 #define BTSTACK_SET_DISCOVERABLE 0x07 222 223 // set global Bluetooth state 224 #define BTSTACK_SET_BLUETOOTH_ENABLED 0x08 225 226 // create l2cap channel: param bd_addr(48), psm (16) 227 #define L2CAP_CREATE_CHANNEL 0x20 228 229 // disconnect l2cap disconnect, param channel(16), reason(8) 230 #define L2CAP_DISCONNECT 0x21 231 232 // register l2cap service: param psm(16), mtu (16) 233 #define L2CAP_REGISTER_SERVICE 0x22 234 235 // unregister l2cap disconnect, param psm(16) 236 #define L2CAP_UNREGISTER_SERVICE 0x23 237 238 // accept connection param bd_addr(48), dest cid (16) 239 #define L2CAP_ACCEPT_CONNECTION 0x24 240 241 // decline l2cap disconnect,param bd_addr(48), dest cid (16), reason(8) 242 #define L2CAP_DECLINE_CONNECTION 0x25 243 244 // create l2cap channel: param bd_addr(48), psm (16), mtu (16) 245 #define L2CAP_CREATE_CHANNEL_MTU 0x26 246 247 // register SDP Service Record: service record (size) 248 #define SDP_REGISTER_SERVICE_RECORD 0x30 249 250 // unregister SDP Service Record 251 #define SDP_UNREGISTER_SERVICE_RECORD 0x31 252 253 // Get remote RFCOMM services 254 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES 0x32 255 256 // Get remote SDP services 257 #define SDP_CLIENT_QUERY_SERVICES 0x33 258 259 // RFCOMM "HCI" Commands 260 #define RFCOMM_CREATE_CHANNEL 0x40 261 #define RFCOMM_DISCONNECT 0x41 262 #define RFCOMM_REGISTER_SERVICE 0x42 263 #define RFCOMM_UNREGISTER_SERVICE 0x43 264 #define RFCOMM_ACCEPT_CONNECTION 0x44 265 #define RFCOMM_DECLINE_CONNECTION 0x45 266 #define RFCOMM_PERSISTENT_CHANNEL 0x46 267 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS 0x47 268 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS 0x48 269 #define RFCOMM_GRANT_CREDITS 0x49 270 271 // GAP Classic 0x50 272 #define GAP_DISCONNECT 0x50 273 274 // GAP LE 0x60 275 #define GAP_LE_SCAN_START 0x60 276 #define GAP_LE_SCAN_STOP 0x61 277 #define GAP_LE_CONNECT 0x62 278 #define GAP_LE_CONNECT_CANCEL 0x63 279 #define GAP_LE_SET_SCAN_PARAMETERS 0x64 280 281 // GATT (Client) 0x70 282 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70 283 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16 0x71 284 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128 0x72 285 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE 0x73 286 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE 0x74 287 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128 0x75 288 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS 0x76 289 #define GATT_READ_VALUE_OF_CHARACTERISTIC 0x77 290 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC 0x78 291 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE 0x79 292 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC 0x7A 293 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7B 294 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7C 295 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR 0X7D 296 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR 0X7E 297 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR 0X7F 298 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR 0X80 299 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION 0X81 300 #define GATT_GET_MTU 0x82 301 302 // SM 0x90 303 #define SM_SET_AUTHENTICATION_REQUIREMENTS 0x90 304 #define SM_SET_IO_CAPABILITIES 0x92 305 #define SM_BONDING_DECLINE 0x93 306 #define SM_JUST_WORKS_CONFIRM 0x94 307 #define SM_NUMERIC_COMPARISON_CONFIRM 0x95 308 #define SM_PASSKEY_INPUT 0x96 309 310 // ATT 311 312 // .. 313 // Internal properties reuse some GATT Characteristic Properties fields 314 #define ATT_DB_VERSION 0x01 315 316 // EVENTS 317 318 /** 319 * @format 1 320 * @param state 321 */ 322 #define BTSTACK_EVENT_STATE 0x60 323 324 /** 325 * @format 1 326 * @param number_connections 327 */ 328 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 329 330 /** 331 * @format 332 */ 333 #define BTSTACK_EVENT_POWERON_FAILED 0x62 334 335 /** 336 * @format 1 337 * @param discoverable 338 */ 339 #define BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 340 341 // Daemon Events 342 343 /** 344 * @format 112 345 * @param major 346 * @param minor 347 @ @param revision 348 */ 349 #define DAEMON_EVENT_VERSION 0x63 350 351 // data: system bluetooth on/off (bool) 352 /** 353 * @format 1 354 * param system_bluetooth_enabled 355 */ 356 #define DAEMON_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 357 358 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes) 359 360 /* 361 * @format 1BT 362 * @param status == 0 to match read_remote_name_request 363 * @param address 364 * @param name 365 */ 366 #define DAEMON_EVENT_REMOTE_NAME_CACHED 0x65 367 368 // internal - data: event(8) 369 #define DAEMON_EVENT_CONNECTION_OPENED 0x67 370 371 // internal - data: event(8) 372 #define DAEMON_EVENT_CONNECTION_CLOSED 0x68 373 374 // data: event(8), len(8), local_cid(16), credits(8) 375 #define DAEMON_EVENT_L2CAP_CREDITS 0x74 376 377 /** 378 * @format 12 379 * @param status 380 * @param psm 381 */ 382 #define DAEMON_EVENT_L2CAP_SERVICE_REGISTERED 0x75 383 384 /** 385 * @format 21 386 * @param rfcomm_cid 387 * @param credits 388 */ 389 #define DAEMON_EVENT_RFCOMM_CREDITS 0x84 390 391 /** 392 * @format 11 393 * @param status 394 * @param channel_id 395 */ 396 #define DAEMON_EVENT_RFCOMM_SERVICE_REGISTERED 0x85 397 398 /** 399 * @format 11 400 * @param status 401 * @param server_channel_id 402 */ 403 #define DAEMON_EVENT_RFCOMM_PERSISTENT_CHANNEL 0x86 404 405 /** 406 * @format 14 407 * @param status 408 * @param service_record_handle 409 */ 410 #define DAEMON_EVENT_SDP_SERVICE_REGISTERED 0x90 411 412 413 414 // additional HCI events 415 416 /** 417 * @brief Indicates HCI transport enters/exits Sleep mode 418 * @format 1 419 * @param active 420 */ 421 #define HCI_EVENT_TRANSPORT_SLEEP_MODE 0x69 422 423 /** 424 * @brief Outgoing packet 425 */ 426 #define HCI_EVENT_TRANSPORT_PACKET_SENT 0x6E 427 428 /** 429 * @format B 430 * @param handle 431 */ 432 #define HCI_EVENT_SCO_CAN_SEND_NOW 0x6F 433 434 435 // L2CAP EVENTS 436 437 /** 438 * @format 1BH2222221 439 * @param status 440 * @param address 441 * @param handle 442 * @param psm 443 * @param local_cid 444 * @param remote_cid 445 * @param local_mtu 446 * @param remote_mtu 447 * @param flush_timeout 448 * @param incoming 449 */ 450 #define L2CAP_EVENT_CHANNEL_OPENED 0x70 451 452 /* 453 * @format 2 454 * @param local_cid 455 */ 456 #define L2CAP_EVENT_CHANNEL_CLOSED 0x71 457 458 /** 459 * @format BH222 460 * @param address 461 * @param handle 462 * @param psm 463 * @param local_cid 464 * @param remote_cid 465 */ 466 #define L2CAP_EVENT_INCOMING_CONNECTION 0x72 467 468 // ?? 469 // data: event(8), len(8), handle(16) 470 #define L2CAP_EVENT_TIMEOUT_CHECK 0x73 471 472 /** 473 * @format H2222 474 * @param handle 475 * @param interval_min 476 * @param interval_max 477 * @param latencey 478 * @param timeout_multiplier 479 */ 480 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 0x76 481 482 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail) 483 /** 484 * @format H2 485 * @param handle 486 * @param result 487 */ 488 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 0x77 489 490 /** 491 * @format 2 492 * @param local_cid 493 */ 494 #define L2CAP_EVENT_CAN_SEND_NOW 0x78 495 496 // LE Data Channels 497 498 /** 499 * @format 1BH2222 500 * @param address_type 501 * @param address 502 * @param handle 503 * @param psm 504 * @param local_cid 505 * @param remote_cid 506 * @param remote_mtu 507 */ 508 #define L2CAP_EVENT_LE_INCOMING_CONNECTION 0x79 509 510 /** 511 * @format 11BH122222 512 * @param status 513 * @param address_type 514 * @param address 515 * @param handle 516 * @param incoming 517 * @param psm 518 * @param local_cid 519 * @param remote_cid 520 * @param local_mtu 521 * @param remote_mtu 522 */ 523 #define L2CAP_EVENT_LE_CHANNEL_OPENED 0x7a 524 525 /* 526 * @format 2 527 * @param local_cid 528 */ 529 #define L2CAP_EVENT_LE_CHANNEL_CLOSED 0x7b 530 531 /* 532 * @format 2 533 * @param local_cid 534 */ 535 #define L2CAP_EVENT_LE_CAN_SEND_NOW 0x7c 536 537 /* 538 * @format 2 539 * @param local_cid 540 */ 541 #define L2CAP_EVENT_LE_PACKET_SENT 0x7d 542 543 544 // RFCOMM EVENTS 545 546 /** 547 * @format 1B21221 548 * @param status 549 * @param bd_addr 550 * @param con_handle 551 * @param server_channel 552 * @param rfcomm_cid 553 * @param max_frame_size 554 * @param incoming 555 */ 556 #define RFCOMM_EVENT_CHANNEL_OPENED 0x80 557 558 /** 559 * @format 2 560 * @param rfcomm_cid 561 */ 562 #define RFCOMM_EVENT_CHANNEL_CLOSED 0x81 563 564 /** 565 * @format B12 566 * @param bd_addr 567 * @param server_channel 568 * @param rfcomm_cid 569 */ 570 #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 571 572 /** 573 * @format 21 574 * @param rfcomm_cid 575 * @param line_status 576 */ 577 #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 578 579 /** 580 * @format 21 581 * @param rfcomm_cid 582 * @param modem_status 583 */ 584 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 585 586 /** 587 * TODO: format for variable data 2? 588 * param rfcomm_cid 589 * param rpn_data 590 */ 591 #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 592 593 /** 594 * @format 2 595 * @param rfcomm_cid 596 */ 597 #define RFCOMM_EVENT_CAN_SEND_NOW 0x89 598 599 600 /** 601 * @format 1 602 * @param status 603 */ 604 #define SDP_EVENT_QUERY_COMPLETE 0x91 605 606 /** 607 * @format 1T 608 * @param rfcomm_channel 609 * @param name 610 */ 611 #define SDP_EVENT_QUERY_RFCOMM_SERVICE 0x92 612 613 /** 614 * @format 22221 615 * @param record_id 616 * @param attribute_id 617 * @param attribute_length 618 * @param data_offset 619 * @param data 620 */ 621 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE 0x93 622 623 /** 624 * @format 22LV 625 * @param record_id 626 * @param attribute_id 627 * @param attribute_length 628 * @param attribute_value 629 */ 630 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE 0x94 631 632 /** 633 * @format 224 634 * @param total_count 635 * @param record_index 636 * @param record_handle 637 * @note Not provided by daemon, only used for internal testing 638 */ 639 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 0x95 640 641 /** 642 * @format H1 643 * @param handle 644 * @param status 645 */ 646 #define GATT_EVENT_QUERY_COMPLETE 0xA0 647 648 /** 649 * @format HX 650 * @param handle 651 * @param service 652 */ 653 #define GATT_EVENT_SERVICE_QUERY_RESULT 0xA1 654 655 /** 656 * @format HY 657 * @param handle 658 * @param characteristic 659 */ 660 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 0xA2 661 662 /** 663 * @format H2X 664 * @param handle 665 * @param include_handle 666 * @param service 667 */ 668 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 0xA3 669 670 /** 671 * @format HZ 672 * @param handle 673 * @param characteristic_descriptor 674 */ 675 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 0xA4 676 677 /** 678 * @format H2LV 679 * @param handle 680 * @param value_handle 681 * @param value_length 682 * @param value 683 */ 684 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA5 685 686 /** 687 * @format H22LV 688 * @param handle 689 * @param value_handle 690 * @param value_offset 691 * @param value_length 692 * @param value 693 */ 694 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA6 695 696 /** 697 * @format H2LV 698 * @param handle 699 * @param value_handle 700 * @param value_length 701 * @param value 702 */ 703 #define GATT_EVENT_NOTIFICATION 0xA7 704 705 /** 706 * @format H2LV 707 * @param handle 708 * @param value_handle 709 * @param value_length 710 * @param value 711 */ 712 #define GATT_EVENT_INDICATION 0xA8 713 714 /** 715 * @format H2LV 716 * @param handle 717 * @param descriptor_handle 718 * @param descriptor_length 719 * @param descriptor 720 */ 721 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xA9 722 723 /** 724 * @format H2LV 725 * @param handle 726 * @param descriptor_offset 727 * @param descriptor_length 728 * @param descriptor 729 */ 730 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xAA 731 732 /** 733 * @format H2 734 * @param handle 735 * @param MTU 736 */ 737 #define GATT_EVENT_MTU 0xAB 738 739 /** 740 * @format H 741 * @param handle 742 */ 743 #define GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE 0xAC 744 745 /** 746 * @format H2 747 * @param handle 748 * @param MTU 749 */ 750 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE 0xB5 751 752 /** 753 * @format 1H2 754 * @param status 755 * @param conn_handle 756 * @param attribute_handle 757 */ 758 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 0xB6 759 760 /** 761 * @format 762 */ 763 #define ATT_EVENT_CAN_SEND_NOW 0xB7 764 765 // TODO: daemon only event 766 767 /** 768 * @format 12 769 * @param status 770 * @param service_uuid 771 */ 772 #define BNEP_EVENT_SERVICE_REGISTERED 0xC0 773 774 /** 775 * @format 12222B 776 * @param status 777 * @param bnep_cid 778 * @param source_uuid 779 * @param destination_uuid 780 * @param mtu 781 * @param remote_address 782 */ 783 #define BNEP_EVENT_CHANNEL_OPENED 0xC1 784 785 /** 786 * @format 222B 787 * @param bnep_cid 788 * @param source_uuid 789 * @param destination_uuid 790 * @param remote_address 791 */ 792 #define BNEP_EVENT_CHANNEL_CLOSED 0xC2 793 794 /** 795 * @format 222B1 796 * @param bnep_cid 797 * @param source_uuid 798 * @param destination_uuid 799 * @param remote_address 800 * @param channel_state 801 */ 802 #define BNEP_EVENT_CHANNEL_TIMEOUT 0xC3 803 804 /** 805 * @format 222B 806 * @param bnep_cid 807 * @param source_uuid 808 * @param destination_uuid 809 * @param remote_address 810 */ 811 #define BNEP_EVENT_CAN_SEND_NOW 0xC4 812 813 /** 814 * @format H1B 815 * @param handle 816 * @param addr_type 817 * @param address 818 */ 819 #define SM_EVENT_JUST_WORKS_REQUEST 0xD0 820 821 /** 822 * @format H1B 823 * @param handle 824 * @param addr_type 825 * @param address 826 */ 827 #define SM_EVENT_JUST_WORKS_CANCEL 0xD1 828 829 /** 830 * @format H1B4 831 * @param handle 832 * @param addr_type 833 * @param address 834 * @param passkey 835 */ 836 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER 0xD2 837 838 /** 839 * @format H1B 840 * @param handle 841 * @param addr_type 842 * @param address 843 */ 844 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL 0xD3 845 846 /** 847 * @format H1B 848 * @param handle 849 * @param addr_type 850 * @param address 851 */ 852 #define SM_EVENT_PASSKEY_INPUT_NUMBER 0xD4 853 854 /** 855 * @format H1B 856 * @param handle 857 * @param addr_type 858 * @param address 859 */ 860 #define SM_EVENT_PASSKEY_INPUT_CANCEL 0xD5 861 862 /** 863 * @format H1B4 864 * @param handle 865 * @param addr_type 866 * @param address 867 * @param passkey 868 */ 869 #define SM_EVENT_NUMERIC_COMPARISON_REQUEST 0xD6 870 871 /** 872 * @format H1B 873 * @param handle 874 * @param addr_type 875 * @param address 876 */ 877 #define SM_EVENT_NUMERIC_COMPARISON_CANCEL 0xD7 878 879 /** 880 * @format H1B 881 * @param handle 882 * @param addr_type 883 * @param address 884 */ 885 #define SM_EVENT_IDENTITY_RESOLVING_STARTED 0xD8 886 887 /** 888 * @format H1B 889 * @param handle 890 * @param addr_type 891 * @param address 892 */ 893 #define SM_EVENT_IDENTITY_RESOLVING_FAILED 0xD9 894 895 /** 896 * @brief Identify resolving succeeded 897 * 898 * @format H1B1B2 899 * @param handle 900 * @param addr_type 901 * @param address 902 * @param identity_addr_type 903 * @param identity_address 904 * @param index 905 * 906 */ 907 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 0xDA 908 909 /** 910 * @format H1B 911 * @param handle 912 * @param addr_type 913 * @param address 914 */ 915 #define SM_EVENT_AUTHORIZATION_REQUEST 0xDB 916 917 /** 918 * @format H1B1 919 * @param handle 920 * @param addr_type 921 * @param address 922 * @param authorization_result 923 */ 924 #define SM_EVENT_AUTHORIZATION_RESULT 0xDC 925 926 /** 927 * @format H1 928 * @param handle 929 * @param action see SM_KEYPRESS_* 930 */ 931 #define SM_EVENT_KEYPRESS_NOTIFICATION 0xDD 932 933 /** 934 * @brief Emitted during pairing to inform app about address used as identity 935 * 936 * @format H1B1B2 937 * @param handle 938 * @param addr_type 939 * @param address 940 * @param identity_addr_type 941 * @param identity_address 942 * @param index 943 */ 944 #define SM_EVENT_IDENTITY_CREATED 0xDE 945 946 /** 947 * @brief Emitted to inform app that pairing is complete. Possible status values: 948 * ERROR_CODE_SUCCESS -> pairing success 949 * ERROR_CODE_CONNECTION_TIMEOUT -> timeout 950 * ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION -> disconnect 951 * ERROR_CODE_AUTHENTICATION_FAILURE -> SM protocol error, see reason field with SM_REASON_* from bluetooth.h 952 * 953 * @format H1B11 954 * @param handle 955 * @param addr_type 956 * @param address 957 * @param status 958 * @param reason if status == ERROR_CODE_AUTHENTICATION_FAILURE 959 */ 960 #define SM_EVENT_PAIRING_COMPLETE 0xDF 961 962 963 // GAP 964 965 /** 966 * @format H1 967 * @param handle 968 * @param security_level 969 */ 970 #define GAP_EVENT_SECURITY_LEVEL 0xE0 971 972 /** 973 * @format 1B 974 * @param status 975 * @param address 976 */ 977 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED 0xE1 978 979 /** 980 * @format 11B1JV 981 * @param advertising_event_type 982 * @param address_type 983 * @param address 984 * @param rssi 985 * @param data_length 986 * @param data 987 */ 988 #define GAP_EVENT_ADVERTISING_REPORT 0xE2 989 990 /** 991 * @format B132111JV 992 * @param bd_addr 993 * @param page_scan_repetition_mode 994 * @param class_of_device 995 * @param clock_offset 996 * @param rssi_available 997 * @param rssi 998 * @param name_available 999 * @param name_len 1000 * @param name 1001 */ 1002 #define GAP_EVENT_INQUIRY_RESULT 0xE3 1003 1004 /** 1005 * @format 1 1006 * @param status 1007 */ 1008 #define GAP_EVENT_INQUIRY_COMPLETE 0xE4 1009 1010 1011 // Meta Events, see below for sub events 1012 #define HCI_EVENT_HSP_META 0xE8 1013 #define HCI_EVENT_HFP_META 0xE9 1014 #define HCI_EVENT_ANCS_META 0xEA 1015 #define HCI_EVENT_AVDTP_META 0xEB 1016 #define HCI_EVENT_AVRCP_META 0xEC 1017 #define HCI_EVENT_GOEP_META 0xED 1018 #define HCI_EVENT_PBAP_META 0xEE 1019 #define HCI_EVENT_HID_META 0xEF 1020 #define HCI_EVENT_A2DP_META 0xF0 1021 #define HCI_EVENT_HIDS_META 0xF1 1022 1023 // Potential other meta groups 1024 // #define HCI_EVENT_BNEP_META 0xxx 1025 // #define HCI_EVENT_GAP_META 0xxx 1026 // #define HCI_EVENT_GATT_META 0xxx 1027 // #define HCI_EVENT_PAN_META 0xxx 1028 // #define HCI_EVENT_SDP_META 0xxx 1029 // #define HCI_EVENT_SM_META 0xxx 1030 1031 1032 /** HSP Subevent */ 1033 1034 /** 1035 * @format 11 1036 * @param subevent_code 1037 * @param status 0 == OK 1038 */ 1039 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 0x01 1040 1041 /** 1042 * @format 11 1043 * @param subevent_code 1044 * @param status 0 == OK 1045 */ 1046 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 0x02 1047 1048 1049 /** 1050 * @format 11H 1051 * @param subevent_code 1052 * @param status 0 == OK 1053 * @param handle 1054 */ 1055 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x03 1056 1057 /** 1058 * @format 11 1059 * @param subevent_code 1060 * @param status 0 == OK 1061 */ 1062 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x04 1063 1064 /** 1065 * @format 1 1066 * @param subevent_code 1067 */ 1068 #define HSP_SUBEVENT_RING 0x05 1069 1070 /** 1071 * @format 11 1072 * @param subevent_code 1073 * @param gain Valid range: [0,15] 1074 */ 1075 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x06 1076 1077 /** 1078 * @format 11 1079 * @param subevent_code 1080 * @param gain Valid range: [0,15] 1081 */ 1082 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x07 1083 1084 /** 1085 * @format 1JV 1086 * @param subevent_code 1087 * @param value_length 1088 * @param value 1089 */ 1090 #define HSP_SUBEVENT_HS_COMMAND 0x08 1091 1092 /** 1093 * @format 1JV 1094 * @param subevent_code 1095 * @param value_length 1096 * @param value 1097 */ 1098 #define HSP_SUBEVENT_AG_INDICATION 0x09 1099 1100 1101 /** HFP Subevent */ 1102 1103 /** 1104 * @format 11HB 1105 * @param subevent_code 1106 * @param status 0 == OK 1107 * @param con_handle 1108 * @param bd_addr 1109 */ 1110 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 0x01 1111 1112 /** 1113 * @format 1 1114 * @param subevent_code 1115 */ 1116 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 1117 1118 /** 1119 * @format 11HB1 1120 * @param subevent_code 1121 * @param status 0 == OK 1122 * @param handle 1123 * @param bd_addr 1124 * @param negotiated_codec 1125 */ 1126 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 1127 1128 /** 1129 * @format 1 1130 * @param subevent_code 1131 */ 1132 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED 0x04 1133 1134 /** 1135 * @format 11 1136 * @param subevent_code 1137 * @param status 0 == OK 1138 */ 1139 #define HFP_SUBEVENT_COMPLETE 0x05 1140 1141 /** 1142 * @format 111T 1143 * @param subevent_code 1144 * @param indicator_index 1145 * @param indicator_status 1146 * @param indicator_name 1147 */ 1148 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 0x06 1149 1150 /** 1151 * @format 111T 1152 * @param subevent_code 1153 * @param network_operator_mode 1154 * @param network_operator_format 1155 * @param network_operator_name 1156 */ 1157 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 0x07 1158 1159 /** 1160 * @format 11 1161 * @param subevent_code 1162 * @param error 1163 */ 1164 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 0x08 1165 1166 /** 1167 * @format 1 1168 * @param subevent_code 1169 */ 1170 #define HFP_SUBEVENT_START_RINGINIG 0x0A 1171 1172 /** 1173 * @format 1 1174 * @param subevent_code 1175 */ 1176 #define HFP_SUBEVENT_STOP_RINGINIG 0x0B 1177 1178 /** 1179 * @format 1 1180 * @param subevent_code 1181 */ 1182 #define HFP_SUBEVENT_CALL_TERMINATED 0x0C 1183 1184 /** 1185 * @format 1T 1186 * @param subevent_code 1187 * @param number 1188 */ 1189 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 0x0D 1190 1191 /** 1192 * @format 1 1193 * @param subevent_code 1194 */ 1195 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG 0x0E 1196 1197 /** 1198 * @format 1T 1199 * @param subevent_code 1200 * @param number 1201 */ 1202 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 0x0F 1203 1204 /** 1205 * @format 1T 1206 * @param subevent_code 1207 * @param dtmf code 1208 */ 1209 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES 0x10 1210 1211 /** 1212 * @format 1 1213 * @param subevent_code 1214 */ 1215 #define HFP_SUBEVENT_CALL_ANSWERED 0x11 1216 1217 /** 1218 * @format 1 1219 * @param subevent_code 1220 */ 1221 #define HFP_SUBEVENT_CONFERENCE_CALL 0x12 1222 1223 /** 1224 * @format 1 1225 * @param subevent_code 1226 */ 1227 #define HFP_SUBEVENT_RING 0x13 1228 1229 /** 1230 * @format 111 1231 * @param subevent_code 1232 * @param status 1233 * @param gain 1234 */ 1235 #define HFP_SUBEVENT_SPEAKER_VOLUME 0x14 1236 1237 /** 1238 * @format 111 1239 * @param subevent_code 1240 * @param status 1241 * @param gain 1242 */ 1243 #define HFP_SUBEVENT_MICROPHONE_VOLUME 0x15 1244 1245 /** 1246 * @format 11T 1247 * @param subevent_code 1248 * @param type 1249 * @param number 1250 */ 1251 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 0x16 1252 1253 /** 1254 * @format 11T 1255 * @param subevent_code 1256 * @param type 1257 * @param number 1258 */ 1259 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17 1260 1261 /** 1262 * @format 111111T 1263 * @param subevent_code 1264 * @param clcc_idx 1265 * @param clcc_dir 1266 * @param clcc_status 1267 * @param clcc_mpty 1268 * @param bnip_type 1269 * @param bnip_number 1270 */ 1271 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS 0x18 1272 1273 /** 1274 * @format 111T 1275 * @param subevent_code 1276 * @param status 1277 * @param bnip_type 1278 * @param bnip_number 1279 */ 1280 #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 0x19 1281 1282 /** 1283 * @format 1T 1284 * @param subevent_code 1285 * @param value 1286 */ 1287 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 0x1A 1288 1289 // ANCS Client 1290 1291 /** 1292 * @format 1H 1293 * @param subevent_code 1294 * @param handle 1295 */ 1296 #define ANCS_SUBEVENT_CLIENT_CONNECTED 0xF0 1297 1298 /** 1299 * @format 1H2T 1300 * @param subevent_code 1301 * @param handle 1302 * @param attribute_id 1303 * @param text 1304 */ 1305 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION 0xF1 1306 1307 /** 1308 * @format 1H 1309 * @param subevent_code 1310 * @param handle 1311 */ 1312 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED 0xF2 1313 1314 1315 /** AVDTP Subevent */ 1316 1317 /** 1318 * @format 1211 1319 * @param subevent_code 1320 * @param avdtp_cid 1321 * @param local_seid 1322 * @param signal_identifier 1323 */ 1324 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT 0x01 1325 1326 /** 1327 * @format 1211 1328 * @param subevent_code 1329 * @param avdtp_cid 1330 * @param local_seid 1331 * @param signal_identifier 1332 */ 1333 #define AVDTP_SUBEVENT_SIGNALING_REJECT 0x02 1334 1335 /** 1336 * @format 1211 1337 * @param subevent_code 1338 * @param avdtp_cid 1339 * @param local_seid 1340 * @param signal_identifier 1341 */ 1342 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 0x03 1343 1344 /** 1345 * @format 12B1 1346 * @param subevent_code 1347 * @param avdtp_cid 1348 * @param bd_addr 1349 * @param status 0 == OK 1350 */ 1351 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 0x04 1352 1353 /** 1354 * @format 12 1355 * @param subevent_code 1356 * @param avdtp_cid 1357 */ 1358 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 0x05 1359 1360 /** 1361 * @format 121111 1362 * @param subevent_code 1363 * @param avdtp_cid 1364 * @param remote_seid 0x01 – 0x3E 1365 * @param in_use 0-not in use, 1-in use 1366 * @param media_type 0-audio, 1-video, 2-multimedia 1367 * @param sep_type 0-source, 1-sink 1368 */ 1369 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 0x06 1370 1371 /** 1372 * @format 121111111111 1373 * @param subevent_code 1374 * @param avdtp_cid 1375 * @param local_seid 1376 * @param remote_seid 1377 * @param media_type 1378 * @param sampling_frequency_bitmap 1379 * @param channel_mode_bitmap 1380 * @param block_length_bitmap 1381 * @param subbands_bitmap 1382 * @param allocation_method_bitmap 1383 * @param min_bitpool_value 1384 * @param max_bitpool_value 1385 */ 1386 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 0x07 1387 1388 /** 1389 * @format 121112LV 1390 * @param subevent_code 1391 * @param avdtp_cid 1392 * @param local_seid 1393 * @param remote_seid 1394 * @param media_type 1395 * @param media_codec_type 1396 * @param media_codec_information_len 1397 * @param media_codec_information 1398 */ 1399 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 0x08 1400 1401 1402 /** 1403 * @format 1211 1404 * @param subevent_code 1405 * @param avdtp_cid 1406 * @param local_seid 1407 * @param remote_seid 1408 */ 1409 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_TRANSPORT_CAPABILITY 0x09 1410 1411 1412 /** 1413 * @format 1211 1414 * @param subevent_code 1415 * @param avdtp_cid 1416 * @param local_seid 1417 * @param remote_seid 1418 */ 1419 #define AVDTP_SUBEVENT_SIGNALING_REPORTING_CAPABILITY 0x0A 1420 1421 1422 /** 1423 * @format 1211111 1424 * @param subevent_code 1425 * @param avdtp_cid 1426 * @param local_seid 1427 * @param remote_seid 1428 * @param recovery_type 1429 * @param maximum_recovery_window_size 1430 * @param maximum_number_media_packets 1431 */ 1432 #define AVDTP_SUBEVENT_SIGNALING_RECOVERY_CAPABILITY 0x0B 1433 1434 1435 /** 1436 * @format 12112LV 1437 * @param subevent_code 1438 * @param avdtp_cid 1439 * @param local_seid 1440 * @param remote_seid 1441 * @param cp_type 1442 * @param cp_type_value_len 1443 * @param cp_type_value 1444 */ 1445 #define AVDTP_SUBEVENT_SIGNALING_CONTENT_PROTECTION_CAPABILITY 0x0C 1446 1447 1448 /** 1449 * @format 121111111111 1450 * @param subevent_code 1451 * @param avdtp_cid 1452 * @param local_seid 1453 * @param remote_seid 1454 * @param fragmentation 1455 * @param transport_identifiers_num 1456 * @param transport_session_identifier_1 1457 * @param transport_session_identifier_2 1458 * @param transport_session_identifier_3 1459 * @param tcid_1 1460 * @param tcid_2 1461 * @param tcid_3 1462 */ 1463 #define AVDTP_SUBEVENT_SIGNALING_MULTIPLEXING_CAPABILITY 0x0D 1464 1465 1466 /** 1467 * @format 1211 1468 * @param subevent_code 1469 * @param avdtp_cid 1470 * @param local_seid 1471 * @param remote_seid 1472 */ 1473 #define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORTING_CAPABILITY 0x0E 1474 1475 1476 /** 1477 * @format 1211111 1478 * @param subevent_code 1479 * @param avdtp_cid 1480 * @param local_seid 1481 * @param remote_seid 1482 * @param back_ch 1483 * @param media 1484 * @param recovery 1485 */ 1486 #define AVDTP_SUBEVENT_SIGNALING_HEADER_COMPRESSION_CAPABILITY 0x0F 1487 1488 1489 /** 1490 * @format 12111121111111 1491 * @param subevent_code 1492 * @param avdtp_cid 1493 * @param local_seid 1494 * @param remote_seid 1495 * @param reconfigure 1496 * @param media_type 1497 * @param sampling_frequency 1498 * @param channel_mode 1499 * @param num_channels 1500 * @param block_length 1501 * @param subbands 1502 * @param allocation_method 1503 * @param min_bitpool_value 1504 * @param max_bitpool_value 1505 */ 1506 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x10 1507 1508 /** 1509 * @format 1211112LV 1510 * @param subevent_code 1511 * @param avdtp_cid 1512 * @param local_seid 1513 * @param remote_seid 1514 * @param reconfigure 1515 * @param media_type 1516 * @param media_codec_type 1517 * @param media_codec_information_len 1518 * @param media_codec_information 1519 */ 1520 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x11 1521 1522 /** 1523 * @format 12B111 1524 * @param subevent_code 1525 * @param avdtp_cid 1526 * @param bd_addr 1527 * @param local_seid 1528 * @param remote_seid 1529 * @param status 0 == OK 1530 */ 1531 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 0x12 1532 1533 /** 1534 * @format 121 1535 * @param subevent_code 1536 * @param avdtp_cid 1537 * @param local_seid 1538 */ 1539 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED 0x13 1540 1541 /** 1542 * @format 1212 1543 * @param subevent_code 1544 * @param avdtp_cid 1545 * @param local_seid 1546 * @param sequence_number 1547 */ 1548 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x14 1549 1550 /** 1551 * @format 1211 1552 * @param subevent_code 1553 * @param avdtp_cid 1554 * @param local_seid 1555 * @param remote_seid 1556 */ 1557 #define AVDTP_SUBEVENT_SIGNALING_CAPABILITY_DONE 0x15 1558 1559 1560 /** 1561 * @format 12 1562 * @param subevent_code 1563 * @param avdtp_cid 1564 */ 1565 #define AVDTP_SUBEVENT_SIGNALING_SEP_DICOVERY_DONE 0x16 1566 1567 1568 /** A2DP Subevent */ 1569 /* Stream goes through following states: 1570 * - OPEN - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event 1571 * - START - indicated with A2DP_SUBEVENT_STREAM_STARTED event 1572 * - SUSPEND - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event 1573 * - ABORT/STOP - indicated with A2DP_SUBEVENT_STREAM_RELEASED event 1574 1575 OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started. 1576 START can come only after the stream is OPENED, and indicates that media transfer is started. 1577 SUSPEND is optional, it pauses the stream. 1578 */ 1579 1580 /** 1581 * @format 121 Sent only by A2DP source. 1582 * @param subevent_code 1583 * @param a2dp_cid 1584 * @param local_seid 1585 */ 1586 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x01 1587 1588 /** 1589 * @format 12111121111111 1590 * @param subevent_code 1591 * @param a2dp_cid 1592 * @param int_seid 1593 * @param acp_seid 1594 * @param reconfigure 1595 * @param media_type 1596 * @param sampling_frequency 1597 * @param channel_mode 1598 * @param num_channels 1599 * @param block_length 1600 * @param subbands 1601 * @param allocation_method 1602 * @param min_bitpool_value 1603 * @param max_bitpool_value 1604 */ 1605 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x02 1606 1607 /** 1608 * @format 1211112LV 1609 * @param subevent_code 1610 * @param a2dp_cid 1611 * @param int_seid 1612 * @param acp_seid 1613 * @param reconfigure 1614 * @param media_type 1615 * @param media_codec_type 1616 * @param media_codec_information_len 1617 * @param media_codec_information 1618 */ 1619 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x03 1620 1621 /** 1622 * @format 12B111 Stream is opened byt not started. 1623 * @param subevent_code 1624 * @param a2dp_cid 1625 * @param bd_addr 1626 * @param local_seid 1627 * @param remote_seid 1628 * @param status 1629 */ 1630 #define A2DP_SUBEVENT_STREAM_ESTABLISHED 0x04 1631 1632 /** 1633 * @format 121 Indicates that media transfer is started. 1634 * @param subevent_code 1635 * @param a2dp_cid 1636 * @param local_seid 1637 */ 1638 #define A2DP_SUBEVENT_STREAM_STARTED 0x05 1639 1640 /** 1641 * @format 121 Stream is paused. 1642 * @param subevent_code 1643 * @param a2dp_cid 1644 * @param local_seid 1645 */ 1646 #define A2DP_SUBEVENT_STREAM_SUSPENDED 0x06 1647 1648 /** 1649 * @format 121 Stream is stoped or aborted. 1650 * @param subevent_code 1651 * @param a2dp_cid 1652 * @param local_seid 1653 */ 1654 #define A2DP_SUBEVENT_STREAM_STOPPED 0x07 1655 1656 /** 1657 * @format 121 Stream is released. 1658 * @param subevent_code 1659 * @param a2dp_cid 1660 * @param local_seid 1661 */ 1662 #define A2DP_SUBEVENT_STREAM_RELEASED 0x08 1663 1664 /** 1665 * @format 1211 1666 * @param subevent_code 1667 * @param a2dp_cid 1668 * @param local_seid 1669 * @param signal_identifier 1670 */ 1671 #define A2DP_SUBEVENT_COMMAND_ACCEPTED 0x09 1672 1673 /** 1674 * @format 1211 1675 * @param subevent_code 1676 * @param a2dp_cid 1677 * @param local_seid 1678 * @param signal_identifier 1679 */ 1680 #define A2DP_SUBEVENT_COMMAND_REJECTED 0x0A 1681 1682 /** 1683 * @format 12B1 1684 * @param subevent_code 1685 * @param a2dp_cid 1686 * @param bd_addr 1687 * @param status 0 == OK 1688 */ 1689 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 0x0B 1690 1691 /** 1692 * @format 12 Signaling channel is released. 1693 * @param subevent_code 1694 * @param a2dp_cid 1695 */ 1696 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 0x0C 1697 1698 /** 1699 * @format 1211 Stream was reconfigured 1700 * @param subevent_code 1701 * @param a2dp_cid 1702 * @param local_seid 1703 * @param status 1704 */ 1705 #define A2DP_SUBEVENT_STREAM_RECONFIGURED 0x0D 1706 1707 /** AVRCP Subevent */ 1708 1709 /** 1710 * @format 11B2 1711 * @param subevent_code 1712 * @param status 0 == OK 1713 * @param bd_addr 1714 * @param avrcp_cid 1715 */ 1716 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 0x01 1717 1718 /** 1719 * @format 12 1720 * @param subevent_code 1721 * @param avrcp_cid 1722 */ 1723 #define AVRCP_SUBEVENT_CONNECTION_RELEASED 0x02 1724 1725 /** 1726 * @format 12111 1727 * @param subevent_code 1728 * @param avrcp_cid 1729 * @param command_type 1730 * @param repeat_mode 1731 * @param shuffle_mode 1732 */ 1733 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 0x03 1734 1735 /** 1736 * @format 121441 1737 * @param subevent_code 1738 * @param avrcp_cid 1739 * @param command_type 1740 * @param song_length 1741 * @param song_position 1742 * @param play_status 1743 */ 1744 #define AVRCP_SUBEVENT_PLAY_STATUS 0x04 1745 1746 /** 1747 * @format 1211 1748 * @param subevent_code 1749 * @param avrcp_cid 1750 * @param command_type 1751 * @param play_status 1752 */ 1753 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 0x05 1754 1755 /** 1756 * @format 121 1757 * @param subevent_code 1758 * @param avrcp_cid 1759 * @param command_type 1760 */ 1761 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 0x06 1762 1763 /** 1764 * @format 121 1765 * @param subevent_code 1766 * @param avrcp_cid 1767 * @param command_type 1768 */ 1769 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 0x07 1770 1771 /** 1772 * @format 121 1773 * @param subevent_code 1774 * @param avrcp_cid 1775 * @param command_type 1776 */ 1777 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 0x08 1778 1779 /** 1780 * @format 1211 1781 * @param subevent_code 1782 * @param avrcp_cid 1783 * @param command_type 1784 * @param absolute_volume 1785 */ 1786 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 0x09 1787 1788 /** 1789 * @format 1211 1790 * @param subevent_code 1791 * @param avrcp_cid 1792 * @param command_type 1793 * @param absolute_volume 1794 */ 1795 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 0x0A 1796 1797 /** 1798 * @format 1211 1799 * @param subevent_code 1800 * @param avrcp_cid 1801 * @param command_type 1802 * @param notification_id 1803 */ 1804 #define AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 0x0B 1805 1806 /** 1807 * @format 1211 1808 * @param subevent_code 1809 * @param avrcp_cid 1810 * @param command_type 1811 * @param operation_id 1812 */ 1813 #define AVRCP_SUBEVENT_OPERATION_START 0x0C 1814 1815 /** 1816 * @format 1211 1817 * @param subevent_code 1818 * @param avrcp_cid 1819 * @param command_type 1820 * @param operation_id 1821 */ 1822 #define AVRCP_SUBEVENT_OPERATION_COMPLETE 0x0D 1823 1824 /** 1825 * @format 121 1826 * @param subevent_code 1827 * @param avrcp_cid 1828 * @param command_type 1829 */ 1830 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 0x0E 1831 1832 /** 1833 * @format 12 1834 * @param subevent_code 1835 * @param avrcp_cid 1836 */ 1837 #define AVRCP_SUBEVENT_COMPANY_IDS_QUERY 0x0F 1838 1839 /** 1840 * @format 12 1841 * @param subevent_code 1842 * @param avrcp_cid 1843 */ 1844 #define AVRCP_SUBEVENT_EVENT_IDS_QUERY 0x10 1845 1846 /** 1847 * @format 12 1848 * @param subevent_code 1849 * @param avrcp_cid 1850 */ 1851 #define AVRCP_SUBEVENT_PLAY_STATUS_QUERY 0x11 1852 1853 /** 1854 * @format 12111 1855 * @param subevent_code 1856 * @param avrcp_cid 1857 * @param operation_id 1858 * @param operands_length 1859 * @param operand 1860 */ 1861 #define AVRCP_SUBEVENT_OPERATION 0x12 1862 1863 /** 1864 * @format 1211 1865 * @param subevent_code 1866 * @param avrcp_cid 1867 * @param command_type 1868 * @param track 1869 */ 1870 #define AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO 0x13 1871 1872 /** 1873 * @format 1211 1874 * @param subevent_code 1875 * @param avrcp_cid 1876 * @param command_type 1877 * @param total_tracks 1878 */ 1879 #define AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO 0x14 1880 1881 /** 1882 * @format 1214 1883 * @param subevent_code 1884 * @param avrcp_cid 1885 * @param command_type 1886 * @param song_length in ms 1887 */ 1888 #define AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO 0x15 1889 1890 /** 1891 * @format 121JV 1892 * @param subevent_code 1893 * @param avrcp_cid 1894 * @param command_type 1895 * @param value_len 1896 * @param value 1897 */ 1898 #define AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO 0x16 1899 1900 /* 1901 * @format 121JV 1902 * @param subevent_code 1903 * @param avrcp_cid 1904 * @param command_type 1905 * @param value_len 1906 * @param value 1907 */ 1908 #define AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO 0x17 1909 1910 /* 1911 * @format 121JV 1912 * @param subevent_code 1913 * @param avrcp_cid 1914 * @param command_type 1915 * @param value_len 1916 * @param value 1917 */ 1918 #define AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO 0x18 1919 1920 /* 1921 * @format 121JV 1922 * @param subevent_code 1923 * @param avrcp_cid 1924 * @param command_type 1925 * @param value_len 1926 * @param value 1927 */ 1928 #define AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO 0x19 1929 1930 /* 1931 * @format 1211 1932 * @param subevent_code 1933 * @param avrcp_cid 1934 * @param command_type 1935 * @param status 1936 */ 1937 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE 0x1A 1938 1939 /** 1940 * @format 1B2 1941 * @param subevent_code 1942 * @param bd_addr 1943 * @param browsing_cid 1944 */ 1945 #define AVRCP_SUBEVENT_INCOMING_BROWSING_CONNECTION 0x1B 1946 1947 /** 1948 * @format 11B2 1949 * @param subevent_code 1950 * @param status 0 == OK 1951 * @param bd_addr 1952 * @param browsing_cid 1953 */ 1954 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_ESTABLISHED 0x1C 1955 1956 /** 1957 * @format 12 1958 * @param subevent_code 1959 * @param browsing_cid 1960 */ 1961 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_RELEASED 0x1D 1962 1963 /** 1964 * @format 12211 1965 * @param subevent_code 1966 * @param browsing_cid 1967 * @param uid_counter 1968 * @param browsing_status 1969 * @param bluetooth_status 1970 */ 1971 #define AVRCP_SUBEVENT_BROWSING_DONE 0x1E 1972 1973 /** 1974 * @format 1214 1975 * @param subevent_code 1976 * @param browsing_cid 1977 * @param scope 1978 * @param attr_bitmap 1979 */ 1980 #define AVRCP_SUBEVENT_BROWSING_GET_FOLDER_ITEMS 0x1F 1981 1982 /** 1983 * @format 121 1984 * @param subevent_code 1985 * @param browsing_cid 1986 * @param scope 1987 */ 1988 #define AVRCP_SUBEVENT_BROWSING_GET_TOTAL_NUM_ITEMS 0x20 1989 1990 /** 1991 * @format 1214 1992 * @param subevent_code 1993 * @param avrcp_cid 1994 * @param command_type 1995 * @param playback_position_ms 1996 */ 1997 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_POS_CHANGED 0x21 1998 1999 2000 /** 2001 * @format 121BH1 2002 * @param subevent_code 2003 * @param goep_cid 2004 * @param status 2005 * @param bd_addr 2006 * @param con_handle 2007 * @param incoming 2008 */ 2009 #define GOEP_SUBEVENT_CONNECTION_OPENED 0x01 2010 2011 /** 2012 * @format 12 2013 * @param subevent_code 2014 * @param goep_cid 2015 */ 2016 #define GOEP_SUBEVENT_CONNECTION_CLOSED 0x02 2017 2018 /** 2019 * @format 12 2020 * @param subevent_code 2021 * @param goep_cid 2022 */ 2023 #define GOEP_SUBEVENT_CAN_SEND_NOW 0x03 2024 2025 /** 2026 * @format 121BH1 2027 * @param subevent_code 2028 * @param pbap_cid 2029 * @param status 2030 * @param bd_addr 2031 * @param con_handle 2032 * @param incoming 2033 */ 2034 #define PBAP_SUBEVENT_CONNECTION_OPENED 0x01 2035 2036 /** 2037 * @format 12 2038 * @param subevent_code 2039 * @param goep_cid 2040 */ 2041 #define PBAP_SUBEVENT_CONNECTION_CLOSED 0x02 2042 2043 /** 2044 * @format 121 2045 * @param subevent_code 2046 * @param goep_cid 2047 * @param status 2048 */ 2049 #define PBAP_SUBEVENT_OPERATION_COMPLETED 0x03 2050 2051 /** 2052 * @format 1212 2053 * @param subevent_code 2054 * @param goep_cid 2055 * @param status 2056 * @param phoneboook_size 2057 */ 2058 #define PBAP_SUBEVENT_PHONEBOOK_SIZE 0x04 2059 2060 /** 2061 * @format 1211 2062 * @param subevent_code 2063 * @param goep_cid 2064 * @param user_id_required 2065 * @param full_access 2066 */ 2067 #define PBAP_SUBEVENT_AUTHENTICATION_REQUEST 0x05 2068 2069 /** 2070 * @format 12JVJV 2071 * @param subevent_code 2072 * @param goep_cid 2073 * @param name_len 2074 * @param name 2075 * @param handle_len 2076 * @param handle 2077 */ 2078 #define PBAP_SUBEVENT_CARD_RESULT 0x06 2079 2080 2081 // HID Meta Event Group 2082 2083 /** 2084 * @format 121BH1 2085 * @param subevent_code 2086 * @param hid_cid 2087 * @param status 2088 * @param bd_addr 2089 * @param con_handle 2090 * @param incoming 2091 */ 2092 #define HID_SUBEVENT_CONNECTION_OPENED 0x01 2093 2094 /** 2095 * @format 12 2096 * @param subevent_code 2097 * @param hid_cid 2098 */ 2099 #define HID_SUBEVENT_CONNECTION_CLOSED 0x02 2100 2101 /** 2102 * @format 12 2103 * @param subevent_code 2104 * @param hid_cid 2105 */ 2106 #define HID_SUBEVENT_CAN_SEND_NOW 0x03 2107 2108 /** 2109 * @format 12 2110 * @param subevent_code 2111 * @param con_handle 2112 */ 2113 #define HID_SUBEVENT_SUSPEND 0x04 2114 2115 /** 2116 * @format 12 2117 * @param subevent_code 2118 * @param con_handle 2119 */ 2120 #define HID_SUBEVENT_EXIT_SUSPEND 0x05 2121 2122 2123 // HIDS Meta Event Group 2124 2125 /** 2126 * @format 12 2127 * @param subevent_code 2128 * @param con_handle 2129 */ 2130 #define HIDS_SUBEVENT_CAN_SEND_NOW 0x01 2131 2132 /** 2133 * @format 121 2134 * @param subevent_code 2135 * @param con_handle 2136 * @param protocol_mode 2137 */ 2138 #define HIDS_SUBEVENT_PROTOCOL_MODE 0x02 2139 2140 /** 2141 * @format 121 2142 * @param subevent_code 2143 * @param con_handle 2144 * @param enable 2145 */ 2146 #define HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE 0x03 2147 2148 /** 2149 * @format 121 2150 * @param subevent_code 2151 * @param con_handle 2152 * @param enable 2153 */ 2154 #define HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE 0x04 2155 2156 /** 2157 * @format 121 2158 * @param subevent_code 2159 * @param con_handle 2160 * @param enable 2161 */ 2162 #define HIDS_SUBEVENT_INPUT_REPORT_ENABLE 0x05 2163 2164 /** 2165 * @format 121 2166 * @param subevent_code 2167 * @param con_handle 2168 * @param enable 2169 */ 2170 #define HIDS_SUBEVENT_OUTPUT_REPORT_ENABLE 0x06 2171 2172 /** 2173 * @format 121 2174 * @param subevent_code 2175 * @param con_handle 2176 * @param enable 2177 */ 2178 #define HIDS_SUBEVENT_FEATURE_REPORT_ENABLE 0x07 2179 2180 /** 2181 * @format 12 2182 * @param subevent_code 2183 * @param con_handle 2184 */ 2185 #define HIDS_SUBEVENT_SUSPEND 0x08 2186 2187 /** 2188 * @format 12 2189 * @param subevent_code 2190 * @param con_handle 2191 */ 2192 #define HIDS_SUBEVENT_EXIT_SUSPEND 0x09 2193 #endif 2194