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 48 #include "btstack_linked_list.h" 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 // Mesh Provisioning PDU 121 #define PROVISIONING_DATA_PACKET 0x11 122 123 // Mesh Proxy PDU 124 #define MESH_PROXY_DATA_PACKET 0x11 125 126 // Mesh Network PDU 127 #define MESH_NETWORK_PACKET 0x12 128 129 // Mesh Network PDU 130 #define MESH_BEACON_PACKET 0x13 131 132 // debug log messages 133 #define LOG_MESSAGE_PACKET 0xfc 134 135 136 // DAEMON COMMANDS 137 138 #define OGF_BTSTACK 0x3d 139 140 // cmds for BTstack 141 // get state: @returns HCI_STATE 142 #define BTSTACK_GET_STATE 0x01 143 144 // set power mode: param HCI_POWER_MODE 145 #define BTSTACK_SET_POWER_MODE 0x02 146 147 // set capture mode: param on 148 #define BTSTACK_SET_ACL_CAPTURE_MODE 0x03 149 150 // get BTstack version 151 #define BTSTACK_GET_VERSION 0x04 152 153 // get system Bluetooth state 154 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED 0x05 155 156 // set system Bluetooth state 157 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED 0x06 158 159 // enable inquiry scan for this client 160 #define BTSTACK_SET_DISCOVERABLE 0x07 161 162 // set global Bluetooth state 163 #define BTSTACK_SET_BLUETOOTH_ENABLED 0x08 164 165 // create l2cap channel: param bd_addr(48), psm (16) 166 #define L2CAP_CREATE_CHANNEL 0x20 167 168 // disconnect l2cap disconnect, param channel(16), reason(8) 169 #define L2CAP_DISCONNECT 0x21 170 171 // register l2cap service: param psm(16), mtu (16) 172 #define L2CAP_REGISTER_SERVICE 0x22 173 174 // unregister l2cap disconnect, param psm(16) 175 #define L2CAP_UNREGISTER_SERVICE 0x23 176 177 // accept connection param bd_addr(48), dest cid (16) 178 #define L2CAP_ACCEPT_CONNECTION 0x24 179 180 // decline l2cap disconnect,param bd_addr(48), dest cid (16), reason(8) 181 #define L2CAP_DECLINE_CONNECTION 0x25 182 183 // create l2cap channel: param bd_addr(48), psm (16), mtu (16) 184 #define L2CAP_CREATE_CHANNEL_MTU 0x26 185 186 // register SDP Service Record: service record (size) 187 #define SDP_REGISTER_SERVICE_RECORD 0x30 188 189 // unregister SDP Service Record 190 #define SDP_UNREGISTER_SERVICE_RECORD 0x31 191 192 // Get remote RFCOMM services 193 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES 0x32 194 195 // Get remote SDP services 196 #define SDP_CLIENT_QUERY_SERVICES 0x33 197 198 // RFCOMM "HCI" Commands 199 #define RFCOMM_CREATE_CHANNEL 0x40 200 #define RFCOMM_DISCONNECT 0x41 201 #define RFCOMM_REGISTER_SERVICE 0x42 202 #define RFCOMM_UNREGISTER_SERVICE 0x43 203 #define RFCOMM_ACCEPT_CONNECTION 0x44 204 #define RFCOMM_DECLINE_CONNECTION 0x45 205 #define RFCOMM_PERSISTENT_CHANNEL 0x46 206 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS 0x47 207 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS 0x48 208 #define RFCOMM_GRANT_CREDITS 0x49 209 210 // GAP Classic 0x50 211 #define GAP_DISCONNECT 0x50 212 213 // GAP LE 0x60 214 #define GAP_LE_SCAN_START 0x60 215 #define GAP_LE_SCAN_STOP 0x61 216 #define GAP_LE_CONNECT 0x62 217 #define GAP_LE_CONNECT_CANCEL 0x63 218 #define GAP_LE_SET_SCAN_PARAMETERS 0x64 219 220 // GATT (Client) 0x70 221 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70 222 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16 0x71 223 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128 0x72 224 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE 0x73 225 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE 0x74 226 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128 0x75 227 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS 0x76 228 #define GATT_READ_VALUE_OF_CHARACTERISTIC 0x77 229 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC 0x78 230 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE 0x79 231 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC 0x7A 232 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7B 233 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC 0x7C 234 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR 0X7D 235 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR 0X7E 236 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR 0X7F 237 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR 0X80 238 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION 0X81 239 #define GATT_GET_MTU 0x82 240 241 // SM 0x90 242 #define SM_SET_AUTHENTICATION_REQUIREMENTS 0x90 243 #define SM_SET_IO_CAPABILITIES 0x92 244 #define SM_BONDING_DECLINE 0x93 245 #define SM_JUST_WORKS_CONFIRM 0x94 246 #define SM_NUMERIC_COMPARISON_CONFIRM 0x95 247 #define SM_PASSKEY_INPUT 0x96 248 249 // ATT 250 251 // .. 252 // Internal properties reuse some GATT Characteristic Properties fields 253 #define ATT_DB_VERSION 0x01 254 255 // EVENTS 256 257 // Events from host controller to host 258 259 /** 260 * @format 1 261 * @param status 262 */ 263 #define HCI_EVENT_INQUIRY_COMPLETE 0x01 264 265 /** 266 * @format 1B11132 267 * @param num_responses 268 * @param bd_addr 269 * @param page_scan_repetition_mode 270 * @param reserved1 271 * @param reserved2 272 * @param class_of_device 273 * @param clock_offset 274 */ 275 #define HCI_EVENT_INQUIRY_RESULT 0x02 276 277 /** 278 * @format 12B11 279 * @param status 280 * @param connection_handle 281 * @param bd_addr 282 * @param link_type 283 * @param encryption_enabled 284 */ 285 #define HCI_EVENT_CONNECTION_COMPLETE 0x03 286 /** 287 * @format B31 288 * @param bd_addr 289 * @param class_of_device 290 * @param link_type 291 */ 292 #define HCI_EVENT_CONNECTION_REQUEST 0x04 293 /** 294 * @format 121 295 * @param status 296 * @param connection_handle 297 * @param reason 298 */ 299 #define HCI_EVENT_DISCONNECTION_COMPLETE 0x05 300 /** 301 * @format 12 302 * @param status 303 * @param connection_handle 304 */ 305 #define HCI_EVENT_AUTHENTICATION_COMPLETE 0x06 306 307 // HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT is deprecated, use HCI_EVENT_AUTHENTICATION_COMPLETE instead 308 #define HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT HCI_EVENT_AUTHENTICATION_COMPLETE 309 310 /** 311 * @format 1BN 312 * @param status 313 * @param bd_addr 314 * @param remote_name 315 */ 316 #define HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07 317 /** 318 * @format 121 319 * @param status 320 * @param connection_handle 321 * @param encryption_enabled 322 */ 323 #define HCI_EVENT_ENCRYPTION_CHANGE 0x08 324 /** 325 * @format 12 326 * @param status 327 * @param connection_handle 328 */ 329 #define HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE 0x09 330 /** 331 * @format 121 332 * @param status 333 * @param connection_handle 334 * @param key_flag 335 */ 336 #define HCI_EVENT_MASTER_LINK_KEY_COMPLETE 0x0A 337 338 #define HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE 0x0B 339 340 /** 341 * @format 12122 342 * @param status 343 * @param connection_handle 344 * @param version 345 * @param manufacturer_name 346 * @param subversion 347 */ 348 #define HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C 349 350 #define HCI_EVENT_QOS_SETUP_COMPLETE 0x0D 351 352 /** 353 * @format 12R 354 * @param num_hci_command_packets 355 * @param command_opcode 356 * @param return_parameters 357 */ 358 #define HCI_EVENT_COMMAND_COMPLETE 0x0E 359 /** 360 * @format 112 361 * @param status 362 * @param num_hci_command_packets 363 * @param command_opcode 364 */ 365 #define HCI_EVENT_COMMAND_STATUS 0x0F 366 367 /** 368 * @format 1 369 * @param hardware_code 370 */ 371 #define HCI_EVENT_HARDWARE_ERROR 0x10 372 373 #define HCI_EVENT_FLUSH_OCCURRED 0x11 374 375 /** 376 * @format 1B1 377 * @param status 378 * @param bd_addr 379 * @param role 380 */ 381 #define HCI_EVENT_ROLE_CHANGE 0x12 382 383 // TODO: number_of_handles 1, connection_handle[H*i], hc_num_of_completed_packets[2*i] 384 #define HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS 0x13 385 386 /** 387 * @format 1H12 388 * @param status 389 * @param handle 390 * @param mode 391 * @param interval 392 */ 393 #define HCI_EVENT_MODE_CHANGE 0x14 394 395 // TODO: num_keys, bd_addr[B*i], link_key[16 octets * i] 396 #define HCI_EVENT_RETURN_LINK_KEYS 0x15 397 398 /** 399 * @format B 400 * @param bd_addr 401 */ 402 #define HCI_EVENT_PIN_CODE_REQUEST 0x16 403 404 /** 405 * @format B 406 * @param bd_addr 407 */ 408 #define HCI_EVENT_LINK_KEY_REQUEST 0x17 409 410 // TODO: bd_addr B, link_key 16octets, key_type 1 411 #define HCI_EVENT_LINK_KEY_NOTIFICATION 0x18 412 413 /** 414 * @format 1 415 * @param link_type 416 */ 417 #define HCI_EVENT_DATA_BUFFER_OVERFLOW 0x1A 418 419 /** 420 * @format H1 421 * @param handle 422 * @param lmp_max_slots 423 */ 424 #define HCI_EVENT_MAX_SLOTS_CHANGED 0x1B 425 426 /** 427 * @format 1H2 428 * @param status 429 * @param handle 430 * @param clock_offset 431 */ 432 #define HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 0x1C 433 434 /** 435 * @format 1H2 436 * @param status 437 * @param handle 438 * @param packet_types 439 * @pnote packet_type is in plural to avoid clash with Java binding Packet.getPacketType() 440 */ 441 #define HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED 0x1D 442 443 /** 444 * @format 1B11321 445 * @param num_responses 446 * @param bd_addr 447 * @param page_scan_repetition_mode 448 * @param reserved 449 * @param class_of_device 450 * @param clock_offset 451 * @param rssi 452 */ 453 #define HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 0x22 454 455 #define HCI_EVENT_READ_REMOTE_EXTENDED_FEATURES_COMPLETE 0x23 456 457 /** 458 * @format 1HB111221 459 * @param status 460 * @param handle 461 * @param bd_addr 462 * @param link_type 463 * @param transmission_interval 464 * @param retransmission_interval 465 * @param rx_packet_length 466 * @param tx_packet_length 467 * @param air_mode 468 */ 469 #define HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 0x2C 470 471 // TODO: serialize extended_inquiry_response and provide parser 472 /** 473 * @format 1B11321 474 * @param num_responses 475 * @param bd_addr 476 * @param page_scan_repetition_mode 477 * @param reserved 478 * @param class_of_device 479 * @param clock_offset 480 * @param rssi 481 */ 482 #define HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 0x2F 483 484 /** 485 * @format 1H 486 * @param status 487 * @param handle 488 */ 489 #define HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30 490 491 #define HCI_EVENT_IO_CAPABILITY_REQUEST 0x31 492 #define HCI_EVENT_IO_CAPABILITY_RESPONSE 0x32 493 494 /** 495 * @format B4 496 * @param bd_addr 497 * @param numeric_value 498 */ 499 #define HCI_EVENT_USER_CONFIRMATION_REQUEST 0x33 500 501 /** 502 * @format B 503 * @param bd_addr 504 */ 505 #define HCI_EVENT_USER_PASSKEY_REQUEST 0x34 506 507 /** 508 * @format B 509 * @param bd_addr 510 */ 511 #define HCI_EVENT_REMOTE_OOB_DATA_REQUEST 0x35 512 513 /** 514 * @format 1B 515 * @param status 516 * @param bd_addr 517 */ 518 #define HCI_EVENT_SIMPLE_PAIRING_COMPLETE 0x36 519 520 #define HCI_EVENT_LE_META 0x3E 521 522 // last used HCI_EVENT in 2.1 is 0x3d 523 // last used HCI_EVENT in 4.1 is 0x57 524 525 #define HCI_EVENT_VENDOR_SPECIFIC 0xFF 526 527 /** 528 * @format 11H11B2221 529 * @param subevent_code 530 * @param status 531 * @param connection_handle 532 * @param role 533 * @param peer_address_type 534 * @param peer_address 535 * @param conn_interval 536 * @param conn_latency 537 * @param supervision_timeout 538 * @param master_clock_accuracy 539 */ 540 #define HCI_SUBEVENT_LE_CONNECTION_COMPLETE 0x01 541 542 // array of advertisements, not handled by event accessor generator 543 #define HCI_SUBEVENT_LE_ADVERTISING_REPORT 0x02 544 545 /** 546 * @format 11H222 547 * @param subevent_code 548 * @param status 549 * @param connection_handle 550 * @param conn_interval 551 * @param conn_latency 552 * @param supervision_timeout 553 */ 554 #define HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 0x03 555 556 /** 557 * @format 1HD2 558 * @param subevent_code 559 * @param connection_handle 560 * @param random_number 561 * @param encryption_diversifier 562 */ 563 #define HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 0x04 564 565 /** 566 * @format 1HD2 567 * @param subevent_code 568 * @param connection_handle 569 * @param random_number 570 * @param encryption_diversifier 571 */ 572 #define HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 0x05 573 574 /** 575 * @format 1H2222 576 * @param subevent_code 577 * @param connection_handle 578 * @param interval_min 579 * @param interval_max 580 * @param latency 581 * @param timeout 582 */ 583 #define HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 0x06 584 585 /** 586 * @format 1H2222 587 * @param subevent_code 588 * @param connection_handle 589 * @param max_tx_octets 590 * @param max_tx_time 591 * @param max_rx_octets 592 * @param max_rx_time 593 */ 594 #define HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 0x07 595 596 /** 597 * @format 11QQ 598 * @param subevent_code 599 * @param status 600 * @param dhkey_x x coordinate of P256 public key 601 * @param dhkey_y y coordinate of P256 public key 602 */ 603 #define HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 0x08 604 /** 605 * @format 11Q 606 * @param subevent_code 607 * @param status 608 * @param dhkey Diffie-Hellman key 609 */ 610 #define HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 0x09 611 612 /** 613 * @format 11H11BBB2221 614 * @param subevent_code 615 * @param status 616 * @param connection_handle 617 * @param role 618 * @param peer_address_type 619 * @param perr_addresss 620 * @param local_resolvable_private_addres 621 * @param peer_resolvable_private_addres 622 * @param conn_interval 623 * @param conn_latency 624 * @param supervision_timeout 625 * @param master_clock_accuracy 626 */ 627 #define HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 0x0A 628 629 // array of advertisements, not handled by event accessor generator 630 #define HCI_SUBEVENT_LE_DIRECT_ADVERTISING_REPORT 0x0B 631 632 633 /** 634 * @format 1 635 * @param state 636 */ 637 #define BTSTACK_EVENT_STATE 0x60 638 639 /** 640 * @format 1 641 * @param number_connections 642 */ 643 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 644 645 /** 646 * @format 647 */ 648 #define BTSTACK_EVENT_POWERON_FAILED 0x62 649 650 /** 651 * @format 1 652 * @param discoverable 653 */ 654 #define BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 655 656 // Daemon Events 657 658 /** 659 * @format 112 660 * @param major 661 * @param minor 662 @ @param revision 663 */ 664 #define DAEMON_EVENT_VERSION 0x63 665 666 // data: system bluetooth on/off (bool) 667 /** 668 * @format 1 669 * param system_bluetooth_enabled 670 */ 671 #define DAEMON_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 672 673 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes) 674 675 /* 676 * @format 1BT 677 * @param status == 0 to match read_remote_name_request 678 * @param address 679 * @param name 680 */ 681 #define DAEMON_EVENT_REMOTE_NAME_CACHED 0x65 682 683 // internal - data: event(8) 684 #define DAEMON_EVENT_CONNECTION_OPENED 0x67 685 686 // internal - data: event(8) 687 #define DAEMON_EVENT_CONNECTION_CLOSED 0x68 688 689 // data: event(8), len(8), local_cid(16), credits(8) 690 #define DAEMON_EVENT_L2CAP_CREDITS 0x74 691 692 /** 693 * @format 12 694 * @param status 695 * @param psm 696 */ 697 #define DAEMON_EVENT_L2CAP_SERVICE_REGISTERED 0x75 698 699 /** 700 * @format 21 701 * @param rfcomm_cid 702 * @param credits 703 */ 704 #define DAEMON_EVENT_RFCOMM_CREDITS 0x84 705 706 /** 707 * @format 11 708 * @param status 709 * @param channel_id 710 */ 711 #define DAEMON_EVENT_RFCOMM_SERVICE_REGISTERED 0x85 712 713 /** 714 * @format 11 715 * @param status 716 * @param server_channel_id 717 */ 718 #define DAEMON_EVENT_RFCOMM_PERSISTENT_CHANNEL 0x86 719 720 /** 721 * @format 14 722 * @param status 723 * @param service_record_handle 724 */ 725 #define DAEMON_EVENT_SDP_SERVICE_REGISTERED 0x90 726 727 728 729 // additional HCI events 730 731 /** 732 * @brief Indicates HCI transport enters/exits Sleep mode 733 * @format 1 734 * @param active 735 */ 736 #define HCI_EVENT_TRANSPORT_SLEEP_MODE 0x69 737 738 /** 739 * @brief Transport ready 740 */ 741 #define HCI_EVENT_TRANSPORT_READY 0x6D 742 743 /** 744 * @brief Outgoing packet 745 */ 746 #define HCI_EVENT_TRANSPORT_PACKET_SENT 0x6E 747 748 /** 749 * @format B 750 * @param handle 751 */ 752 #define HCI_EVENT_SCO_CAN_SEND_NOW 0x6F 753 754 755 // L2CAP EVENTS 756 757 /** 758 * @format 1BH222222111 759 * @param status 760 * @param address 761 * @param handle 762 * @param psm 763 * @param local_cid 764 * @param remote_cid 765 * @param local_mtu 766 * @param remote_mtu 767 * @param flush_timeout 768 * @param incoming 769 * @param mode 770 * @param fcs 771 */ 772 #define L2CAP_EVENT_CHANNEL_OPENED 0x70 773 774 /* 775 * @format 2 776 * @param local_cid 777 */ 778 #define L2CAP_EVENT_CHANNEL_CLOSED 0x71 779 780 /** 781 * @format BH222 782 * @param address 783 * @param handle 784 * @param psm 785 * @param local_cid 786 * @param remote_cid 787 */ 788 #define L2CAP_EVENT_INCOMING_CONNECTION 0x72 789 790 // ?? 791 // data: event(8), len(8), handle(16) 792 #define L2CAP_EVENT_TIMEOUT_CHECK 0x73 793 794 /** 795 * @format H2222 796 * @param handle 797 * @param interval_min 798 * @param interval_max 799 * @param latencey 800 * @param timeout_multiplier 801 */ 802 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 0x76 803 804 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail) 805 /** 806 * @format H2 807 * @param handle 808 * @param result 809 */ 810 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 0x77 811 812 /** 813 * @format 2 814 * @param local_cid 815 */ 816 #define L2CAP_EVENT_CAN_SEND_NOW 0x78 817 818 // LE Data Channels 819 820 /** 821 * @format 1BH2222 822 * @param address_type 823 * @param address 824 * @param handle 825 * @param psm 826 * @param local_cid 827 * @param remote_cid 828 * @param remote_mtu 829 */ 830 #define L2CAP_EVENT_LE_INCOMING_CONNECTION 0x79 831 832 /** 833 * @format 11BH122222 834 * @param status 835 * @param address_type 836 * @param address 837 * @param handle 838 * @param incoming 839 * @param psm 840 * @param local_cid 841 * @param remote_cid 842 * @param local_mtu 843 * @param remote_mtu 844 */ 845 #define L2CAP_EVENT_LE_CHANNEL_OPENED 0x7a 846 847 /* 848 * @format 2 849 * @param local_cid 850 */ 851 #define L2CAP_EVENT_LE_CHANNEL_CLOSED 0x7b 852 853 /* 854 * @format 2 855 * @param local_cid 856 */ 857 #define L2CAP_EVENT_LE_CAN_SEND_NOW 0x7c 858 859 /* 860 * @format 2 861 * @param local_cid 862 */ 863 #define L2CAP_EVENT_LE_PACKET_SENT 0x7d 864 865 /* 866 * @format 2 867 * @param local_cid 868 */ 869 #define L2CAP_EVENT_ERTM_BUFFER_RELEASED 0x7e 870 871 /* 872 * @format 873 */ 874 #define L2CAP_EVENT_TRIGGER_RUN 0x7f 875 876 877 // RFCOMM EVENTS 878 879 /** 880 * @format 1B21221 881 * @param status 882 * @param bd_addr 883 * @param con_handle 884 * @param server_channel 885 * @param rfcomm_cid 886 * @param max_frame_size 887 * @param incoming 888 */ 889 #define RFCOMM_EVENT_CHANNEL_OPENED 0x80 890 891 /** 892 * @format 2 893 * @param rfcomm_cid 894 */ 895 #define RFCOMM_EVENT_CHANNEL_CLOSED 0x81 896 897 /** 898 * @format B12 899 * @param bd_addr 900 * @param server_channel 901 * @param rfcomm_cid 902 */ 903 #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 904 905 /** 906 * @format 21 907 * @param rfcomm_cid 908 * @param line_status 909 */ 910 #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 911 912 /** 913 * @format 21 914 * @param rfcomm_cid 915 * @param modem_status 916 */ 917 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 918 919 /** 920 * TODO: format for variable data 2? 921 * param rfcomm_cid 922 * param rpn_data 923 */ 924 #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 925 926 /** 927 * @format 2 928 * @param rfcomm_cid 929 */ 930 #define RFCOMM_EVENT_CAN_SEND_NOW 0x89 931 932 933 /** 934 * @format 1 935 * @param status 936 */ 937 #define SDP_EVENT_QUERY_COMPLETE 0x91 938 939 /** 940 * @format 1T 941 * @param rfcomm_channel 942 * @param name 943 */ 944 #define SDP_EVENT_QUERY_RFCOMM_SERVICE 0x92 945 946 /** 947 * @format 22221 948 * @param record_id 949 * @param attribute_id 950 * @param attribute_length 951 * @param data_offset 952 * @param data 953 */ 954 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE 0x93 955 956 /** 957 * @format 22LV 958 * @param record_id 959 * @param attribute_id 960 * @param attribute_length 961 * @param attribute_value 962 */ 963 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE 0x94 964 965 /** 966 * @format 224 967 * @param total_count 968 * @param record_index 969 * @param record_handle 970 * @note Not provided by daemon, only used for internal testing 971 */ 972 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 0x95 973 974 /** 975 * @format H1 976 * @param handle 977 * @param att_status see ATT errors in bluetooth.h 978 */ 979 #define GATT_EVENT_QUERY_COMPLETE 0xA0 980 981 /** 982 * @format HX 983 * @param handle 984 * @param service 985 */ 986 #define GATT_EVENT_SERVICE_QUERY_RESULT 0xA1 987 988 /** 989 * @format HY 990 * @param handle 991 * @param characteristic 992 */ 993 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 0xA2 994 995 /** 996 * @format H2X 997 * @param handle 998 * @param include_handle 999 * @param service 1000 */ 1001 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 0xA3 1002 1003 /** 1004 * @format HZ 1005 * @param handle 1006 * @param characteristic_descriptor 1007 */ 1008 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 0xA4 1009 1010 /** 1011 * @format H2LV 1012 * @param handle 1013 * @param value_handle 1014 * @param value_length 1015 * @param value 1016 */ 1017 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA5 1018 1019 /** 1020 * @format H22LV 1021 * @param handle 1022 * @param value_handle 1023 * @param value_offset 1024 * @param value_length 1025 * @param value 1026 */ 1027 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA6 1028 1029 /** 1030 * @format H2LV 1031 * @param handle 1032 * @param value_handle 1033 * @param value_length 1034 * @param value 1035 */ 1036 #define GATT_EVENT_NOTIFICATION 0xA7 1037 1038 /** 1039 * @format H2LV 1040 * @param handle 1041 * @param value_handle 1042 * @param value_length 1043 * @param value 1044 */ 1045 #define GATT_EVENT_INDICATION 0xA8 1046 1047 /** 1048 * @format H2LV 1049 * @param handle 1050 * @param descriptor_handle 1051 * @param descriptor_length 1052 * @param descriptor 1053 */ 1054 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xA9 1055 1056 /** 1057 * @format H2LV 1058 * @param handle 1059 * @param descriptor_offset 1060 * @param descriptor_length 1061 * @param descriptor 1062 */ 1063 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xAA 1064 1065 /** 1066 * @format H2 1067 * @param handle 1068 * @param MTU 1069 */ 1070 #define GATT_EVENT_MTU 0xAB 1071 1072 /** 1073 * @format H 1074 * @param handle 1075 */ 1076 #define GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE 0xAC 1077 1078 /** 1079 * @format 1BH 1080 * @param address_type 1081 * @param address 1082 * @param handle 1083 */ 1084 #define ATT_EVENT_CONNECTED 0xB3 1085 1086 /** 1087 * @format H 1088 * @param handle 1089 */ 1090 #define ATT_EVENT_DISCONNECTED 0xB4 1091 1092 /** 1093 * @format H2 1094 * @param handle 1095 * @param MTU 1096 */ 1097 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE 0xB5 1098 1099 /** 1100 * @format 1H2 1101 * @param status 1102 * @param conn_handle 1103 * @param attribute_handle 1104 */ 1105 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 0xB6 1106 1107 /** 1108 * @format 1109 */ 1110 #define ATT_EVENT_CAN_SEND_NOW 0xB7 1111 1112 // TODO: daemon only event 1113 1114 /** 1115 * @format 12 1116 * @param status 1117 * @param service_uuid 1118 */ 1119 #define BNEP_EVENT_SERVICE_REGISTERED 0xC0 1120 1121 /** 1122 * @format 12222BH 1123 * @param status 1124 * @param bnep_cid 1125 * @param source_uuid 1126 * @param destination_uuid 1127 * @param mtu 1128 * @param remote_address 1129 * @param con_handle 1130 */ 1131 #define BNEP_EVENT_CHANNEL_OPENED 0xC1 1132 1133 /** 1134 * @format 222B 1135 * @param bnep_cid 1136 * @param source_uuid 1137 * @param destination_uuid 1138 * @param remote_address 1139 */ 1140 #define BNEP_EVENT_CHANNEL_CLOSED 0xC2 1141 1142 /** 1143 * @format 222B1 1144 * @param bnep_cid 1145 * @param source_uuid 1146 * @param destination_uuid 1147 * @param remote_address 1148 * @param channel_state 1149 */ 1150 #define BNEP_EVENT_CHANNEL_TIMEOUT 0xC3 1151 1152 /** 1153 * @format 222B 1154 * @param bnep_cid 1155 * @param source_uuid 1156 * @param destination_uuid 1157 * @param remote_address 1158 */ 1159 #define BNEP_EVENT_CAN_SEND_NOW 0xC4 1160 1161 /** 1162 * @format H1B 1163 * @param handle 1164 * @param addr_type 1165 * @param address 1166 */ 1167 #define SM_EVENT_JUST_WORKS_REQUEST 0xD0 1168 1169 /** 1170 * @format H1B 1171 * @param handle 1172 * @param addr_type 1173 * @param address 1174 */ 1175 #define SM_EVENT_JUST_WORKS_CANCEL 0xD1 1176 1177 /** 1178 * @format H1B4 1179 * @param handle 1180 * @param addr_type 1181 * @param address 1182 * @param passkey 1183 */ 1184 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER 0xD2 1185 1186 /** 1187 * @format H1B 1188 * @param handle 1189 * @param addr_type 1190 * @param address 1191 */ 1192 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL 0xD3 1193 1194 /** 1195 * @format H1B 1196 * @param handle 1197 * @param addr_type 1198 * @param address 1199 */ 1200 #define SM_EVENT_PASSKEY_INPUT_NUMBER 0xD4 1201 1202 /** 1203 * @format H1B 1204 * @param handle 1205 * @param addr_type 1206 * @param address 1207 */ 1208 #define SM_EVENT_PASSKEY_INPUT_CANCEL 0xD5 1209 1210 /** 1211 * @format H1B4 1212 * @param handle 1213 * @param addr_type 1214 * @param address 1215 * @param passkey 1216 */ 1217 #define SM_EVENT_NUMERIC_COMPARISON_REQUEST 0xD6 1218 1219 /** 1220 * @format H1B 1221 * @param handle 1222 * @param addr_type 1223 * @param address 1224 */ 1225 #define SM_EVENT_NUMERIC_COMPARISON_CANCEL 0xD7 1226 1227 /** 1228 * @format H1B 1229 * @param handle 1230 * @param addr_type 1231 * @param address 1232 */ 1233 #define SM_EVENT_IDENTITY_RESOLVING_STARTED 0xD8 1234 1235 /** 1236 * @format H1B 1237 * @param handle 1238 * @param addr_type 1239 * @param address 1240 */ 1241 #define SM_EVENT_IDENTITY_RESOLVING_FAILED 0xD9 1242 1243 /** 1244 * @brief Identify resolving succeeded 1245 * 1246 * @format H1B1B2 1247 * @param handle 1248 * @param addr_type 1249 * @param address 1250 * @param identity_addr_type 1251 * @param identity_address 1252 * @param index 1253 * 1254 */ 1255 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 0xDA 1256 1257 /** 1258 * @format H1B 1259 * @param handle 1260 * @param addr_type 1261 * @param address 1262 */ 1263 #define SM_EVENT_AUTHORIZATION_REQUEST 0xDB 1264 1265 /** 1266 * @format H1B1 1267 * @param handle 1268 * @param addr_type 1269 * @param address 1270 * @param authorization_result 1271 */ 1272 #define SM_EVENT_AUTHORIZATION_RESULT 0xDC 1273 1274 /** 1275 * @format H1 1276 * @param handle 1277 * @param action see SM_KEYPRESS_* 1278 */ 1279 #define SM_EVENT_KEYPRESS_NOTIFICATION 0xDD 1280 1281 /** 1282 * @brief Emitted during pairing to inform app about address used as identity 1283 * 1284 * @format H1B1B2 1285 * @param handle 1286 * @param addr_type 1287 * @param address 1288 * @param identity_addr_type 1289 * @param identity_address 1290 * @param index 1291 */ 1292 #define SM_EVENT_IDENTITY_CREATED 0xDE 1293 1294 /** 1295 * @brief Emitted to inform app that pairing is complete. Possible status values: 1296 * ERROR_CODE_SUCCESS -> pairing success 1297 * ERROR_CODE_CONNECTION_TIMEOUT -> timeout 1298 * ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION -> disconnect 1299 * ERROR_CODE_AUTHENTICATION_FAILURE -> SM protocol error, see reason field with SM_REASON_* from bluetooth.h 1300 * 1301 * @format H1B11 1302 * @param handle 1303 * @param addr_type 1304 * @param address 1305 * @param status 1306 * @param reason if status == ERROR_CODE_AUTHENTICATION_FAILURE 1307 */ 1308 #define SM_EVENT_PAIRING_COMPLETE 0xDF 1309 1310 1311 // GAP 1312 1313 /** 1314 * @format H1 1315 * @param handle 1316 * @param security_level 1317 */ 1318 #define GAP_EVENT_SECURITY_LEVEL 0xE0 1319 1320 /** 1321 * @format 1B 1322 * @param status 1323 * @param address 1324 */ 1325 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED 0xE1 1326 1327 /** 1328 * @format 11B1JV 1329 * @param advertising_event_type 1330 * @param address_type 1331 * @param address 1332 * @param rssi 1333 * @param data_length 1334 * @param data 1335 */ 1336 #define GAP_EVENT_ADVERTISING_REPORT 0xE2 1337 1338 /** 1339 * @format B132111JV 1340 * @param bd_addr 1341 * @param page_scan_repetition_mode 1342 * @param class_of_device 1343 * @param clock_offset 1344 * @param rssi_available 1345 * @param rssi 1346 * @param name_available 1347 * @param name_len 1348 * @param name 1349 */ 1350 #define GAP_EVENT_INQUIRY_RESULT 0xE3 1351 1352 /** 1353 * @format 1 1354 * @param status 1355 */ 1356 #define GAP_EVENT_INQUIRY_COMPLETE 0xE4 1357 1358 /** 1359 * @format H1 1360 * @param con_handle 1361 * @param rssi (signed integer -127..127) 1362 * @note Classic: rssi is in dB relative to Golden Receive Power Range 1363 * @note LE: rssi is absolute dBm 1364 */ 1365 #define GAP_EVENT_RSSI_MEASUREMENT 0xE5 1366 1367 // Meta Events, see below for sub events 1368 #define HCI_EVENT_HSP_META 0xE8 1369 #define HCI_EVENT_HFP_META 0xE9 1370 #define HCI_EVENT_ANCS_META 0xEA 1371 #define HCI_EVENT_AVDTP_META 0xEB 1372 #define HCI_EVENT_AVRCP_META 0xEC 1373 #define HCI_EVENT_GOEP_META 0xED 1374 #define HCI_EVENT_PBAP_META 0xEE 1375 #define HCI_EVENT_HID_META 0xEF 1376 #define HCI_EVENT_A2DP_META 0xF0 1377 #define HCI_EVENT_HIDS_META 0xF1 1378 #define HCI_EVENT_GATTSERVICE_META 0xF2 1379 #define HCI_EVENT_BIP_META 0xF3 1380 #define HCI_EVENT_MAP_META 0xF4 1381 #define HCI_EVENT_MESH_META 0xF5 1382 1383 // Potential other meta groups 1384 // #define HCI_EVENT_BNEP_META 0xxx 1385 // #define HCI_EVENT_GAP_META 0xxx 1386 // #define HCI_EVENT_GATT_META 0xxx 1387 // #define HCI_EVENT_PAN_META 0xxx 1388 // #define HCI_EVENT_SDP_META 0xxx 1389 // #define HCI_EVENT_SM_META 0xxx 1390 1391 1392 /** HSP Subevent */ 1393 1394 /** 1395 * @format 11 1396 * @param subevent_code 1397 * @param status 0 == OK 1398 */ 1399 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 0x01 1400 1401 /** 1402 * @format 11 1403 * @param subevent_code 1404 * @param status 0 == OK 1405 */ 1406 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 0x02 1407 1408 1409 /** 1410 * @format 11H 1411 * @param subevent_code 1412 * @param status 0 == OK 1413 * @param handle 1414 */ 1415 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x03 1416 1417 /** 1418 * @format 11 1419 * @param subevent_code 1420 * @param status 0 == OK 1421 */ 1422 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x04 1423 1424 /** 1425 * @format 1 1426 * @param subevent_code 1427 */ 1428 #define HSP_SUBEVENT_RING 0x05 1429 1430 /** 1431 * @format 11 1432 * @param subevent_code 1433 * @param gain Valid range: [0,15] 1434 */ 1435 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x06 1436 1437 /** 1438 * @format 11 1439 * @param subevent_code 1440 * @param gain Valid range: [0,15] 1441 */ 1442 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x07 1443 1444 /** 1445 * @format 1JV 1446 * @param subevent_code 1447 * @param value_length 1448 * @param value 1449 */ 1450 #define HSP_SUBEVENT_HS_COMMAND 0x08 1451 1452 /** 1453 * @format 1JV 1454 * @param subevent_code 1455 * @param value_length 1456 * @param value 1457 */ 1458 #define HSP_SUBEVENT_AG_INDICATION 0x09 1459 1460 1461 /** HFP Subevent */ 1462 1463 /** 1464 * @format 11HB 1465 * @param subevent_code 1466 * @param status 0 == OK 1467 * @param con_handle 1468 * @param bd_addr 1469 */ 1470 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 0x01 1471 1472 /** 1473 * @format 1 1474 * @param subevent_code 1475 */ 1476 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 1477 1478 /** 1479 * @format 11HB1 1480 * @param subevent_code 1481 * @param status 0 == OK 1482 * @param handle 1483 * @param bd_addr 1484 * @param negotiated_codec 1485 */ 1486 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 1487 1488 /** 1489 * @format 1 1490 * @param subevent_code 1491 */ 1492 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED 0x04 1493 1494 /** 1495 * @format 11 1496 * @param subevent_code 1497 * @param status 0 == OK 1498 */ 1499 #define HFP_SUBEVENT_COMPLETE 0x05 1500 1501 /** 1502 * @format 11111111T 1503 * @param subevent_code 1504 * @param indicator_index 1505 * @param indicator_status 1506 * @param indicator_min_range 1507 * @param indicator_max_range 1508 * @param indicator_mandatory 1509 * @param indicator_enabled 1510 * @param indicator_status_changed 1511 * @param indicator_name 1512 */ 1513 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 0x06 1514 1515 /** 1516 * @format 111T 1517 * @param subevent_code 1518 * @param network_operator_mode 1519 * @param network_operator_format 1520 * @param network_operator_name 1521 */ 1522 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 0x07 1523 1524 /** 1525 * @format 11 1526 * @param subevent_code 1527 * @param error 1528 */ 1529 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 0x08 1530 1531 /** 1532 * @format 1 1533 * @param subevent_code 1534 */ 1535 #define HFP_SUBEVENT_START_RINGINIG 0x0A 1536 1537 /** 1538 * @format 1 1539 * @param subevent_code 1540 */ 1541 #define HFP_SUBEVENT_STOP_RINGINIG 0x0B 1542 1543 /** 1544 * @format 1 1545 * @param subevent_code 1546 */ 1547 #define HFP_SUBEVENT_CALL_TERMINATED 0x0C 1548 1549 /** 1550 * @format 1T 1551 * @param subevent_code 1552 * @param number 1553 */ 1554 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 0x0D 1555 1556 /** 1557 * @format 1 1558 * @param subevent_code 1559 */ 1560 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG 0x0E 1561 1562 /** 1563 * @format 1T 1564 * @param subevent_code 1565 * @param number 1566 */ 1567 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 0x0F 1568 1569 /** 1570 * @format 1T 1571 * @param subevent_code 1572 * @param dtmf code 1573 */ 1574 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES 0x10 1575 1576 /** 1577 * @format 1 1578 * @param subevent_code 1579 */ 1580 #define HFP_SUBEVENT_CALL_ANSWERED 0x11 1581 1582 /** 1583 * @format 1 1584 * @param subevent_code 1585 */ 1586 #define HFP_SUBEVENT_CONFERENCE_CALL 0x12 1587 1588 /** 1589 * @format 1 1590 * @param subevent_code 1591 */ 1592 #define HFP_SUBEVENT_RING 0x13 1593 1594 /** 1595 * @format 11 1596 * @param subevent_code 1597 * @param gain 1598 */ 1599 #define HFP_SUBEVENT_SPEAKER_VOLUME 0x14 1600 1601 /** 1602 * @format 11 1603 * @param subevent_code 1604 * @param gain 1605 */ 1606 #define HFP_SUBEVENT_MICROPHONE_VOLUME 0x15 1607 1608 /** 1609 * @format 11T 1610 * @param subevent_code 1611 * @param type 1612 * @param number 1613 */ 1614 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 0x16 1615 1616 /** 1617 * @format 11T 1618 * @param subevent_code 1619 * @param type 1620 * @param number 1621 */ 1622 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17 1623 1624 /** 1625 * @format 1111111T 1626 * @param subevent_code 1627 * @param clcc_idx 1628 * @param clcc_dir 1629 * @param clcc_status 1630 * @param clcc_mode 1631 * @param clcc_mpty 1632 * @param bnip_type 1633 * @param bnip_number 1634 */ 1635 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS 0x18 1636 1637 /** 1638 * @format 111T 1639 * @param subevent_code 1640 * @param status 1641 * @param bnip_type 1642 * @param bnip_number 1643 */ 1644 #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 0x19 1645 1646 /** 1647 * @format 1T 1648 * @param subevent_code 1649 * @param value 1650 */ 1651 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 0x1A 1652 1653 // ANCS Client 1654 1655 /** 1656 * @format 1H 1657 * @param subevent_code 1658 * @param handle 1659 */ 1660 #define ANCS_SUBEVENT_CLIENT_CONNECTED 0xF0 1661 1662 /** 1663 * @format 1H2T 1664 * @param subevent_code 1665 * @param handle 1666 * @param attribute_id 1667 * @param text 1668 */ 1669 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION 0xF1 1670 1671 /** 1672 * @format 1H 1673 * @param subevent_code 1674 * @param handle 1675 */ 1676 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED 0xF2 1677 1678 1679 /** AVDTP Subevent */ 1680 1681 /** 1682 * @format 12111 1683 * @param subevent_code 1684 * @param avdtp_cid 1685 * @param local_seid 1686 * @param is_initiator 1687 * @param signal_identifier 1688 */ 1689 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT 0x01 1690 1691 /** 1692 * @format 12111 1693 * @param subevent_code 1694 * @param avdtp_cid 1695 * @param local_seid 1696 * @param is_initiator 1697 * @param signal_identifier 1698 */ 1699 #define AVDTP_SUBEVENT_SIGNALING_REJECT 0x02 1700 1701 /** 1702 * @format 12111 1703 * @param subevent_code 1704 * @param avdtp_cid 1705 * @param local_seid 1706 * @param is_initiator 1707 * @param signal_identifier 1708 */ 1709 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 0x03 1710 1711 /** 1712 * @format 12B1 1713 * @param subevent_code 1714 * @param avdtp_cid 1715 * @param bd_addr 1716 * @param status 0 == OK 1717 */ 1718 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 0x04 1719 1720 /** 1721 * @format 12 1722 * @param subevent_code 1723 * @param avdtp_cid 1724 */ 1725 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 0x05 1726 1727 /** 1728 * @format 121111 1729 * @param subevent_code 1730 * @param avdtp_cid 1731 * @param remote_seid 0x01 – 0x3E 1732 * @param in_use 0-not in use, 1-in use 1733 * @param media_type 0-audio, 1-video, 2-multimedia 1734 * @param sep_type 0-source, 1-sink 1735 */ 1736 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 0x06 1737 1738 /** 1739 * @format 121111111111 1740 * @param subevent_code 1741 * @param avdtp_cid 1742 * @param local_seid 1743 * @param remote_seid 1744 * @param media_type 1745 * @param sampling_frequency_bitmap 1746 * @param channel_mode_bitmap 1747 * @param block_length_bitmap 1748 * @param subbands_bitmap 1749 * @param allocation_method_bitmap 1750 * @param min_bitpool_value 1751 * @param max_bitpool_value 1752 */ 1753 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 0x07 1754 1755 /** 1756 * @format 121112LV 1757 * @param subevent_code 1758 * @param avdtp_cid 1759 * @param local_seid 1760 * @param remote_seid 1761 * @param media_type 1762 * @param media_codec_type 1763 * @param media_codec_information_len 1764 * @param media_codec_information 1765 */ 1766 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 0x08 1767 1768 1769 /** 1770 * @format 1211 1771 * @param subevent_code 1772 * @param avdtp_cid 1773 * @param local_seid 1774 * @param remote_seid 1775 */ 1776 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_TRANSPORT_CAPABILITY 0x09 1777 1778 1779 /** 1780 * @format 1211 1781 * @param subevent_code 1782 * @param avdtp_cid 1783 * @param local_seid 1784 * @param remote_seid 1785 */ 1786 #define AVDTP_SUBEVENT_SIGNALING_REPORTING_CAPABILITY 0x0A 1787 1788 1789 /** 1790 * @format 1211111 1791 * @param subevent_code 1792 * @param avdtp_cid 1793 * @param local_seid 1794 * @param remote_seid 1795 * @param recovery_type 1796 * @param maximum_recovery_window_size 1797 * @param maximum_number_media_packets 1798 */ 1799 #define AVDTP_SUBEVENT_SIGNALING_RECOVERY_CAPABILITY 0x0B 1800 1801 1802 /** 1803 * @format 12112LV 1804 * @param subevent_code 1805 * @param avdtp_cid 1806 * @param local_seid 1807 * @param remote_seid 1808 * @param cp_type 1809 * @param cp_type_value_len 1810 * @param cp_type_value 1811 */ 1812 #define AVDTP_SUBEVENT_SIGNALING_CONTENT_PROTECTION_CAPABILITY 0x0C 1813 1814 1815 /** 1816 * @format 121111111111 1817 * @param subevent_code 1818 * @param avdtp_cid 1819 * @param local_seid 1820 * @param remote_seid 1821 * @param fragmentation 1822 * @param transport_identifiers_num 1823 * @param transport_session_identifier_1 1824 * @param transport_session_identifier_2 1825 * @param transport_session_identifier_3 1826 * @param tcid_1 1827 * @param tcid_2 1828 * @param tcid_3 1829 */ 1830 #define AVDTP_SUBEVENT_SIGNALING_MULTIPLEXING_CAPABILITY 0x0D 1831 1832 1833 /** 1834 * @format 1211 1835 * @param subevent_code 1836 * @param avdtp_cid 1837 * @param local_seid 1838 * @param remote_seid 1839 */ 1840 #define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORTING_CAPABILITY 0x0E 1841 1842 1843 /** 1844 * @format 1211111 1845 * @param subevent_code 1846 * @param avdtp_cid 1847 * @param local_seid 1848 * @param remote_seid 1849 * @param back_ch 1850 * @param media 1851 * @param recovery 1852 */ 1853 #define AVDTP_SUBEVENT_SIGNALING_HEADER_COMPRESSION_CAPABILITY 0x0F 1854 1855 1856 /** 1857 * @format 12111121111111 1858 * @param subevent_code 1859 * @param avdtp_cid 1860 * @param local_seid 1861 * @param remote_seid 1862 * @param reconfigure 1863 * @param media_type 1864 * @param sampling_frequency 1865 * @param channel_mode 1866 * @param num_channels 1867 * @param block_length 1868 * @param subbands 1869 * @param allocation_method 1870 * @param min_bitpool_value 1871 * @param max_bitpool_value 1872 */ 1873 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x10 1874 1875 /** 1876 * @format 1211112LV 1877 * @param subevent_code 1878 * @param avdtp_cid 1879 * @param local_seid 1880 * @param remote_seid 1881 * @param reconfigure 1882 * @param media_type 1883 * @param media_codec_type 1884 * @param media_codec_information_len 1885 * @param media_codec_information 1886 */ 1887 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x11 1888 1889 /** 1890 * @format 12B111 1891 * @param subevent_code 1892 * @param avdtp_cid 1893 * @param bd_addr 1894 * @param local_seid 1895 * @param remote_seid 1896 * @param status 0 == OK 1897 */ 1898 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 0x12 1899 1900 /** 1901 * @format 121 1902 * @param subevent_code 1903 * @param avdtp_cid 1904 * @param local_seid 1905 */ 1906 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED 0x13 1907 1908 /** 1909 * @format 1212 1910 * @param subevent_code 1911 * @param avdtp_cid 1912 * @param local_seid 1913 * @param sequence_number 1914 */ 1915 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x14 1916 1917 /** 1918 * @format 1211 1919 * @param subevent_code 1920 * @param avdtp_cid 1921 * @param local_seid 1922 * @param remote_seid 1923 */ 1924 #define AVDTP_SUBEVENT_SIGNALING_CAPABILITIES_DONE 0x15 1925 1926 1927 /** 1928 * @format 12 1929 * @param subevent_code 1930 * @param avdtp_cid 1931 */ 1932 #define AVDTP_SUBEVENT_SIGNALING_SEP_DICOVERY_DONE 0x16 1933 1934 /** 1935 * @format 1212 1936 * @param subevent_code 1937 * @param avdtp_cid 1938 * @param local_seid 1939 * @param delay_100us 1940 */ 1941 #define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT 0x17 1942 1943 /** A2DP Subevent */ 1944 /* Stream goes through following states: 1945 * - OPEN - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event 1946 * - START - indicated with A2DP_SUBEVENT_STREAM_STARTED event 1947 * - SUSPEND - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event 1948 * - ABORT/STOP - indicated with A2DP_SUBEVENT_STREAM_RELEASED event 1949 1950 OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started. 1951 START can come only after the stream is OPENED, and indicates that media transfer is started. 1952 SUSPEND is optional, it pauses the stream. 1953 */ 1954 1955 /** 1956 * @format 121 Sent only by A2DP source. 1957 * @param subevent_code 1958 * @param a2dp_cid 1959 * @param local_seid 1960 */ 1961 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 0x01 1962 1963 /** 1964 * @format 12111121111111 1965 * @param subevent_code 1966 * @param a2dp_cid 1967 * @param int_seid 1968 * @param acp_seid 1969 * @param reconfigure 1970 * @param media_type 1971 * @param sampling_frequency 1972 * @param channel_mode 1973 * @param num_channels 1974 * @param block_length 1975 * @param subbands 1976 * @param allocation_method 1977 * @param min_bitpool_value 1978 * @param max_bitpool_value 1979 */ 1980 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 0x02 1981 1982 /** 1983 * @format 1211112LV 1984 * @param subevent_code 1985 * @param a2dp_cid 1986 * @param int_seid 1987 * @param acp_seid 1988 * @param reconfigure 1989 * @param media_type 1990 * @param media_codec_type 1991 * @param media_codec_information_len 1992 * @param media_codec_information 1993 */ 1994 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 0x03 1995 1996 /** 1997 * @format 12B111 Stream is opened byt not started. 1998 * @param subevent_code 1999 * @param a2dp_cid 2000 * @param bd_addr 2001 * @param local_seid 2002 * @param remote_seid 2003 * @param status 2004 */ 2005 #define A2DP_SUBEVENT_STREAM_ESTABLISHED 0x04 2006 2007 /** 2008 * @format 121 Indicates that media transfer is started. 2009 * @param subevent_code 2010 * @param a2dp_cid 2011 * @param local_seid 2012 */ 2013 #define A2DP_SUBEVENT_STREAM_STARTED 0x05 2014 2015 /** 2016 * @format 121 Stream is paused. 2017 * @param subevent_code 2018 * @param a2dp_cid 2019 * @param local_seid 2020 */ 2021 #define A2DP_SUBEVENT_STREAM_SUSPENDED 0x06 2022 2023 /** 2024 * @format 121 Stream is stoped or aborted. 2025 * @param subevent_code 2026 * @param a2dp_cid 2027 * @param local_seid 2028 */ 2029 #define A2DP_SUBEVENT_STREAM_STOPPED 0x07 2030 2031 /** 2032 * @format 121 Stream is released. 2033 * @param subevent_code 2034 * @param a2dp_cid 2035 * @param local_seid 2036 */ 2037 #define A2DP_SUBEVENT_STREAM_RELEASED 0x08 2038 2039 /** 2040 * @format 1211 2041 * @param subevent_code 2042 * @param a2dp_cid 2043 * @param local_seid 2044 * @param signal_identifier 2045 */ 2046 #define A2DP_SUBEVENT_COMMAND_ACCEPTED 0x09 2047 2048 /** 2049 * @format 1211 2050 * @param subevent_code 2051 * @param a2dp_cid 2052 * @param local_seid 2053 * @param signal_identifier 2054 */ 2055 #define A2DP_SUBEVENT_COMMAND_REJECTED 0x0A 2056 2057 /** 2058 * @format 12B1 2059 * @param subevent_code 2060 * @param a2dp_cid 2061 * @param bd_addr 2062 * @param status 0 == OK 2063 */ 2064 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 0x0B 2065 2066 /** 2067 * @format 12 Signaling channel is released. 2068 * @param subevent_code 2069 * @param a2dp_cid 2070 */ 2071 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 0x0C 2072 2073 /** 2074 * @format 1211 Stream was reconfigured 2075 * @param subevent_code 2076 * @param a2dp_cid 2077 * @param local_seid 2078 * @param status 2079 */ 2080 #define A2DP_SUBEVENT_STREAM_RECONFIGURED 0x0D 2081 2082 /** 2083 * @format 1211 2084 * @param subevent_code 2085 * @param avdtp_cid 2086 * @param local_seid 2087 * @param remote_seid 2088 */ 2089 #define A2DP_SUBEVENT_SIGNALING_DELAY_REPORTING_CAPABILITY 0x0E 2090 2091 2092 /** 2093 * @format 1212 2094 * @param subevent_code 2095 * @param avdtp_cid 2096 * @param local_seid 2097 * @param delay_100us 2098 */ 2099 #define A2DP_SUBEVENT_SIGNALING_DELAY_REPORT 0x0F 2100 2101 /** 2102 * @format 1211 2103 * @param subevent_code 2104 * @param avdtp_cid 2105 * @param local_seid 2106 * @param remote_seid 2107 */ 2108 #define A2DP_SUBEVENT_SIGNALING_CAPABILITIES_DONE 0x10 2109 2110 /** AVRCP Subevent */ 2111 2112 /** 2113 * @format 11B2 2114 * @param subevent_code 2115 * @param status 0 == OK 2116 * @param bd_addr 2117 * @param avrcp_cid 2118 */ 2119 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 0x01 2120 2121 /** 2122 * @format 12 2123 * @param subevent_code 2124 * @param avrcp_cid 2125 */ 2126 #define AVRCP_SUBEVENT_CONNECTION_RELEASED 0x02 2127 2128 /** 2129 * @format 12111 2130 * @param subevent_code 2131 * @param avrcp_cid 2132 * @param command_type 2133 * @param repeat_mode 2134 * @param shuffle_mode 2135 */ 2136 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 0x03 2137 2138 /** 2139 * @format 121441 2140 * @param subevent_code 2141 * @param avrcp_cid 2142 * @param command_type 2143 * @param song_length 2144 * @param song_position 2145 * @param play_status 2146 */ 2147 #define AVRCP_SUBEVENT_PLAY_STATUS 0x04 2148 2149 /** 2150 * @format 1211 2151 * @param subevent_code 2152 * @param avrcp_cid 2153 * @param command_type 2154 * @param play_status 2155 */ 2156 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 0x05 2157 2158 /** 2159 * @format 121 2160 * @param subevent_code 2161 * @param avrcp_cid 2162 * @param command_type 2163 */ 2164 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 0x06 2165 2166 /** 2167 * @format 121 2168 * @param subevent_code 2169 * @param avrcp_cid 2170 * @param command_type 2171 */ 2172 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 0x07 2173 2174 /** 2175 * @format 121 2176 * @param subevent_code 2177 * @param avrcp_cid 2178 * @param command_type 2179 */ 2180 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 0x08 2181 2182 /** 2183 * @format 1211 2184 * @param subevent_code 2185 * @param avrcp_cid 2186 * @param command_type 2187 * @param absolute_volume 2188 */ 2189 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 0x09 2190 2191 /** 2192 * @format 1211 2193 * @param subevent_code 2194 * @param avrcp_cid 2195 * @param command_type 2196 * @param absolute_volume 2197 */ 2198 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 0x0A 2199 2200 /** 2201 * @format 1211 2202 * @param subevent_code 2203 * @param avrcp_cid 2204 * @param command_type 2205 * @param notification_id 2206 */ 2207 #define AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 0x0B 2208 2209 /** 2210 * @format 1211 2211 * @param subevent_code 2212 * @param avrcp_cid 2213 * @param command_type 2214 * @param operation_id 2215 */ 2216 #define AVRCP_SUBEVENT_OPERATION_START 0x0C 2217 2218 /** 2219 * @format 1211 2220 * @param subevent_code 2221 * @param avrcp_cid 2222 * @param command_type 2223 * @param operation_id 2224 */ 2225 #define AVRCP_SUBEVENT_OPERATION_COMPLETE 0x0D 2226 2227 /** 2228 * @format 121 2229 * @param subevent_code 2230 * @param avrcp_cid 2231 * @param command_type 2232 */ 2233 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 0x0E 2234 2235 /** 2236 * @format 12 2237 * @param subevent_code 2238 * @param avrcp_cid 2239 */ 2240 #define AVRCP_SUBEVENT_COMPANY_IDS_QUERY 0x0F 2241 2242 /** 2243 * @format 12 2244 * @param subevent_code 2245 * @param avrcp_cid 2246 */ 2247 #define AVRCP_SUBEVENT_EVENT_IDS_QUERY 0x10 2248 2249 /** 2250 * @format 12 2251 * @param subevent_code 2252 * @param avrcp_cid 2253 */ 2254 #define AVRCP_SUBEVENT_PLAY_STATUS_QUERY 0x11 2255 2256 /** 2257 * @format 12111 2258 * @param subevent_code 2259 * @param avrcp_cid 2260 * @param operation_id 2261 * @param operands_length 2262 * @param operand 2263 */ 2264 #define AVRCP_SUBEVENT_OPERATION 0x12 2265 2266 /** 2267 * @format 1211 2268 * @param subevent_code 2269 * @param avrcp_cid 2270 * @param command_type 2271 * @param track 2272 */ 2273 #define AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO 0x13 2274 2275 /** 2276 * @format 1211 2277 * @param subevent_code 2278 * @param avrcp_cid 2279 * @param command_type 2280 * @param total_tracks 2281 */ 2282 #define AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO 0x14 2283 2284 /** 2285 * @format 1214 2286 * @param subevent_code 2287 * @param avrcp_cid 2288 * @param command_type 2289 * @param song_length in ms 2290 */ 2291 #define AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO 0x15 2292 2293 /** 2294 * @format 121JV 2295 * @param subevent_code 2296 * @param avrcp_cid 2297 * @param command_type 2298 * @param value_len 2299 * @param value 2300 */ 2301 #define AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO 0x16 2302 2303 /* 2304 * @format 121JV 2305 * @param subevent_code 2306 * @param avrcp_cid 2307 * @param command_type 2308 * @param value_len 2309 * @param value 2310 */ 2311 #define AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO 0x17 2312 2313 /* 2314 * @format 121JV 2315 * @param subevent_code 2316 * @param avrcp_cid 2317 * @param command_type 2318 * @param value_len 2319 * @param value 2320 */ 2321 #define AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO 0x18 2322 2323 /* 2324 * @format 121JV 2325 * @param subevent_code 2326 * @param avrcp_cid 2327 * @param command_type 2328 * @param value_len 2329 * @param value 2330 */ 2331 #define AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO 0x19 2332 2333 /* 2334 * @format 1211 2335 * @param subevent_code 2336 * @param avrcp_cid 2337 * @param command_type 2338 * @param status 2339 */ 2340 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE 0x1A 2341 2342 /** 2343 * @format 1B2 2344 * @param subevent_code 2345 * @param bd_addr 2346 * @param browsing_cid 2347 */ 2348 #define AVRCP_SUBEVENT_INCOMING_BROWSING_CONNECTION 0x1B 2349 2350 /** 2351 * @format 11B2 2352 * @param subevent_code 2353 * @param status 0 == OK 2354 * @param bd_addr 2355 * @param browsing_cid 2356 */ 2357 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_ESTABLISHED 0x1C 2358 2359 /** 2360 * @format 12 2361 * @param subevent_code 2362 * @param browsing_cid 2363 */ 2364 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_RELEASED 0x1D 2365 2366 /** 2367 * @format 12211 2368 * @param subevent_code 2369 * @param browsing_cid 2370 * @param uid_counter 2371 * @param browsing_status 2372 * @param bluetooth_status 2373 */ 2374 #define AVRCP_SUBEVENT_BROWSING_DONE 0x1E 2375 2376 /** 2377 * @format 1214 2378 * @param subevent_code 2379 * @param browsing_cid 2380 * @param scope 2381 * @param attr_bitmap 2382 */ 2383 #define AVRCP_SUBEVENT_BROWSING_GET_FOLDER_ITEMS 0x1F 2384 2385 /** 2386 * @format 121 2387 * @param subevent_code 2388 * @param browsing_cid 2389 * @param scope 2390 */ 2391 #define AVRCP_SUBEVENT_BROWSING_GET_TOTAL_NUM_ITEMS 0x20 2392 2393 /** 2394 * @format 1214 2395 * @param subevent_code 2396 * @param avrcp_cid 2397 * @param command_type 2398 * @param playback_position_ms 2399 */ 2400 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_POS_CHANGED 0x21 2401 2402 2403 /** 2404 * @format 121BH1 2405 * @param subevent_code 2406 * @param goep_cid 2407 * @param status 2408 * @param bd_addr 2409 * @param con_handle 2410 * @param incoming 2411 */ 2412 #define GOEP_SUBEVENT_CONNECTION_OPENED 0x01 2413 2414 /** 2415 * @format 12 2416 * @param subevent_code 2417 * @param goep_cid 2418 */ 2419 #define GOEP_SUBEVENT_CONNECTION_CLOSED 0x02 2420 2421 /** 2422 * @format 12 2423 * @param subevent_code 2424 * @param goep_cid 2425 */ 2426 #define GOEP_SUBEVENT_CAN_SEND_NOW 0x03 2427 2428 /** 2429 * @format 121BH1 2430 * @param subevent_code 2431 * @param pbap_cid 2432 * @param status 2433 * @param bd_addr 2434 * @param con_handle 2435 * @param incoming 2436 */ 2437 #define PBAP_SUBEVENT_CONNECTION_OPENED 0x01 2438 2439 /** 2440 * @format 12 2441 * @param subevent_code 2442 * @param goep_cid 2443 */ 2444 #define PBAP_SUBEVENT_CONNECTION_CLOSED 0x02 2445 2446 /** 2447 * @format 121 2448 * @param subevent_code 2449 * @param goep_cid 2450 * @param status 2451 */ 2452 #define PBAP_SUBEVENT_OPERATION_COMPLETED 0x03 2453 2454 /** 2455 * @format 1212 2456 * @param subevent_code 2457 * @param goep_cid 2458 * @param status 2459 * @param phoneboook_size 2460 */ 2461 #define PBAP_SUBEVENT_PHONEBOOK_SIZE 0x04 2462 2463 /** 2464 * @format 1211 2465 * @param subevent_code 2466 * @param goep_cid 2467 * @param user_id_required 2468 * @param full_access 2469 */ 2470 #define PBAP_SUBEVENT_AUTHENTICATION_REQUEST 0x05 2471 2472 /** 2473 * @format 12JVJV 2474 * @param subevent_code 2475 * @param goep_cid 2476 * @param name_len 2477 * @param name 2478 * @param handle_len 2479 * @param handle 2480 */ 2481 #define PBAP_SUBEVENT_CARD_RESULT 0x06 2482 2483 2484 // HID Meta Event Group 2485 2486 /** 2487 * @format 121BH1 2488 * @param subevent_code 2489 * @param hid_cid 2490 * @param status 2491 * @param bd_addr 2492 * @param con_handle 2493 * @param incoming 2494 */ 2495 #define HID_SUBEVENT_CONNECTION_OPENED 0x01 2496 2497 /** 2498 * @format 12 2499 * @param subevent_code 2500 * @param hid_cid 2501 */ 2502 #define HID_SUBEVENT_CONNECTION_CLOSED 0x02 2503 2504 /** 2505 * @format 12 2506 * @param subevent_code 2507 * @param hid_cid 2508 */ 2509 #define HID_SUBEVENT_CAN_SEND_NOW 0x03 2510 2511 /** 2512 * @format 12 2513 * @param subevent_code 2514 * @param con_handle 2515 */ 2516 #define HID_SUBEVENT_SUSPEND 0x04 2517 2518 /** 2519 * @format 12 2520 * @param subevent_code 2521 * @param con_handle 2522 */ 2523 #define HID_SUBEVENT_EXIT_SUSPEND 0x05 2524 2525 2526 // HIDS Meta Event Group 2527 2528 /** 2529 * @format 12 2530 * @param subevent_code 2531 * @param con_handle 2532 */ 2533 #define HIDS_SUBEVENT_CAN_SEND_NOW 0x01 2534 2535 /** 2536 * @format 121 2537 * @param subevent_code 2538 * @param con_handle 2539 * @param protocol_mode 2540 */ 2541 #define HIDS_SUBEVENT_PROTOCOL_MODE 0x02 2542 2543 /** 2544 * @format 121 2545 * @param subevent_code 2546 * @param con_handle 2547 * @param enable 2548 */ 2549 #define HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE 0x03 2550 2551 /** 2552 * @format 121 2553 * @param subevent_code 2554 * @param con_handle 2555 * @param enable 2556 */ 2557 #define HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE 0x04 2558 2559 /** 2560 * @format 121 2561 * @param subevent_code 2562 * @param con_handle 2563 * @param enable 2564 */ 2565 #define HIDS_SUBEVENT_INPUT_REPORT_ENABLE 0x05 2566 2567 /** 2568 * @format 121 2569 * @param subevent_code 2570 * @param con_handle 2571 * @param enable 2572 */ 2573 #define HIDS_SUBEVENT_OUTPUT_REPORT_ENABLE 0x06 2574 2575 /** 2576 * @format 121 2577 * @param subevent_code 2578 * @param con_handle 2579 * @param enable 2580 */ 2581 #define HIDS_SUBEVENT_FEATURE_REPORT_ENABLE 0x07 2582 2583 /** 2584 * @format 12 2585 * @param subevent_code 2586 * @param con_handle 2587 */ 2588 #define HIDS_SUBEVENT_SUSPEND 0x08 2589 2590 /** 2591 * @format 12 2592 * @param subevent_code 2593 * @param con_handle 2594 */ 2595 #define HIDS_SUBEVENT_EXIT_SUSPEND 0x09 2596 2597 /** 2598 * @format 1211 2599 * @param subevent_code 2600 * @param con_handle 2601 * @param measurement_type 0 - force magnitude, 1 - torque magnitude, see cycling_power_sensor_measurement_context_t 2602 * @param is_enhanced 2603 */ 2604 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_START_CALIBRATION 0x01 2605 2606 /** 2607 * @format 12 2608 * @param subevent_code 2609 * @param con_handle 2610 */ 2611 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_BROADCAST_START 0x02 2612 2613 /** 2614 * @format 12 2615 * @param subevent_code 2616 * @param con_handle 2617 */ 2618 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_BROADCAST_STOP 0x03 2619 2620 2621 // MAP Meta Event Group 2622 2623 /** 2624 * @format 121BH1 2625 * @param subevent_code 2626 * @param map_cid 2627 * @param status 2628 * @param bd_addr 2629 * @param con_handle 2630 * @param incoming 2631 */ 2632 #define MAP_SUBEVENT_CONNECTION_OPENED 0x01 2633 2634 /** 2635 * @format 12 2636 * @param subevent_code 2637 * @param map_cid 2638 */ 2639 #define MAP_SUBEVENT_CONNECTION_CLOSED 0x02 2640 2641 /** 2642 * @format 121 2643 * @param subevent_code 2644 * @param map_cid 2645 * @param status 2646 */ 2647 #define MAP_SUBEVENT_OPERATION_COMPLETED 0x03 2648 2649 2650 /** 2651 * @format 12LV 2652 * @param subevent_code 2653 * @param map_cid 2654 * @param name_len 2655 * @param name 2656 */ 2657 #define MAP_SUBEVENT_FOLDER_LISTING_ITEM 0x04 2658 2659 /** 2660 * @format 12D 2661 * @param subevent_code 2662 * @param map_cid 2663 * @param handle 2664 2665 */ 2666 #define MAP_SUBEVENT_MESSAGE_LISTING_ITEM 0x05 2667 2668 /** 2669 * @format 12 2670 * @param subevent_code 2671 * @param map_cid 2672 */ 2673 #define MAP_SUBEVENT_PARSING_DONE 0x06 2674 2675 2676 // MESH Meta Event Group 2677 2678 /** 2679 * @format 1 2680 * @param subevent_code 2681 */ 2682 #define MESH_SUBEVENT_CAN_SEND_NOW 0x01 2683 2684 /** 2685 * @format 11 2686 * @param subevent_code 2687 * @param status 2688 */ 2689 #define MESH_SUBEVENT_PB_TRANSPORT_PDU_SENT 0x02 2690 2691 /** 2692 * @format 1121 2693 * @param subevent_code 2694 * @param status 2695 * @param pb_transport_cid 2696 * @param pb_type 2697 */ 2698 #define MESH_SUBEVENT_PB_TRANSPORT_LINK_OPEN 0x03 2699 2700 /** 2701 * @format 112 2702 * @param subevent_code 2703 * @param pb_transport_cid 2704 * @param reason 2705 */ 2706 #define MESH_SUBEVENT_PB_TRANSPORT_LINK_CLOSED 0x04 2707 2708 /** 2709 * @format 121 2710 * @param subevent_code 2711 * @param pb_transport_cid 2712 * @param attention_time in seconds 2713 */ 2714 #define MESH_SUBEVENT_PB_PROV_ATTENTION_TIMER 0x10 2715 2716 /** 2717 * Device Role 2718 * @format 12 2719 * @param subevent_code 2720 * @param pb_transport_cid 2721 */ 2722 #define MESH_SUBEVENT_PB_PROV_START_EMIT_PUBLIC_KEY_OOB 0x11 2723 2724 /** 2725 * Device Role 2726 * @format 12 2727 * @param subevent_code 2728 * @param pb_transport_cid 2729 */ 2730 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_PUBLIC_KEY_OOB 0x12 2731 2732 /** 2733 * Device Role 2734 * @format 12 2735 * @param subevent_code 2736 * @param pb_transport_cid 2737 */ 2738 #define MESH_SUBEVENT_PB_PROV_INPUT_OOB_REQUEST 0x13 2739 2740 /** 2741 * Device Role 2742 * @format 124 2743 * @param subevent_code 2744 * @param pb_transport_cid 2745 * @param output_oob number 2746 */ 2747 #define MESH_SUBEVENT_PB_PROV_START_EMIT_OUTPUT_OOB 0x15 2748 2749 /** 2750 * Device Role 2751 * @format 12 2752 * @param subevent_code 2753 * @param pb_transport_cid 2754 */ 2755 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_OUTPUT_OOB 0x16 2756 2757 /** 2758 * Provisioner Role 2759 * @format 12 2760 * @param subevent_code 2761 * @param pb_transport_cid 2762 */ 2763 #define MESH_SUBEVENT_PB_PROV_START_RECEIVE_PUBLIC_KEY_OOB 0x17 2764 2765 /** 2766 * Provisioner Role 2767 * @format 12 2768 * @param subevent_code 2769 * @param pb_transport_cid 2770 */ 2771 #define MESH_SUBEVENT_PB_PROV_STOP_RECEIVE_PUBLIC_KEY_OOB 0x18 2772 2773 /** 2774 * Provisioner Role 2775 * @format 12 2776 * @param subevent_code 2777 * @param pb_transport_cid 2778 */ 2779 #define MESH_SUBEVENT_PB_PROV_OUTPUT_OOB_REQUEST 0x19 2780 2781 /** 2782 * Provisioner Role 2783 * @format 124 2784 * @param subevent_code 2785 * @param pb_transport_cid 2786 * @param output_oob number 2787 */ 2788 #define MESH_SUBEVENT_PB_PROV_START_EMIT_INPUT_OOB 0x1a 2789 2790 /** 2791 * Provisioner Role 2792 * @format 12 2793 * @param subevent_code 2794 * @param pb_transport_cid 2795 */ 2796 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_INPUT_OOB 0x1b 2797 2798 /** 2799 * Provisioner Role 2800 * @format 1212111212 2801 * @param subevent_code 2802 * @param pb_transport_cid 2803 * @param num_elements 2804 * @param algorithms 2805 * @param public_key 2806 * @param static_oob_type 2807 * @param output_oob_size 2808 * @param output_oob_action 2809 * @param input_oob_size 2810 * @param input_oob_action 2811 */ 2812 #define MESH_SUBEVENT_PB_PROV_CAPABILITIES 0x1c 2813 2814 /** 2815 * @format 12 2816 * @param subevent_code 2817 * @param pb_transport_cid 2818 */ 2819 #define MESH_SUBEVENT_PB_PROV_COMPLETE 0x1d 2820 2821 /** 2822 * @format 11 2823 * @param subevent_code 2824 * @param attention_time in seconds 2825 */ 2826 #define MESH_SUBEVENT_ATTENTION_TIMER 0x1e 2827 2828 /** 2829 * @format 1H 2830 * @param subevent_code 2831 * @param con_handle 2832 */ 2833 #define MESH_SUBEVENT_PROXY_CONNECTED 0x20 2834 2835 /** 2836 * @format 1H 2837 * @param subevent_code 2838 * @param con_handle 2839 */ 2840 #define MESH_SUBEVENT_PROXY_PDU_SENT 0x21 2841 2842 /** 2843 * @format 1H 2844 * @param subevent_code 2845 * @param con_handle 2846 */ 2847 #define MESH_SUBEVENT_PROXY_DISCONNECTED 0x22 2848 2849 /** 2850 * @format 1H 2851 * @param subevent_code 2852 * @param con_handle 2853 */ 2854 #define MESH_SUBEVENT_MESSAGE_SENT 0x23 2855 2856 /** 2857 * @format 114411 2858 * @param subevent_code 2859 * @param element_index 2860 * @param model_identifier 2861 * @param state_identifier 2862 * @param reason 2863 * @param value 2864 */ 2865 #define MESH_SUBEVENT_STATE_UPDATE_BOOL 0x24 2866 2867 /** 2868 * @format 114412 2869 * @param subevent_code 2870 * @param element_index 2871 * @param model_identifier 2872 * @param state_identifier 2873 * @param reason 2874 * @param value 2875 */ 2876 #define MESH_SUBEVENT_STATE_UPDATE_INT16 0x25 2877 2878 // Mesh Client Events 2879 /** 2880 * @format 11442 2881 * @param subevent_code 2882 * @param element_index 2883 * @param model_identifier 2884 * @param opcode 2885 * @param dest 2886 */ 2887 #define MESH_SUBEVENT_MESSAGE_NOT_ACKNOWLEDGED 0x30 2888 2889 /** 2890 * @format 121114 2891 * @param subevent_code 2892 * @param dest 2893 * @param status 2894 * @param present_value 2895 * @param target_value optional, if value > 0, than remaining_time_ms must be read 2896 * @param remaining_time_ms 2897 */ 2898 #define MESH_SUBEVENT_GENERIC_ON_OFF 0x31 2899 2900 /** 2901 * @format 121224 2902 * @param subevent_code 2903 * @param dest 2904 * @param status 2905 * @param present_value 2906 * @param target_value optional, if value > 0, than remaining_time_ms must be read 2907 * @param remaining_time_ms 2908 */ 2909 #define MESH_SUBEVENT_GENERIC_LEVEL 0x32 2910 2911 /** 2912 * @format 1222211 2913 * @param subevent_code 2914 * @param dest 2915 * @param netkey_index 2916 * @param appkey_index 2917 * @param company_id 2918 * @param test_id 2919 * @param acknowledged 2920 */ 2921 #define MESH_SUBEVENT_HEALTH_PERFORM_TEST 0x33 2922 2923 /** 2924 * @format 11 2925 * @param subevent_code 2926 * @param element_index 2927 */ 2928 #define MESH_SUBEVENT_HEALTH_ATTENTION_TIMER_CHANGED 0x34 2929 2930 /** 2931 * @format 1211 2932 * @param subevent_code 2933 * @param dest 2934 * @param status 2935 * @param transition_time_gdtt 2936 */ 2937 #define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME 0x35 2938 2939 /** 2940 * @format 1211 2941 * @param subevent_code 2942 * @param dest 2943 * @param foundation_status 2944 * @param secure_network_beacon_state 2945 */ 2946 #define MESH_SUBEVENT_CONFIGURATION_BEACON 0x36 2947 2948 // Composition Data has variable of element descriptions, with two lists of model lists 2949 // Use .. getters to access data 2950 #define MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 0x37 2951 2952 /** 2953 * @format 1211 2954 * @param subevent_code 2955 * @param dest 2956 * @param foundation_status 2957 * @param default_ttl 2958 */ 2959 #define MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL 0x38 2960 2961 /** 2962 * @format 1211 2963 * @param subevent_code 2964 * @param dest 2965 * @param foundation_status 2966 * @param gatt_proxy_state 2967 */ 2968 #define MESH_SUBEVENT_CONFIGURATION_GATT_PROXY 0x39 2969 2970 /** 2971 * @format 121111 2972 * @param subevent_code 2973 * @param dest 2974 * @param foundation_status 2975 * @param relay 2976 * @param retransmit_count the number of times that packet is transmitted for each packet that is relayed. 2977 * @param retransmit_interval_ms retransmission interval in ms 2978 */ 2979 #define MESH_SUBEVENT_CONFIGURATION_RELAY 0x40 2980 2981 2982 /** 2983 * @format 12122111114 2984 * @param subevent_code 2985 * @param dest element_address 2986 * @param foundation_status 2987 * @param publish_address 2988 * @param appkey_index 2989 * @param credential_flag 2990 * @param publish_ttl 2991 * @param publish_period 2992 * @param publish_retransmit_count 2993 * @param publish_retransmit_interval_steps 2994 * @param model_identifier 2995 */ 2996 #define MESH_SUBEVENT_CONFIGURATION_MODEL_PUBLICATION 0x41 2997 2998 /** 2999 * @format 12124 3000 * @param subevent_code 3001 * @param dest 3002 * @param foundation_status 3003 * @param address 3004 * @param model_identifier 3005 */ 3006 #define MESH_SUBEVENT_CONFIGURATION_MODEL_SUBSCRIPTION 0x42 3007 3008 /** 3009 * @format 1214112 3010 * @param subevent_code 3011 * @param dest 3012 * @param foundation_status 3013 * @param model_identifier 3014 * @param num_subscription_addresses 3015 * @param subscription_address_pos 3016 * @param subscription_address_item 3017 */ 3018 #define MESH_SUBEVENT_CONFIGURATION_MODEL_SUBSCRIPTION_LIST_ITEM 0x43 3019 3020 3021 /** 3022 * @format 121 3023 * @param subevent_code 3024 * @param dest 3025 * @param foundation_status 3026 */ 3027 #define MESH_SUBEVENT_CONFIGURATION_NETKEY_INDEX 0x44 3028 3029 /** 3030 * @format 121112 3031 * @param subevent_code 3032 * @param dest 3033 * @param foundation_status 3034 * @param num_netkey_indexes 3035 * @param netkey_index_pos 3036 * @param netkey_index_item 3037 */ 3038 #define MESH_SUBEVENT_CONFIGURATION_NETKEY_INDEX_LIST_ITEM 0x45 3039 3040 /** 3041 * @format 12122 3042 * @param subevent_code 3043 * @param dest 3044 * @param foundation_status 3045 * @param netkey_index_item 3046 * @param appkey_index_item 3047 */ 3048 #define MESH_SUBEVENT_CONFIGURATION_APPKEY_INDEX 0x46 3049 3050 /** 3051 * @format 12121122 3052 * @param subevent_code 3053 * @param dest 3054 * @param foundation_status 3055 * @param netkey_index 3056 * @param num_appkey_indexes 3057 * @param appkey_index_pos 3058 * @param netkey_index_item 3059 * @param appkey_index_item 3060 */ 3061 #define MESH_SUBEVENT_CONFIGURATION_APPKEY_INDEX_LIST_ITEM 0x47 3062 3063 /** 3064 * @format 12121 3065 * @param subevent_code 3066 * @param dest 3067 * @param foundation_status 3068 * @param netkey_index_item 3069 * @param identity_status 3070 */ 3071 #define MESH_SUBEVENT_CONFIGURATION_NODE_IDENTITY 0x48 3072 3073 /** 3074 * @format 12124 3075 * @param subevent_code 3076 * @param dest 3077 * @param foundation_status 3078 * @param appkey_index 3079 * @param model_identifier 3080 */ 3081 #define MESH_SUBEVENT_CONFIGURATION_MODEL_APP 0x49 3082 3083 /** 3084 * @format 1214112 3085 * @param subevent_code 3086 * @param dest 3087 * @param foundation_status 3088 * @param model_id 3089 * @param num_appkey_indexes 3090 * @param appkey_index_pos 3091 * @param appkey_index_item 3092 */ 3093 #define MESH_SUBEVENT_CONFIGURATION_MODEL_APP_LIST_ITEM 0x50 3094 3095 /** 3096 * @format 121 3097 * @param subevent_code 3098 * @param dest 3099 * @param foundation_status 3100 */ 3101 #define MESH_SUBEVENT_CONFIGURATION_NODE_RESET 0x51 3102 3103 /** 3104 * @format 1211 3105 * @param subevent_code 3106 * @param dest 3107 * @param foundation_status 3108 * @param friend_state 3109 */ 3110 #define MESH_SUBEVENT_CONFIGURATION_FRIEND 0x52 3111 3112 /** 3113 * @format 12121 3114 * @param subevent_code 3115 * @param dest 3116 * @param foundation_status 3117 * @param netkey_index 3118 * @param phase 3119 */ 3120 #define MESH_SUBEVENT_CONFIGURATION_KEY_REFRESH_PHASE 0x53 3121 3122 /** 3123 * @format 121222122 3124 * @param subevent_code 3125 * @param dest 3126 * @param foundation_status 3127 * @param heartbeat_destination 3128 * @param count_S 3129 * @param period_S 3130 * @param ttl 3131 * @param features 3132 * @param netkey_index 3133 */ 3134 #define MESH_SUBEVENT_CONFIGURATION_HEARTBEAT_PUBLICATION 0x54 3135 3136 /** 3137 * @format 12122221111 3138 * @param subevent_code 3139 * @param dest 3140 * @param foundation_status 3141 * @param heartbeat_destination 3142 * @param heartbeat_source 3143 * @param count_S 3144 * @param period_S 3145 * @param min_hops 3146 * @param max_hops 3147 */ 3148 #define MESH_SUBEVENT_CONFIGURATION_HEARTBEAT_SUBSCRIPTION 0x55 3149 3150 /** 3151 * @format 12123 3152 * @param subevent_code 3153 * @param dest 3154 * @param foundation_status 3155 * @param lpn_address 3156 * @param poll_timeout 3157 */ 3158 #define MESH_SUBEVENT_CONFIGURATION_LOW_POWER_NODE_POLL_TIMEOUT 0x56 3159 3160 /** 3161 * @format 12112 3162 * @param subevent_code 3163 * @param dest 3164 * @param foundation_status 3165 * @param transmit_count 3166 * @param transmit_interval_steps_ms 3167 */ 3168 #define MESH_SUBEVENT_CONFIGURATION_NETWORK_TRANSMIT 0x57 3169 3170 3171 #endif 3172