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