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 // debug log messages 115 #define LOG_MESSAGE_PACKET 0xfc 116 117 118 // ERRORS 119 // last error code in 2.1 is 0x38 - we start with 0x50 for BTstack errors 120 121 /* ENUM_START: BTSTACK_ERROR_CODE */ 122 #define BTSTACK_CONNECTION_TO_BTDAEMON_FAILED 0x50 123 #define BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH 0x51 124 #define BTSTACK_ACTIVATION_POWERON_FAILED 0x52 125 #define BTSTACK_ACTIVATION_FAILED_UNKNOWN 0x53 126 #define BTSTACK_NOT_ACTIVATED 0x54 127 #define BTSTACK_BUSY 0x55 128 #define BTSTACK_MEMORY_ALLOC_FAILED 0x56 129 #define BTSTACK_ACL_BUFFERS_FULL 0x57 130 131 // l2cap errors - enumeration by the command that created them 132 #define L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60 133 #define L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61 134 #define L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62 135 136 #define L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL 0x63 137 #define L2CAP_CONNECTION_RESPONSE_RESULT_PENDING 0x64 138 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM 0x65 139 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY 0x66 140 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x67 141 #define L2CAP_CONNECTION_RESPONSE_RESULT_ERTM_NOT_SUPPORTD 0x68 142 #define L2CAP_CONNECTION_RESPONSE_RESULT_RTX_TIMEOUT 0x69 143 #define L2CAP_SERVICE_ALREADY_REGISTERED 0x6A 144 #define L2CAP_DATA_LEN_EXCEEDS_REMOTE_MTU 0x6B 145 #define L2CAP_SERVICE_DOES_NOT_EXIST 0x6C 146 #define L2CAP_LOCAL_CID_DOES_NOT_EXIST 0x6D 147 148 #define RFCOMM_MULTIPLEXER_STOPPED 0x70 149 #define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 150 #define RFCOMM_NO_OUTGOING_CREDITS 0x72 151 #define RFCOMM_AGGREGATE_FLOW_OFF 0x73 152 #define RFCOMM_DATA_LEN_EXCEEDS_MTU 0x74 153 154 #define SDP_HANDLE_ALREADY_REGISTERED 0x80 155 #define SDP_QUERY_INCOMPLETE 0x81 156 #define SDP_SERVICE_NOT_FOUND 0x82 157 #define SDP_HANDLE_INVALID 0x83 158 #define SDP_QUERY_BUSY 0x84 159 160 #define ATT_HANDLE_VALUE_INDICATION_IN_PROGRESS 0x90 161 #define ATT_HANDLE_VALUE_INDICATION_TIMEOUT 0x91 162 163 #define GATT_CLIENT_NOT_CONNECTED 0x93 164 #define GATT_CLIENT_BUSY 0x94 165 #define GATT_CLIENT_IN_WRONG_STATE 0x95 166 #define GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS 0x96 167 #define GATT_CLIENT_VALUE_TOO_LONG 0x97 168 #define GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED 0x98 169 #define GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED 0x99 170 171 #define BNEP_SERVICE_ALREADY_REGISTERED 0xA0 172 #define BNEP_CHANNEL_NOT_CONNECTED 0xA1 173 #define BNEP_DATA_LEN_EXCEEDS_MTU 0xA2 174 175 // OBEX ERRORS 176 #define OBEX_UNKNOWN_ERROR 0xB0 177 #define OBEX_CONNECT_FAILED 0xB1 178 #define OBEX_DISCONNECTED 0xB2 179 #define OBEX_NOT_FOUND 0xB3 180 181 #define AVDTP_SEID_DOES_NOT_EXIST 0xC0 182 #define AVDTP_CONNECTION_DOES_NOT_EXIST 0xC1 183 #define AVDTP_CONNECTION_IN_WRONG_STATE 0xC2 184 #define AVDTP_STREAM_ENDPOINT_IN_WRONG_STATE 0xC3 185 #define AVDTP_MEDIA_CONNECTION_DOES_NOT_EXIST 0xC4 186 187 /* ENUM_END */ 188 189 // DAEMON COMMANDS 190 191 #define OGF_BTSTACK 0x3d 192 193 // cmds for BTstack 194 // get state: @returns HCI_STATE 195 #define BTSTACK_GET_STATE 0x01 196 197 // set power mode: param HCI_POWER_MODE 198 #define BTSTACK_SET_POWER_MODE 0x02 199 200 // set capture mode: param on 201 #define BTSTACK_SET_ACL_CAPTURE_MODE 0x03 202 203 // get BTstack version 204 #define BTSTACK_GET_VERSION 0x04 205 206 // get system Bluetooth state 207 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED 0x05 208 209 // set system Bluetooth state 210 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED 0x06 211 212 // enable inquiry scan for this client 213 #define BTSTACK_SET_DISCOVERABLE 0x07 214 215 // set global Bluetooth state 216 #define BTSTACK_SET_BLUETOOTH_ENABLED 0x08 217 218 // create l2cap channel: param bd_addr(48), psm (16) 219 #define L2CAP_CREATE_CHANNEL 0x20 220 221 // disconnect l2cap disconnect, param channel(16), reason(8) 222 #define L2CAP_DISCONNECT 0x21 223 224 // register l2cap service: param psm(16), mtu (16) 225 #define L2CAP_REGISTER_SERVICE 0x22 226 227 // unregister l2cap disconnect, param psm(16) 228 #define L2CAP_UNREGISTER_SERVICE 0x23 229 230 // accept connection param bd_addr(48), dest cid (16) 231 #define L2CAP_ACCEPT_CONNECTION 0x24 232 233 // decline l2cap disconnect,param bd_addr(48), dest cid (16), reason(8) 234 #define L2CAP_DECLINE_CONNECTION 0x25 235 236 // create l2cap channel: param bd_addr(48), psm (16), mtu (16) 237 #define L2CAP_CREATE_CHANNEL_MTU 0x26 238 239 // register SDP Service Record: service record (size) 240 #define SDP_REGISTER_SERVICE_RECORD 0x30 241 242 // unregister SDP Service Record 243 #define SDP_UNREGISTER_SERVICE_RECORD 0x31 244 245 // Get remote RFCOMM services 246 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES 0x32 247 248 // Get remote SDP services 249 #define SDP_CLIENT_QUERY_SERVICES 0x33 250 251 // RFCOMM "HCI" Commands 252 #define RFCOMM_CREATE_CHANNEL 0x40 253 #define RFCOMM_DISCONNECT 0x41 254 #define RFCOMM_REGISTER_SERVICE 0x42 255 #define RFCOMM_UNREGISTER_SERVICE 0x43 256 #define RFCOMM_ACCEPT_CONNECTION 0x44 257 #define RFCOMM_DECLINE_CONNECTION 0x45 258 #define RFCOMM_PERSISTENT_CHANNEL 0x46 259 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS 0x47 260 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS 0x48 261 #define RFCOMM_GRANT_CREDITS 0x49 262 263 // GAP Classic 0x50 264 #define GAP_DISCONNECT 0x50 265 266 // GAP LE 0x60 267 #define GAP_LE_SCAN_START 0x60 268 #define GAP_LE_SCAN_STOP 0x61 269 #define GAP_LE_CONNECT 0x62 270 #define GAP_LE_CONNECT_CANCEL 0x63 271 #define GAP_LE_SET_SCAN_PARAMETERS 0x64 272 273 // GATT (Client) 0x70 274 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70 275 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16 0x71 276 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128 0x72 277 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE 0x73 278 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE 0x74 279 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128 0x75 280 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS 0x76 281 #define GATT_READ_VALUE_OF_CHARACTERISTIC 0x77 282 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC 0x78 283 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE 0x79 284 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC 0x7A 285 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7B 286 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7C 287 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR 0X7D 288 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR 0X7E 289 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR 0X7F 290 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR 0X80 291 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION 0X81 292 #define GATT_GET_MTU 0x82 293 294 295 // EVENTS 296 297 /** 298 * @format 1 299 * @param state 300 */ 301 #define BTSTACK_EVENT_STATE 0x60 302 303 /** 304 * @format 1 305 * @param number_connections 306 */ 307 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 308 309 /** 310 * @format 311 */ 312 #define BTSTACK_EVENT_POWERON_FAILED 0x62 313 314 /** 315 * @format 1 316 * @param discoverable 317 */ 318 #define BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 319 320 // Daemon Events 321 322 /** 323 * @format 112 324 * @param major 325 * @param minor 326 @ @param revision 327 */ 328 #define DAEMON_EVENT_VERSION 0x63 329 330 // data: system bluetooth on/off (bool) 331 /** 332 * @format 1 333 * param system_bluetooth_enabled 334 */ 335 #define DAEMON_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 336 337 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes) 338 339 /* 340 * @format 1BT 341 * @param status == 0 to match read_remote_name_request 342 * @param address 343 * @param name 344 */ 345 #define DAEMON_EVENT_REMOTE_NAME_CACHED 0x65 346 347 // internal - data: event(8) 348 #define DAEMON_EVENT_CONNECTION_OPENED 0x67 349 350 // internal - data: event(8) 351 #define DAEMON_EVENT_CONNECTION_CLOSED 0x68 352 353 // data: event(8), len(8), local_cid(16), credits(8) 354 #define DAEMON_EVENT_L2CAP_CREDITS 0x74 355 356 /** 357 * @format 12 358 * @param status 359 * @param psm 360 */ 361 #define DAEMON_EVENT_L2CAP_SERVICE_REGISTERED 0x75 362 363 /** 364 * @format 21 365 * @param rfcomm_cid 366 * @param credits 367 */ 368 #define DAEMON_EVENT_RFCOMM_CREDITS 0x84 369 370 /** 371 * @format 11 372 * @param status 373 * @param channel_id 374 */ 375 #define DAEMON_EVENT_RFCOMM_SERVICE_REGISTERED 0x85 376 377 /** 378 * @format 11 379 * @param status 380 * @param server_channel_id 381 */ 382 #define DAEMON_EVENT_RFCOMM_PERSISTENT_CHANNEL 0x86 383 384 /** 385 * @format 14 386 * @param status 387 * @param service_record_handle 388 */ 389 #define DAEMON_EVENT_SDP_SERVICE_REGISTERED 0x90 390 391 392 393 // additional HCI events 394 395 /** 396 * @brief Indicates HCI transport enters/exits Sleep mode 397 * @format 1 398 * @param active 399 */ 400 #define HCI_EVENT_TRANSPORT_SLEEP_MODE 0x69 401 402 /** 403 * @brief Outgoing packet 404 */ 405 #define HCI_EVENT_TRANSPORT_PACKET_SENT 0x6E 406 407 /** 408 * @format B 409 * @param handle 410 */ 411 #define HCI_EVENT_SCO_CAN_SEND_NOW 0x6F 412 413 414 // L2CAP EVENTS 415 416 /** 417 * @format 1BH2222221 418 * @param status 419 * @param address 420 * @param handle 421 * @param psm 422 * @param local_cid 423 * @param remote_cid 424 * @param local_mtu 425 * @param remote_mtu 426 * @param flush_timeout 427 * @param incoming 428 */ 429 #define L2CAP_EVENT_CHANNEL_OPENED 0x70 430 431 /* 432 * @format 2 433 * @param local_cid 434 */ 435 #define L2CAP_EVENT_CHANNEL_CLOSED 0x71 436 437 /** 438 * @format BH222 439 * @param address 440 * @param handle 441 * @param psm 442 * @param local_cid 443 * @param remote_cid 444 */ 445 #define L2CAP_EVENT_INCOMING_CONNECTION 0x72 446 447 // ?? 448 // data: event(8), len(8), handle(16) 449 #define L2CAP_EVENT_TIMEOUT_CHECK 0x73 450 451 /** 452 * @format H2222 453 * @param handle 454 * @param interval_min 455 * @param interval_max 456 * @param latencey 457 * @param timeout_multiplier 458 */ 459 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 0x76 460 461 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail) 462 /** 463 * @format H2 464 * @param handle 465 * @param result 466 */ 467 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 0x77 468 469 /** 470 * @format 2 471 * @param local_cid 472 */ 473 #define L2CAP_EVENT_CAN_SEND_NOW 0x78 474 475 // LE Data Channels 476 477 /** 478 * @format 1BH2222 479 * @param address_type 480 * @param address 481 * @param handle 482 * @param psm 483 * @param local_cid 484 * @param remote_cid 485 * @param remote_mtu 486 */ 487 #define L2CAP_EVENT_LE_INCOMING_CONNECTION 0x79 488 489 /** 490 * @format 11BH122222 491 * @param status 492 * @param address_type 493 * @param address 494 * @param handle 495 * @param incoming 496 * @param psm 497 * @param local_cid 498 * @param remote_cid 499 * @param local_mtu 500 * @param remote_mtu 501 */ 502 #define L2CAP_EVENT_LE_CHANNEL_OPENED 0x7a 503 504 /* 505 * @format 2 506 * @param local_cid 507 */ 508 #define L2CAP_EVENT_LE_CHANNEL_CLOSED 0x7b 509 510 /* 511 * @format 2 512 * @param local_cid 513 */ 514 #define L2CAP_EVENT_LE_CAN_SEND_NOW 0x7c 515 516 /* 517 * @format 2 518 * @param local_cid 519 */ 520 #define L2CAP_EVENT_LE_PACKET_SENT 0x7d 521 522 523 // RFCOMM EVENTS 524 525 /** 526 * @format 1B21221 527 * @param status 528 * @param bd_addr 529 * @param con_handle 530 * @param server_channel 531 * @param rfcomm_cid 532 * @param max_frame_size 533 * @param incoming 534 */ 535 #define RFCOMM_EVENT_CHANNEL_OPENED 0x80 536 537 /** 538 * @format 2 539 * @param rfcomm_cid 540 */ 541 #define RFCOMM_EVENT_CHANNEL_CLOSED 0x81 542 543 /** 544 * @format B12 545 * @param bd_addr 546 * @param server_channel 547 * @param rfcomm_cid 548 */ 549 #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 550 551 /** 552 * @format 21 553 * @param rfcomm_cid 554 * @param line_status 555 */ 556 #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 557 558 /** 559 * @format 21 560 * @param rfcomm_cid 561 * @param modem_status 562 */ 563 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 564 565 /** 566 * TODO: format for variable data 2? 567 * param rfcomm_cid 568 * param rpn_data 569 */ 570 #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 571 572 /** 573 * @format 2 574 * @param rfcomm_cid 575 */ 576 #define RFCOMM_EVENT_CAN_SEND_NOW 0x89 577 578 579 /** 580 * @format 1 581 * @param status 582 */ 583 #define SDP_EVENT_QUERY_COMPLETE 0x91 584 585 /** 586 * @format 1T 587 * @param rfcomm_channel 588 * @param name 589 */ 590 #define SDP_EVENT_QUERY_RFCOMM_SERVICE 0x92 591 592 /** 593 * @format 22221 594 * @param record_id 595 * @param attribute_id 596 * @param attribute_length 597 * @param data_offset 598 * @param data 599 */ 600 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE 0x93 601 602 /** 603 * @format 22LV 604 * @param record_id 605 * @param attribute_id 606 * @param attribute_length 607 * @param attribute_value 608 */ 609 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE 0x94 610 611 /** 612 * @format 224 613 * @param total_count 614 * @param record_index 615 * @param record_handle 616 * @note Not provided by daemon, only used for internal testing 617 */ 618 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 0x95 619 620 /** 621 * @format H1 622 * @param handle 623 * @param status 624 */ 625 #define GATT_EVENT_QUERY_COMPLETE 0xA0 626 627 /** 628 * @format HX 629 * @param handle 630 * @param service 631 */ 632 #define GATT_EVENT_SERVICE_QUERY_RESULT 0xA1 633 634 /** 635 * @format HY 636 * @param handle 637 * @param characteristic 638 */ 639 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 0xA2 640 641 /** 642 * @format H2X 643 * @param handle 644 * @param include_handle 645 * @param service 646 */ 647 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 0xA3 648 649 /** 650 * @format HZ 651 * @param handle 652 * @param characteristic_descriptor 653 */ 654 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 0xA4 655 656 /** 657 * @format H2LV 658 * @param handle 659 * @param value_handle 660 * @param value_length 661 * @param value 662 */ 663 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA5 664 665 /** 666 * @format H22LV 667 * @param handle 668 * @param value_handle 669 * @param value_offset 670 * @param value_length 671 * @param value 672 */ 673 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA6 674 675 /** 676 * @format H2LV 677 * @param handle 678 * @param value_handle 679 * @param value_length 680 * @param value 681 */ 682 #define GATT_EVENT_NOTIFICATION 0xA7 683 684 /** 685 * @format H2LV 686 * @param handle 687 * @param value_handle 688 * @param value_length 689 * @param value 690 */ 691 #define GATT_EVENT_INDICATION 0xA8 692 693 /** 694 * @format H2LV 695 * @param handle 696 * @param descriptor_handle 697 * @param descriptor_length 698 * @param descriptor 699 */ 700 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xA9 701 702 /** 703 * @format H2LV 704 * @param handle 705 * @param descriptor_offset 706 * @param descriptor_length 707 * @param descriptor 708 */ 709 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xAA 710 711 /** 712 * @format H2 713 * @param handle 714 * @param MTU 715 */ 716 #define GATT_EVENT_MTU 0xAB 717 718 /** 719 * @format H2 720 * @param handle 721 * @param MTU 722 */ 723 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE 0xB5 724 725 /** 726 * @format 1H2 727 * @param status 728 * @param conn_handle 729 * @param attribute_handle 730 */ 731 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 0xB6 732 733 /** 734 * @format 735 */ 736 #define ATT_EVENT_CAN_SEND_NOW 0xB7 737 738 // TODO: daemon only event 739 740 /** 741 * @format 12 742 * @param status 743 * @param service_uuid 744 */ 745 #define BNEP_EVENT_SERVICE_REGISTERED 0xC0 746 747 /** 748 * @format 12222B 749 * @param status 750 * @param bnep_cid 751 * @param source_uuid 752 * @param destination_uuid 753 * @param mtu 754 * @param remote_address 755 */ 756 #define BNEP_EVENT_CHANNEL_OPENED 0xC1 757 758 /** 759 * @format 222B 760 * @param bnep_cid 761 * @param source_uuid 762 * @param destination_uuid 763 * @param remote_address 764 */ 765 #define BNEP_EVENT_CHANNEL_CLOSED 0xC2 766 767 /** 768 * @format 222B1 769 * @param bnep_cid 770 * @param source_uuid 771 * @param destination_uuid 772 * @param remote_address 773 * @param channel_state 774 */ 775 #define BNEP_EVENT_CHANNEL_TIMEOUT 0xC3 776 777 /** 778 * @format 222B 779 * @param bnep_cid 780 * @param source_uuid 781 * @param destination_uuid 782 * @param remote_address 783 */ 784 #define BNEP_EVENT_CAN_SEND_NOW 0xC4 785 786 /** 787 * @format H1B 788 * @param handle 789 * @param addr_type 790 * @param address 791 */ 792 #define SM_EVENT_JUST_WORKS_REQUEST 0xD0 793 794 /** 795 * @format H1B 796 * @param handle 797 * @param addr_type 798 * @param address 799 */ 800 #define SM_EVENT_JUST_WORKS_CANCEL 0xD1 801 802 /** 803 * @format H1B4 804 * @param handle 805 * @param addr_type 806 * @param address 807 * @param passkey 808 */ 809 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER 0xD2 810 811 /** 812 * @format H1B 813 * @param handle 814 * @param addr_type 815 * @param address 816 */ 817 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL 0xD3 818 819 /** 820 * @format H1B 821 * @param handle 822 * @param addr_type 823 * @param address 824 */ 825 #define SM_EVENT_PASSKEY_INPUT_NUMBER 0xD4 826 827 /** 828 * @format H1B 829 * @param handle 830 * @param addr_type 831 * @param address 832 */ 833 #define SM_EVENT_PASSKEY_INPUT_CANCEL 0xD5 834 835 /** 836 * @format H1B4 837 * @param handle 838 * @param addr_type 839 * @param address 840 * @param passkey 841 */ 842 #define SM_EVENT_NUMERIC_COMPARISON_REQUEST 0xD6 843 844 /** 845 * @format H1B 846 * @param handle 847 * @param addr_type 848 * @param address 849 */ 850 #define SM_EVENT_NUMERIC_COMPARISON_CANCEL 0xD7 851 852 /** 853 * @format H1B 854 * @param handle 855 * @param addr_type 856 * @param address 857 */ 858 #define SM_EVENT_IDENTITY_RESOLVING_STARTED 0xD8 859 860 /** 861 * @format H1B 862 * @param handle 863 * @param addr_type 864 * @param address 865 */ 866 #define SM_EVENT_IDENTITY_RESOLVING_FAILED 0xD9 867 868 /** 869 * @brief Identify resolving succeeded 870 * 871 * @format H1B1B2 872 * @param handle 873 * @param addr_type 874 * @param address 875 * @param identity_addr_type 876 * @param identity_address 877 * @param index_internal 878 * 879 */ 880 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 0xDA 881 882 /** 883 * @format H1B 884 * @param handle 885 * @param addr_type 886 * @param address 887 */ 888 #define SM_EVENT_AUTHORIZATION_REQUEST 0xDB 889 890 /** 891 * @format H1B1 892 * @param handle 893 * @param addr_type 894 * @param address 895 * @param authorization_result 896 */ 897 #define SM_EVENT_AUTHORIZATION_RESULT 0xDC 898 899 /** 900 * @format H1 901 * @param handle 902 * @param action see SM_KEYPRESS_* 903 */ 904 #define SM_EVENT_KEYPRESS_NOTIFICATION 0xDD 905 906 /** 907 * @brief Emitted during pairing to inform app about address used as identity 908 * 909 * @format H1B1B 910 * @param handle 911 * @param addr_type 912 * @param address 913 * @param identity_addr_type 914 * @param identity_address 915 */ 916 #define SM_EVENT_IDENTITY_CREATED 0xDE 917 918 // GAP 919 920 /** 921 * @format H1 922 * @param handle 923 * @param security_level 924 */ 925 #define GAP_EVENT_SECURITY_LEVEL 0xE0 926 927 /** 928 * @format 1B 929 * @param status 930 * @param address 931 */ 932 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED 0xE1 933 934 /** 935 * @format 11B1JV 936 * @param advertising_event_type 937 * @param address_type 938 * @param address 939 * @param rssi 940 * @param data_length 941 * @param data 942 */ 943 #define GAP_EVENT_ADVERTISING_REPORT 0xE2 944 945 /** 946 * @format B132111JV 947 * @param bd_addr 948 * @param page_scan_repetition_mode 949 * @param class_of_device 950 * @param clock_offset 951 * @param rssi_available 952 * @param rssi 953 * @param name_available 954 * @param name_len 955 * @param name 956 */ 957 #define GAP_EVENT_INQUIRY_RESULT 0xE3 958 959 /** 960 * @format 1 961 * @param status 962 */ 963 #define GAP_EVENT_INQUIRY_COMPLETE 0xE4 964 965 966 // Meta Events, see below for sub events 967 #define HCI_EVENT_HSP_META 0xE8 968 #define HCI_EVENT_HFP_META 0xE9 969 #define HCI_EVENT_ANCS_META 0xEA 970 #define HCI_EVENT_AVDTP_META 0xEB 971 #define HCI_EVENT_AVRCP_META 0xEC 972 #define HCI_EVENT_GOEP_META 0xED 973 #define HCI_EVENT_PBAP_META 0xEE 974 #define HCI_EVENT_HID_META 0xEF 975 #define HCI_EVENT_A2DP_META 0xF0 976 977 // Potential other meta groups 978 // #define HCI_EVENT_BNEP_META 0xxx 979 // #define HCI_EVENT_GAP_META 0xxx 980 // #define HCI_EVENT_GATT_META 0xxx 981 // #define HCI_EVENT_PAN_META 0xxx 982 // #define HCI_EVENT_SDP_META 0xxx 983 // #define HCI_EVENT_SM_META 0xxx 984 985 986 /** HSP Subevent */ 987 988 /** 989 * @format 11 990 * @param subevent_code 991 * @param status 0 == OK 992 */ 993 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 0x01 994 995 /** 996 * @format 11 997 * @param subevent_code 998 * @param status 0 == OK 999 */ 1000 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 0x02 1001 1002 1003 /** 1004 * @format 11H 1005 * @param subevent_code 1006 * @param status 0 == OK 1007 * @param handle 1008 */ 1009 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x03 1010 1011 /** 1012 * @format 11 1013 * @param subevent_code 1014 * @param status 0 == OK 1015 */ 1016 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x04 1017 1018 /** 1019 * @format 1 1020 * @param subevent_code 1021 */ 1022 #define HSP_SUBEVENT_RING 0x05 1023 1024 /** 1025 * @format 11 1026 * @param subevent_code 1027 * @param gain Valid range: [0,15] 1028 */ 1029 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x06 1030 1031 /** 1032 * @format 11 1033 * @param subevent_code 1034 * @param gain Valid range: [0,15] 1035 */ 1036 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x07 1037 1038 /** 1039 * @format 1JV 1040 * @param subevent_code 1041 * @param value_length 1042 * @param value 1043 */ 1044 #define HSP_SUBEVENT_HS_COMMAND 0x08 1045 1046 /** 1047 * @format 1JV 1048 * @param subevent_code 1049 * @param value_length 1050 * @param value 1051 */ 1052 #define HSP_SUBEVENT_AG_INDICATION 0x09 1053 1054 1055 /** HFP Subevent */ 1056 1057 /** 1058 * @format 11HB 1059 * @param subevent_code 1060 * @param status 0 == OK 1061 * @param con_handle 1062 * @param bd_addr 1063 */ 1064 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 0x01 1065 1066 /** 1067 * @format 1 1068 * @param subevent_code 1069 */ 1070 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 1071 1072 /** 1073 * @format 11HB1 1074 * @param subevent_code 1075 * @param status 0 == OK 1076 * @param handle 1077 * @param bd_addr 1078 * @param negotiated_codec 1079 */ 1080 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 1081 1082 /** 1083 * @format 1 1084 * @param subevent_code 1085 */ 1086 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED 0x04 1087 1088 /** 1089 * @format 11 1090 * @param subevent_code 1091 * @param status 0 == OK 1092 */ 1093 #define HFP_SUBEVENT_COMPLETE 0x05 1094 1095 /** 1096 * @format 111T 1097 * @param subevent_code 1098 * @param indicator_index 1099 * @param indicator_status 1100 * @param indicator_name 1101 */ 1102 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 0x06 1103 1104 /** 1105 * @format 111T 1106 * @param subevent_code 1107 * @param network_operator_mode 1108 * @param network_operator_format 1109 * @param network_operator_name 1110 */ 1111 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 0x07 1112 1113 /** 1114 * @format 11 1115 * @param subevent_code 1116 * @param error 1117 */ 1118 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 0x08 1119 1120 /** 1121 * @format 1 1122 * @param subevent_code 1123 */ 1124 #define HFP_SUBEVENT_START_RINGINIG 0x0A 1125 1126 /** 1127 * @format 1 1128 * @param subevent_code 1129 */ 1130 #define HFP_SUBEVENT_STOP_RINGINIG 0x0B 1131 1132 /** 1133 * @format 1 1134 * @param subevent_code 1135 */ 1136 #define HFP_SUBEVENT_CALL_TERMINATED 0x0C 1137 1138 /** 1139 * @format 1T 1140 * @param subevent_code 1141 * @param number 1142 */ 1143 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 0x0D 1144 1145 /** 1146 * @format 1 1147 * @param subevent_code 1148 */ 1149 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG 0x0E 1150 1151 /** 1152 * @format 1T 1153 * @param subevent_code 1154 * @param number 1155 */ 1156 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 0x0F 1157 1158 /** 1159 * @format 1T 1160 * @param subevent_code 1161 * @param dtmf code 1162 */ 1163 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES 0x10 1164 1165 /** 1166 * @format 1 1167 * @param subevent_code 1168 */ 1169 #define HFP_SUBEVENT_CALL_ANSWERED 0x11 1170 1171 /** 1172 * @format 1 1173 * @param subevent_code 1174 */ 1175 #define HFP_SUBEVENT_CONFERENCE_CALL 0x12 1176 1177 /** 1178 * @format 1 1179 * @param subevent_code 1180 */ 1181 #define HFP_SUBEVENT_RING 0x13 1182 1183 /** 1184 * @format 111 1185 * @param subevent_code 1186 * @param status 1187 * @param gain 1188 */ 1189 #define HFP_SUBEVENT_SPEAKER_VOLUME 0x14 1190 1191 /** 1192 * @format 111 1193 * @param subevent_code 1194 * @param status 1195 * @param gain 1196 */ 1197 #define HFP_SUBEVENT_MICROPHONE_VOLUME 0x15 1198 1199 /** 1200 * @format 11T 1201 * @param subevent_code 1202 * @param type 1203 * @param number 1204 */ 1205 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 0x16 1206 1207 /** 1208 * @format 11T 1209 * @param subevent_code 1210 * @param type 1211 * @param number 1212 */ 1213 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17 1214 1215 /** 1216 * @format 111111T 1217 * @param subevent_code 1218 * @param clcc_idx 1219 * @param clcc_dir 1220 * @param clcc_status 1221 * @param clcc_mpty 1222 * @param bnip_type 1223 * @param bnip_number 1224 */ 1225 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS 0x18 1226 1227 /** 1228 * @format 111T 1229 * @param subevent_code 1230 * @param status 1231 * @param bnip_type 1232 * @param bnip_number 1233 */ 1234 #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 0x19 1235 1236 /** 1237 * @format 1T 1238 * @param subevent_code 1239 * @param value 1240 */ 1241 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 0x1A 1242 1243 // ANCS Client 1244 1245 /** 1246 * @format 1H 1247 * @param subevent_code 1248 * @param handle 1249 */ 1250 #define ANCS_SUBEVENT_CLIENT_CONNECTED 0xF0 1251 1252 /** 1253 * @format 1H2T 1254 * @param subevent_code 1255 * @param handle 1256 * @param attribute_id 1257 * @param text 1258 */ 1259 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION 0xF1 1260 1261 /** 1262 * @format 1H 1263 * @param subevent_code 1264 * @param handle 1265 */ 1266 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED 0xF2 1267 1268 1269 /** AVDTP Subevent */ 1270 1271 /** 1272 * @format 1211 1273 * @param subevent_code 1274 * @param avdtp_cid 1275 * @param local_seid 1276 * @param signal_identifier 1277 */ 1278 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT 0x01 1279 1280 /** 1281 * @format 1211 1282 * @param subevent_code 1283 * @param avdtp_cid 1284 * @param local_seid 1285 * @param signal_identifier 1286 */ 1287 #define AVDTP_SUBEVENT_SIGNALING_REJECT 0x02 1288 1289 /** 1290 * @format 1211 1291 * @param subevent_code 1292 * @param avdtp_cid 1293 * @param local_seid 1294 * @param signal_identifier 1295 */ 1296 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 0x03 1297 1298 /** 1299 * @format 12B1 1300 * @param subevent_code 1301 * @param avdtp_cid 1302 * @param bd_addr 1303 * @param status 0 == OK 1304 */ 1305 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 0x04 1306 1307 /** 1308 * @format 12 1309 * @param subevent_code 1310 * @param avdtp_cid 1311 */ 1312 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 0x05 1313 1314 /** 1315 * @format 121111 1316 * @param subevent_code 1317 * @param avdtp_cid 1318 * @param remote_seid 0x01 – 0x3E 1319 * @param in_use 0-not in use, 1-in use 1320 * @param media_type 0-audio, 1-video, 2-multimedia 1321 * @param sep_type 0-source, 1-sink 1322 */ 1323 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 0x06 1324 1325 /** 1326 * @format 121111111111 1327 * @param subevent_code 1328 * @param avdtp_cid 1329 * @param local_seid 1330 * @param remote_seid 1331 * @param media_type 1332 * @param sampling_frequency_bitmap 1333 * @param channel_mode_bitmap 1334 * @param block_length_bitmap 1335 * @param subbands_bitmap 1336 * @param allocation_method_bitmap 1337 * @param min_bitpool_value 1338 * @param max_bitpool_value 1339 */ 1340 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 0x07 1341 1342 /** 1343 * @format 121112LV 1344 * @param subevent_code 1345 * @param avdtp_cid 1346 * @param local_seid 1347 * @param remote_seid 1348 * @param media_type 1349 * @param media_codec_type 1350 * @param media_codec_information_len 1351 * @param media_codec_information 1352 */ 1353 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 0x08 1354 1355 /** 1356 * @format 12111121111111 1357 * @param subevent_code 1358 * @param avdtp_cid 1359 * @param local_seid 1360 * @param remote_seid 1361 * @param reconfigure 1362 * @param media_type 1363 * @param sampling_frequency 1364 * @param channel_mode 1365 * @param num_channels 1366 * @param block_length 1367 * @param subbands 1368 * @param allocation_method 1369 * @param min_bitpool_value 1370 * @param max_bitpool_value 1371 */ 1372 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x09 1373 1374 /** 1375 * @format 1211112LV 1376 * @param subevent_code 1377 * @param avdtp_cid 1378 * @param local_seid 1379 * @param remote_seid 1380 * @param reconfigure 1381 * @param media_type 1382 * @param media_codec_type 1383 * @param media_codec_information_len 1384 * @param media_codec_information 1385 */ 1386 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x0A 1387 1388 /** 1389 * @format 12111 1390 * @param subevent_code 1391 * @param avdtp_cid 1392 * @param local_seid 1393 * @param remote_seid 1394 * @param status 0 == OK 1395 */ 1396 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 0x0B 1397 1398 /** 1399 * @format 121 1400 * @param subevent_code 1401 * @param avdtp_cid 1402 * @param local_seid 1403 */ 1404 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED 0x0C 1405 1406 /** 1407 * @format 1212 1408 * @param subevent_code 1409 * @param avdtp_cid 1410 * @param local_seid 1411 * @param sequence_number 1412 */ 1413 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x0D 1414 1415 1416 /** A2DP Subevent */ 1417 /* Stream goes through following states: 1418 * - OPEN - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event 1419 * - START - indicated with A2DP_SUBEVENT_STREAM_STARTED event 1420 * - SUSPEND - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event 1421 * - ABORT/STOP - indicated with A2DP_SUBEVENT_STREAM_RELEASED event 1422 1423 OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started. 1424 START can come only after the stream is OPENED, and indicates that media transfer is started. 1425 SUSPEND is optional, it pauses the stream. 1426 */ 1427 1428 /** 1429 * @format 121 Sent only by A2DP source. 1430 * @param subevent_code 1431 * @param a2dp_cid 1432 * @param local_seid 1433 */ 1434 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x01 1435 1436 /** 1437 * @format 12111121111111 1438 * @param subevent_code 1439 * @param a2dp_cid 1440 * @param int_seid 1441 * @param acp_seid 1442 * @param reconfigure 1443 * @param media_type 1444 * @param sampling_frequency 1445 * @param channel_mode 1446 * @param num_channels 1447 * @param block_length 1448 * @param subbands 1449 * @param allocation_method 1450 * @param min_bitpool_value 1451 * @param max_bitpool_value 1452 */ 1453 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x02 1454 1455 /** 1456 * @format 1211112LV 1457 * @param subevent_code 1458 * @param a2dp_cid 1459 * @param int_seid 1460 * @param acp_seid 1461 * @param reconfigure 1462 * @param media_type 1463 * @param media_codec_type 1464 * @param media_codec_information_len 1465 * @param media_codec_information 1466 */ 1467 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x03 1468 1469 /** 1470 * @format 12111 Stream is opened byt not started. 1471 * @param subevent_code 1472 * @param a2dp_cid 1473 * @param local_seid 1474 * @param remote_seid 1475 * @param status 1476 */ 1477 #define A2DP_SUBEVENT_STREAM_ESTABLISHED 0x04 1478 1479 /** 1480 * @format 121 Indicates that media transfer is started. 1481 * @param subevent_code 1482 * @param a2dp_cid 1483 * @param local_seid 1484 */ 1485 #define A2DP_SUBEVENT_STREAM_STARTED 0x05 1486 1487 /** 1488 * @format 121 Stream is paused. 1489 * @param subevent_code 1490 * @param a2dp_cid 1491 * @param local_seid 1492 */ 1493 #define A2DP_SUBEVENT_STREAM_SUSPENDED 0x06 1494 1495 /** 1496 * @format 121 Stream is released. 1497 * @param subevent_code 1498 * @param a2dp_cid 1499 * @param local_seid 1500 */ 1501 #define A2DP_SUBEVENT_STREAM_RELEASED 0x07 1502 1503 /** 1504 * @format 1211 1505 * @param subevent_code 1506 * @param a2dp_cid 1507 * @param local_seid 1508 * @param signal_identifier 1509 */ 1510 #define A2DP_SUBEVENT_COMMAND_ACCEPTED 0x08 1511 1512 /** 1513 * @format 1211 1514 * @param subevent_code 1515 * @param a2dp_cid 1516 * @param local_seid 1517 * @param signal_identifier 1518 */ 1519 #define A2DP_SUBEVENT_COMMAND_REJECTED 0x09 1520 1521 /** AVRCP Subevent */ 1522 1523 /** 1524 * @format 11B2 1525 * @param subevent_code 1526 * @param status 0 == OK 1527 * @param bd_addr 1528 * @param avrcp_cid 1529 */ 1530 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 0x01 1531 1532 /** 1533 * @format 12 1534 * @param subevent_code 1535 * @param avrcp_cid 1536 */ 1537 #define AVRCP_SUBEVENT_CONNECTION_RELEASED 0x02 1538 1539 /** 1540 * @format 121114JVJVJVJV 1541 * @param subevent_code 1542 * @param avrcp_cid 1543 * @param command_type 1544 * @param track 1545 * @param total_tracks 1546 * @param song_length in ms 1547 * @param title_len 1548 * @param title 1549 * @param artist_len 1550 * @param artist 1551 * @param album_len 1552 * @param album 1553 * @param genre_len 1554 * @param genre 1555 */ 1556 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO 0x03 1557 1558 /** 1559 * @format 12111 1560 * @param subevent_code 1561 * @param avrcp_cid 1562 * @param command_type 1563 * @param repeat_mode 1564 * @param shuffle_mode 1565 */ 1566 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 0x04 1567 1568 /** 1569 * @format 121441 1570 * @param subevent_code 1571 * @param avrcp_cid 1572 * @param command_type 1573 * @param song_length 1574 * @param song_position 1575 * @param play_status 1576 */ 1577 #define AVRCP_SUBEVENT_PLAY_STATUS 0x05 1578 1579 /** 1580 * @format 1211 1581 * @param subevent_code 1582 * @param avrcp_cid 1583 * @param command_type 1584 * @param play_status 1585 */ 1586 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 0x06 1587 1588 /** 1589 * @format 121 1590 * @param subevent_code 1591 * @param avrcp_cid 1592 * @param command_type 1593 */ 1594 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 0x07 1595 1596 /** 1597 * @format 121 1598 * @param subevent_code 1599 * @param avrcp_cid 1600 * @param command_type 1601 */ 1602 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 0x08 1603 1604 /** 1605 * @format 121 1606 * @param subevent_code 1607 * @param avrcp_cid 1608 * @param command_type 1609 */ 1610 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 0x09 1611 1612 /** 1613 * @format 1211 1614 * @param subevent_code 1615 * @param avrcp_cid 1616 * @param command_type 1617 * @param absolute_volume 1618 */ 1619 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 0x0A 1620 1621 /** 1622 * @format 1211 1623 * @param subevent_code 1624 * @param avrcp_cid 1625 * @param command_type 1626 * @param absolute_volume 1627 */ 1628 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 0x0B 1629 1630 /** 1631 * @format 1211 1632 * @param subevent_code 1633 * @param avrcp_cid 1634 * @param command_type 1635 * @param notification_id 1636 */ 1637 #define AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 0x0C 1638 1639 /** 1640 * @format 1211 1641 * @param subevent_code 1642 * @param avrcp_cid 1643 * @param command_type 1644 * @param operation_id 1645 */ 1646 #define AVRCP_SUBEVENT_OPERATION_START 0x0D 1647 1648 /** 1649 * @format 1211 1650 * @param subevent_code 1651 * @param avrcp_cid 1652 * @param command_type 1653 * @param operation_id 1654 */ 1655 #define AVRCP_SUBEVENT_OPERATION_COMPLETE 0x0E 1656 1657 /** 1658 * @format 121 1659 * @param subevent_code 1660 * @param avrcp_cid 1661 * @param command_type 1662 */ 1663 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 0x0F 1664 1665 /** 1666 * @format 121BH1 1667 * @param subevent_code 1668 * @param goep_cid 1669 * @param status 1670 * @param bd_addr 1671 * @param con_handle 1672 * @param incoming 1673 */ 1674 #define GOEP_SUBEVENT_CONNECTION_OPENED 0x01 1675 1676 /** 1677 * @format 12 1678 * @param subevent_code 1679 * @param goep_cid 1680 */ 1681 #define GOEP_SUBEVENT_CONNECTION_CLOSED 0x02 1682 1683 /** 1684 * @format 12 1685 * @param subevent_code 1686 * @param goep_cid 1687 */ 1688 #define GOEP_SUBEVENT_CAN_SEND_NOW 0x03 1689 1690 /** 1691 * @format 121BH1 1692 * @param subevent_code 1693 * @param pbap_cid 1694 * @param status 1695 * @param bd_addr 1696 * @param con_handle 1697 * @param incoming 1698 */ 1699 #define PBAP_SUBEVENT_CONNECTION_OPENED 0x01 1700 1701 /** 1702 * @format 12 1703 * @param subevent_code 1704 * @param goep_cid 1705 */ 1706 #define PBAP_SUBEVENT_CONNECTION_CLOSED 0x02 1707 1708 /** 1709 * @format 121 1710 * @param subevent_code 1711 * @param goep_cid 1712 * @param status 1713 */ 1714 #define PBAP_SUBEVENT_OPERATION_COMPLETED 0x03 1715 1716 /** 1717 * @format 121BH1 1718 * @param subevent_code 1719 * @param hid_cid 1720 * @param status 1721 * @param bd_addr 1722 * @param con_handle 1723 * @param incoming 1724 */ 1725 #define HID_SUBEVENT_CONNECTION_OPENED 0x01 1726 1727 /** 1728 * @format 12 1729 * @param subevent_code 1730 * @param hid_cid 1731 */ 1732 #define HID_SUBEVENT_CONNECTION_CLOSED 0x02 1733 1734 /** 1735 * @format 12 1736 * @param subevent_code 1737 * @param hid_cid 1738 */ 1739 #define HID_SUBEVENT_CAN_SEND_NOW 0x03 1740 1741 #endif 1742