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