1 /* 2 * Copyright (C) 2016 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 /* 40 * btstack_event.h 41 * 42 * @brief BTstack event getter/setter 43 * @note Don't edit - generated by tool/btstack_event_generator.py 44 * 45 */ 46 47 #ifndef __BTSTACK_EVENT_H 48 #define __BTSTACK_EVENT_H 49 50 #if defined __cplusplus 51 extern "C" { 52 #endif 53 54 #include "btstack_util.h" 55 #include <stdint.h> 56 57 #ifdef ENABLE_BLE 58 #include "ble/gatt_client.h" 59 #endif 60 61 /* API_START */ 62 63 /** 64 * @brief Get event type 65 * @param event 66 * @return type of event 67 */ 68 static inline uint8_t hci_event_packet_get_type(const uint8_t * event){ 69 return event[0]; 70 } 71 72 /*** 73 * @brief Get subevent code for ancs event 74 * @param event packet 75 * @return subevent_code 76 */ 77 static inline uint8_t hci_event_ancs_meta_get_subevent_code(const uint8_t * event){ 78 return event[2]; 79 } 80 /*** 81 * @brief Get subevent code for avdtp event 82 * @param event packet 83 * @return subevent_code 84 */ 85 static inline uint8_t hci_event_avdtp_meta_get_subevent_code(const uint8_t * event){ 86 return event[2]; 87 } 88 /*** 89 * @brief Get subevent code for a2dp event 90 * @param event packet 91 * @return subevent_code 92 */ 93 static inline uint8_t hci_event_a2dp_meta_get_subevent_code(const uint8_t * event){ 94 return event[2]; 95 } 96 /*** 97 * @brief Get subevent code for avrcp event 98 * @param event packet 99 * @return subevent_code 100 */ 101 static inline uint8_t hci_event_avrcp_meta_get_subevent_code(const uint8_t * event){ 102 return event[2]; 103 } 104 /*** 105 * @brief Get subevent code for goep event 106 * @param event packet 107 * @return subevent_code 108 */ 109 static inline uint8_t hci_event_goep_meta_get_subevent_code(const uint8_t * event){ 110 return event[2]; 111 } 112 /*** 113 * @brief Get subevent code for hfp event 114 * @param event packet 115 * @return subevent_code 116 */ 117 static inline uint8_t hci_event_hfp_meta_get_subevent_code(const uint8_t * event){ 118 return event[2]; 119 } 120 /*** 121 * @brief Get subevent code for hsp event 122 * @param event packet 123 * @return subevent_code 124 */ 125 static inline uint8_t hci_event_hsp_meta_get_subevent_code(const uint8_t * event){ 126 return event[2]; 127 } 128 /*** 129 * @brief Get subevent code for pbap event 130 * @param event packet 131 * @return subevent_code 132 */ 133 static inline uint8_t hci_event_pbap_meta_get_subevent_code(const uint8_t * event){ 134 return event[2]; 135 } 136 /*** 137 * @brief Get subevent code for le event 138 * @param event packet 139 * @return subevent_code 140 */ 141 static inline uint8_t hci_event_le_meta_get_subevent_code(const uint8_t * event){ 142 return event[2]; 143 } 144 /** 145 * @brief Get field status from event HCI_EVENT_INQUIRY_COMPLETE 146 * @param event packet 147 * @return status 148 * @note: btstack_type 1 149 */ 150 static inline uint8_t hci_event_inquiry_complete_get_status(const uint8_t * event){ 151 return event[2]; 152 } 153 154 /** 155 * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT 156 * @param event packet 157 * @return num_responses 158 * @note: btstack_type 1 159 */ 160 static inline uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t * event){ 161 return event[2]; 162 } 163 /** 164 * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT 165 * @param event packet 166 * @param Pointer to storage for bd_addr 167 * @note: btstack_type B 168 */ 169 static inline void hci_event_inquiry_result_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 170 reverse_bd_addr(&event[3], bd_addr); 171 } 172 /** 173 * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT 174 * @param event packet 175 * @return page_scan_repetition_mode 176 * @note: btstack_type 1 177 */ 178 static inline uint8_t hci_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t * event){ 179 return event[9]; 180 } 181 /** 182 * @brief Get field reserved1 from event HCI_EVENT_INQUIRY_RESULT 183 * @param event packet 184 * @return reserved1 185 * @note: btstack_type 1 186 */ 187 static inline uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t * event){ 188 return event[10]; 189 } 190 /** 191 * @brief Get field reserved2 from event HCI_EVENT_INQUIRY_RESULT 192 * @param event packet 193 * @return reserved2 194 * @note: btstack_type 1 195 */ 196 static inline uint8_t hci_event_inquiry_result_get_reserved2(const uint8_t * event){ 197 return event[11]; 198 } 199 /** 200 * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT 201 * @param event packet 202 * @return class_of_device 203 * @note: btstack_type 3 204 */ 205 static inline uint32_t hci_event_inquiry_result_get_class_of_device(const uint8_t * event){ 206 return little_endian_read_24(event, 12); 207 } 208 /** 209 * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT 210 * @param event packet 211 * @return clock_offset 212 * @note: btstack_type 2 213 */ 214 static inline uint16_t hci_event_inquiry_result_get_clock_offset(const uint8_t * event){ 215 return little_endian_read_16(event, 15); 216 } 217 218 /** 219 * @brief Get field status from event HCI_EVENT_CONNECTION_COMPLETE 220 * @param event packet 221 * @return status 222 * @note: btstack_type 1 223 */ 224 static inline uint8_t hci_event_connection_complete_get_status(const uint8_t * event){ 225 return event[2]; 226 } 227 /** 228 * @brief Get field connection_handle from event HCI_EVENT_CONNECTION_COMPLETE 229 * @param event packet 230 * @return connection_handle 231 * @note: btstack_type 2 232 */ 233 static inline uint16_t hci_event_connection_complete_get_connection_handle(const uint8_t * event){ 234 return little_endian_read_16(event, 3); 235 } 236 /** 237 * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_COMPLETE 238 * @param event packet 239 * @param Pointer to storage for bd_addr 240 * @note: btstack_type B 241 */ 242 static inline void hci_event_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 243 reverse_bd_addr(&event[5], bd_addr); 244 } 245 /** 246 * @brief Get field link_type from event HCI_EVENT_CONNECTION_COMPLETE 247 * @param event packet 248 * @return link_type 249 * @note: btstack_type 1 250 */ 251 static inline uint8_t hci_event_connection_complete_get_link_type(const uint8_t * event){ 252 return event[11]; 253 } 254 /** 255 * @brief Get field encryption_enabled from event HCI_EVENT_CONNECTION_COMPLETE 256 * @param event packet 257 * @return encryption_enabled 258 * @note: btstack_type 1 259 */ 260 static inline uint8_t hci_event_connection_complete_get_encryption_enabled(const uint8_t * event){ 261 return event[12]; 262 } 263 264 /** 265 * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_REQUEST 266 * @param event packet 267 * @param Pointer to storage for bd_addr 268 * @note: btstack_type B 269 */ 270 static inline void hci_event_connection_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 271 reverse_bd_addr(&event[2], bd_addr); 272 } 273 /** 274 * @brief Get field class_of_device from event HCI_EVENT_CONNECTION_REQUEST 275 * @param event packet 276 * @return class_of_device 277 * @note: btstack_type 3 278 */ 279 static inline uint32_t hci_event_connection_request_get_class_of_device(const uint8_t * event){ 280 return little_endian_read_24(event, 8); 281 } 282 /** 283 * @brief Get field link_type from event HCI_EVENT_CONNECTION_REQUEST 284 * @param event packet 285 * @return link_type 286 * @note: btstack_type 1 287 */ 288 static inline uint8_t hci_event_connection_request_get_link_type(const uint8_t * event){ 289 return event[11]; 290 } 291 292 /** 293 * @brief Get field status from event HCI_EVENT_DISCONNECTION_COMPLETE 294 * @param event packet 295 * @return status 296 * @note: btstack_type 1 297 */ 298 static inline uint8_t hci_event_disconnection_complete_get_status(const uint8_t * event){ 299 return event[2]; 300 } 301 /** 302 * @brief Get field connection_handle from event HCI_EVENT_DISCONNECTION_COMPLETE 303 * @param event packet 304 * @return connection_handle 305 * @note: btstack_type 2 306 */ 307 static inline uint16_t hci_event_disconnection_complete_get_connection_handle(const uint8_t * event){ 308 return little_endian_read_16(event, 3); 309 } 310 /** 311 * @brief Get field reason from event HCI_EVENT_DISCONNECTION_COMPLETE 312 * @param event packet 313 * @return reason 314 * @note: btstack_type 1 315 */ 316 static inline uint8_t hci_event_disconnection_complete_get_reason(const uint8_t * event){ 317 return event[5]; 318 } 319 320 /** 321 * @brief Get field status from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT 322 * @param event packet 323 * @return status 324 * @note: btstack_type 1 325 */ 326 static inline uint8_t hci_event_authentication_complete_event_get_status(const uint8_t * event){ 327 return event[2]; 328 } 329 /** 330 * @brief Get field connection_handle from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT 331 * @param event packet 332 * @return connection_handle 333 * @note: btstack_type 2 334 */ 335 static inline uint16_t hci_event_authentication_complete_event_get_connection_handle(const uint8_t * event){ 336 return little_endian_read_16(event, 3); 337 } 338 339 /** 340 * @brief Get field status from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 341 * @param event packet 342 * @return status 343 * @note: btstack_type 1 344 */ 345 // static inline uint8_t hci_event_remote_name_request_complete_get_status(const uint8_t * event){ 346 // not implemented yet 347 // } 348 /** 349 * @brief Get field bd_addr from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 350 * @param event packet 351 * @return bd_addr 352 * @note: btstack_type B 353 */ 354 // static inline bd_addr_t hci_event_remote_name_request_complete_get_bd_addr(const uint8_t * event){ 355 // not implemented yet 356 // } 357 /** 358 * @brief Get field remote_name from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 359 * @param event packet 360 * @return remote_name 361 * @note: btstack_type N 362 */ 363 // static inline String hci_event_remote_name_request_complete_get_remote_name(const uint8_t * event){ 364 // not implemented yet 365 // } 366 367 /** 368 * @brief Get field status from event HCI_EVENT_ENCRYPTION_CHANGE 369 * @param event packet 370 * @return status 371 * @note: btstack_type 1 372 */ 373 static inline uint8_t hci_event_encryption_change_get_status(const uint8_t * event){ 374 return event[2]; 375 } 376 /** 377 * @brief Get field connection_handle from event HCI_EVENT_ENCRYPTION_CHANGE 378 * @param event packet 379 * @return connection_handle 380 * @note: btstack_type 2 381 */ 382 static inline uint16_t hci_event_encryption_change_get_connection_handle(const uint8_t * event){ 383 return little_endian_read_16(event, 3); 384 } 385 /** 386 * @brief Get field encryption_enabled from event HCI_EVENT_ENCRYPTION_CHANGE 387 * @param event packet 388 * @return encryption_enabled 389 * @note: btstack_type 1 390 */ 391 static inline uint8_t hci_event_encryption_change_get_encryption_enabled(const uint8_t * event){ 392 return event[5]; 393 } 394 395 /** 396 * @brief Get field status from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE 397 * @param event packet 398 * @return status 399 * @note: btstack_type 1 400 */ 401 static inline uint8_t hci_event_change_connection_link_key_complete_get_status(const uint8_t * event){ 402 return event[2]; 403 } 404 /** 405 * @brief Get field connection_handle from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE 406 * @param event packet 407 * @return connection_handle 408 * @note: btstack_type 2 409 */ 410 static inline uint16_t hci_event_change_connection_link_key_complete_get_connection_handle(const uint8_t * event){ 411 return little_endian_read_16(event, 3); 412 } 413 414 /** 415 * @brief Get field status from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE 416 * @param event packet 417 * @return status 418 * @note: btstack_type 1 419 */ 420 static inline uint8_t hci_event_master_link_key_complete_get_status(const uint8_t * event){ 421 return event[2]; 422 } 423 /** 424 * @brief Get field connection_handle from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE 425 * @param event packet 426 * @return connection_handle 427 * @note: btstack_type 2 428 */ 429 static inline uint16_t hci_event_master_link_key_complete_get_connection_handle(const uint8_t * event){ 430 return little_endian_read_16(event, 3); 431 } 432 /** 433 * @brief Get field key_flag from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE 434 * @param event packet 435 * @return key_flag 436 * @note: btstack_type 1 437 */ 438 static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint8_t * event){ 439 return event[5]; 440 } 441 442 /** 443 * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_COMPLETE 444 * @param event packet 445 * @return num_hci_command_packets 446 * @note: btstack_type 1 447 */ 448 static inline uint8_t hci_event_command_complete_get_num_hci_command_packets(const uint8_t * event){ 449 return event[2]; 450 } 451 /** 452 * @brief Get field command_opcode from event HCI_EVENT_COMMAND_COMPLETE 453 * @param event packet 454 * @return command_opcode 455 * @note: btstack_type 2 456 */ 457 static inline uint16_t hci_event_command_complete_get_command_opcode(const uint8_t * event){ 458 return little_endian_read_16(event, 3); 459 } 460 /** 461 * @brief Get field return_parameters from event HCI_EVENT_COMMAND_COMPLETE 462 * @param event packet 463 * @return return_parameters 464 * @note: btstack_type R 465 */ 466 static inline const uint8_t * hci_event_command_complete_get_return_parameters(const uint8_t * event){ 467 return &event[5]; 468 } 469 470 /** 471 * @brief Get field status from event HCI_EVENT_COMMAND_STATUS 472 * @param event packet 473 * @return status 474 * @note: btstack_type 1 475 */ 476 static inline uint8_t hci_event_command_status_get_status(const uint8_t * event){ 477 return event[2]; 478 } 479 /** 480 * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_STATUS 481 * @param event packet 482 * @return num_hci_command_packets 483 * @note: btstack_type 1 484 */ 485 static inline uint8_t hci_event_command_status_get_num_hci_command_packets(const uint8_t * event){ 486 return event[3]; 487 } 488 /** 489 * @brief Get field command_opcode from event HCI_EVENT_COMMAND_STATUS 490 * @param event packet 491 * @return command_opcode 492 * @note: btstack_type 2 493 */ 494 static inline uint16_t hci_event_command_status_get_command_opcode(const uint8_t * event){ 495 return little_endian_read_16(event, 4); 496 } 497 498 /** 499 * @brief Get field hardware_code from event HCI_EVENT_HARDWARE_ERROR 500 * @param event packet 501 * @return hardware_code 502 * @note: btstack_type 1 503 */ 504 static inline uint8_t hci_event_hardware_error_get_hardware_code(const uint8_t * event){ 505 return event[2]; 506 } 507 508 /** 509 * @brief Get field status from event HCI_EVENT_ROLE_CHANGE 510 * @param event packet 511 * @return status 512 * @note: btstack_type 1 513 */ 514 static inline uint8_t hci_event_role_change_get_status(const uint8_t * event){ 515 return event[2]; 516 } 517 /** 518 * @brief Get field bd_addr from event HCI_EVENT_ROLE_CHANGE 519 * @param event packet 520 * @param Pointer to storage for bd_addr 521 * @note: btstack_type B 522 */ 523 static inline void hci_event_role_change_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 524 reverse_bd_addr(&event[3], bd_addr); 525 } 526 /** 527 * @brief Get field role from event HCI_EVENT_ROLE_CHANGE 528 * @param event packet 529 * @return role 530 * @note: btstack_type 1 531 */ 532 static inline uint8_t hci_event_role_change_get_role(const uint8_t * event){ 533 return event[9]; 534 } 535 536 /** 537 * @brief Get field status from event HCI_EVENT_MODE_CHANGE_EVENT 538 * @param event packet 539 * @return status 540 * @note: btstack_type 1 541 */ 542 static inline uint8_t hci_event_mode_change_event_get_status(const uint8_t * event){ 543 return event[2]; 544 } 545 /** 546 * @brief Get field handle from event HCI_EVENT_MODE_CHANGE_EVENT 547 * @param event packet 548 * @return handle 549 * @note: btstack_type H 550 */ 551 static inline hci_con_handle_t hci_event_mode_change_event_get_handle(const uint8_t * event){ 552 return little_endian_read_16(event, 3); 553 } 554 /** 555 * @brief Get field mode from event HCI_EVENT_MODE_CHANGE_EVENT 556 * @param event packet 557 * @return mode 558 * @note: btstack_type 1 559 */ 560 static inline uint8_t hci_event_mode_change_event_get_mode(const uint8_t * event){ 561 return event[5]; 562 } 563 /** 564 * @brief Get field interval from event HCI_EVENT_MODE_CHANGE_EVENT 565 * @param event packet 566 * @return interval 567 * @note: btstack_type 2 568 */ 569 static inline uint16_t hci_event_mode_change_event_get_interval(const uint8_t * event){ 570 return little_endian_read_16(event, 6); 571 } 572 573 /** 574 * @brief Get field bd_addr from event HCI_EVENT_PIN_CODE_REQUEST 575 * @param event packet 576 * @param Pointer to storage for bd_addr 577 * @note: btstack_type B 578 */ 579 static inline void hci_event_pin_code_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 580 reverse_bd_addr(&event[2], bd_addr); 581 } 582 583 /** 584 * @brief Get field bd_addr from event HCI_EVENT_LINK_KEY_REQUEST 585 * @param event packet 586 * @param Pointer to storage for bd_addr 587 * @note: btstack_type B 588 */ 589 static inline void hci_event_link_key_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 590 reverse_bd_addr(&event[2], bd_addr); 591 } 592 593 /** 594 * @brief Get field link_type from event HCI_EVENT_DATA_BUFFER_OVERFLOW 595 * @param event packet 596 * @return link_type 597 * @note: btstack_type 1 598 */ 599 static inline uint8_t hci_event_data_buffer_overflow_get_link_type(const uint8_t * event){ 600 return event[2]; 601 } 602 603 /** 604 * @brief Get field handle from event HCI_EVENT_MAX_SLOTS_CHANGED 605 * @param event packet 606 * @return handle 607 * @note: btstack_type H 608 */ 609 static inline hci_con_handle_t hci_event_max_slots_changed_get_handle(const uint8_t * event){ 610 return little_endian_read_16(event, 2); 611 } 612 /** 613 * @brief Get field lmp_max_slots from event HCI_EVENT_MAX_SLOTS_CHANGED 614 * @param event packet 615 * @return lmp_max_slots 616 * @note: btstack_type 1 617 */ 618 static inline uint8_t hci_event_max_slots_changed_get_lmp_max_slots(const uint8_t * event){ 619 return event[4]; 620 } 621 622 /** 623 * @brief Get field status from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 624 * @param event packet 625 * @return status 626 * @note: btstack_type 1 627 */ 628 static inline uint8_t hci_event_read_clock_offset_complete_get_status(const uint8_t * event){ 629 return event[2]; 630 } 631 /** 632 * @brief Get field handle from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 633 * @param event packet 634 * @return handle 635 * @note: btstack_type H 636 */ 637 static inline hci_con_handle_t hci_event_read_clock_offset_complete_get_handle(const uint8_t * event){ 638 return little_endian_read_16(event, 3); 639 } 640 /** 641 * @brief Get field clock_offset from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 642 * @param event packet 643 * @return clock_offset 644 * @note: btstack_type 2 645 */ 646 static inline uint16_t hci_event_read_clock_offset_complete_get_clock_offset(const uint8_t * event){ 647 return little_endian_read_16(event, 5); 648 } 649 650 /** 651 * @brief Get field status from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED 652 * @param event packet 653 * @return status 654 * @note: btstack_type 1 655 */ 656 static inline uint8_t hci_event_connection_packet_type_changed_get_status(const uint8_t * event){ 657 return event[2]; 658 } 659 /** 660 * @brief Get field handle from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED 661 * @param event packet 662 * @return handle 663 * @note: btstack_type H 664 */ 665 static inline hci_con_handle_t hci_event_connection_packet_type_changed_get_handle(const uint8_t * event){ 666 return little_endian_read_16(event, 3); 667 } 668 /** 669 * @brief Get field packet_types from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED 670 * @param event packet 671 * @return packet_types 672 * @note: btstack_type 2 673 */ 674 static inline uint16_t hci_event_connection_packet_type_changed_get_packet_types(const uint8_t * event){ 675 return little_endian_read_16(event, 5); 676 } 677 678 /** 679 * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 680 * @param event packet 681 * @return num_responses 682 * @note: btstack_type 1 683 */ 684 static inline uint8_t hci_event_inquiry_result_with_rssi_get_num_responses(const uint8_t * event){ 685 return event[2]; 686 } 687 /** 688 * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 689 * @param event packet 690 * @param Pointer to storage for bd_addr 691 * @note: btstack_type B 692 */ 693 static inline void hci_event_inquiry_result_with_rssi_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 694 reverse_bd_addr(&event[3], bd_addr); 695 } 696 /** 697 * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 698 * @param event packet 699 * @return page_scan_repetition_mode 700 * @note: btstack_type 1 701 */ 702 static inline uint8_t hci_event_inquiry_result_with_rssi_get_page_scan_repetition_mode(const uint8_t * event){ 703 return event[9]; 704 } 705 /** 706 * @brief Get field reserved from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 707 * @param event packet 708 * @return reserved 709 * @note: btstack_type 1 710 */ 711 static inline uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t * event){ 712 return event[10]; 713 } 714 /** 715 * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 716 * @param event packet 717 * @return class_of_device 718 * @note: btstack_type 3 719 */ 720 static inline uint32_t hci_event_inquiry_result_with_rssi_get_class_of_device(const uint8_t * event){ 721 return little_endian_read_24(event, 11); 722 } 723 /** 724 * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 725 * @param event packet 726 * @return clock_offset 727 * @note: btstack_type 2 728 */ 729 static inline uint16_t hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t * event){ 730 return little_endian_read_16(event, 14); 731 } 732 /** 733 * @brief Get field rssi from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 734 * @param event packet 735 * @return rssi 736 * @note: btstack_type 1 737 */ 738 static inline uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t * event){ 739 return event[16]; 740 } 741 742 /** 743 * @brief Get field status from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 744 * @param event packet 745 * @return status 746 * @note: btstack_type 1 747 */ 748 static inline uint8_t hci_event_synchronous_connection_complete_get_status(const uint8_t * event){ 749 return event[2]; 750 } 751 /** 752 * @brief Get field handle from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 753 * @param event packet 754 * @return handle 755 * @note: btstack_type H 756 */ 757 static inline hci_con_handle_t hci_event_synchronous_connection_complete_get_handle(const uint8_t * event){ 758 return little_endian_read_16(event, 3); 759 } 760 /** 761 * @brief Get field bd_addr from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 762 * @param event packet 763 * @param Pointer to storage for bd_addr 764 * @note: btstack_type B 765 */ 766 static inline void hci_event_synchronous_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 767 reverse_bd_addr(&event[5], bd_addr); 768 } 769 /** 770 * @brief Get field link_type from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 771 * @param event packet 772 * @return link_type 773 * @note: btstack_type 1 774 */ 775 static inline uint8_t hci_event_synchronous_connection_complete_get_link_type(const uint8_t * event){ 776 return event[11]; 777 } 778 /** 779 * @brief Get field transmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 780 * @param event packet 781 * @return transmission_interval 782 * @note: btstack_type 1 783 */ 784 static inline uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(const uint8_t * event){ 785 return event[12]; 786 } 787 /** 788 * @brief Get field retransmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 789 * @param event packet 790 * @return retransmission_interval 791 * @note: btstack_type 1 792 */ 793 static inline uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(const uint8_t * event){ 794 return event[13]; 795 } 796 /** 797 * @brief Get field rx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 798 * @param event packet 799 * @return rx_packet_length 800 * @note: btstack_type 2 801 */ 802 static inline uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(const uint8_t * event){ 803 return little_endian_read_16(event, 14); 804 } 805 /** 806 * @brief Get field tx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 807 * @param event packet 808 * @return tx_packet_length 809 * @note: btstack_type 2 810 */ 811 static inline uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(const uint8_t * event){ 812 return little_endian_read_16(event, 16); 813 } 814 /** 815 * @brief Get field air_mode from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 816 * @param event packet 817 * @return air_mode 818 * @note: btstack_type 1 819 */ 820 static inline uint8_t hci_event_synchronous_connection_complete_get_air_mode(const uint8_t * event){ 821 return event[18]; 822 } 823 824 /** 825 * @brief Get field num_responses from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 826 * @param event packet 827 * @return num_responses 828 * @note: btstack_type 1 829 */ 830 static inline uint8_t hci_event_extended_inquiry_response_get_num_responses(const uint8_t * event){ 831 return event[2]; 832 } 833 /** 834 * @brief Get field bd_addr from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 835 * @param event packet 836 * @param Pointer to storage for bd_addr 837 * @note: btstack_type B 838 */ 839 static inline void hci_event_extended_inquiry_response_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 840 reverse_bd_addr(&event[3], bd_addr); 841 } 842 /** 843 * @brief Get field page_scan_repetition_mode from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 844 * @param event packet 845 * @return page_scan_repetition_mode 846 * @note: btstack_type 1 847 */ 848 static inline uint8_t hci_event_extended_inquiry_response_get_page_scan_repetition_mode(const uint8_t * event){ 849 return event[9]; 850 } 851 /** 852 * @brief Get field reserved from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 853 * @param event packet 854 * @return reserved 855 * @note: btstack_type 1 856 */ 857 static inline uint8_t hci_event_extended_inquiry_response_get_reserved(const uint8_t * event){ 858 return event[10]; 859 } 860 /** 861 * @brief Get field class_of_device from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 862 * @param event packet 863 * @return class_of_device 864 * @note: btstack_type 3 865 */ 866 static inline uint32_t hci_event_extended_inquiry_response_get_class_of_device(const uint8_t * event){ 867 return little_endian_read_24(event, 11); 868 } 869 /** 870 * @brief Get field clock_offset from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 871 * @param event packet 872 * @return clock_offset 873 * @note: btstack_type 2 874 */ 875 static inline uint16_t hci_event_extended_inquiry_response_get_clock_offset(const uint8_t * event){ 876 return little_endian_read_16(event, 14); 877 } 878 /** 879 * @brief Get field rssi from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 880 * @param event packet 881 * @return rssi 882 * @note: btstack_type 1 883 */ 884 static inline uint8_t hci_event_extended_inquiry_response_get_rssi(const uint8_t * event){ 885 return event[16]; 886 } 887 888 /** 889 * @brief Get field status from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE 890 * @param event packet 891 * @return status 892 * @note: btstack_type 1 893 */ 894 static inline uint8_t hci_event_encryption_key_refresh_complete_get_status(const uint8_t * event){ 895 return event[2]; 896 } 897 /** 898 * @brief Get field handle from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE 899 * @param event packet 900 * @return handle 901 * @note: btstack_type H 902 */ 903 static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_handle(const uint8_t * event){ 904 return little_endian_read_16(event, 3); 905 } 906 907 /** 908 * @brief Get field bd_addr from event HCI_EVENT_USER_CONFIRMATION_REQUEST 909 * @param event packet 910 * @param Pointer to storage for bd_addr 911 * @note: btstack_type B 912 */ 913 static inline void hci_event_user_confirmation_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 914 reverse_bd_addr(&event[2], bd_addr); 915 } 916 /** 917 * @brief Get field numeric_value from event HCI_EVENT_USER_CONFIRMATION_REQUEST 918 * @param event packet 919 * @return numeric_value 920 * @note: btstack_type 4 921 */ 922 static inline uint32_t hci_event_user_confirmation_request_get_numeric_value(const uint8_t * event){ 923 return little_endian_read_32(event, 8); 924 } 925 926 /** 927 * @brief Get field bd_addr from event HCI_EVENT_USER_PASSKEY_REQUEST 928 * @param event packet 929 * @param Pointer to storage for bd_addr 930 * @note: btstack_type B 931 */ 932 static inline void hci_event_user_passkey_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 933 reverse_bd_addr(&event[2], bd_addr); 934 } 935 936 /** 937 * @brief Get field bd_addr from event HCI_EVENT_REMOTE_OOB_DATA_REQUEST 938 * @param event packet 939 * @param Pointer to storage for bd_addr 940 * @note: btstack_type B 941 */ 942 static inline void hci_event_remote_oob_data_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 943 reverse_bd_addr(&event[2], bd_addr); 944 } 945 946 /** 947 * @brief Get field status from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE 948 * @param event packet 949 * @return status 950 * @note: btstack_type 1 951 */ 952 static inline uint8_t hci_event_simple_pairing_complete_get_status(const uint8_t * event){ 953 return event[2]; 954 } 955 /** 956 * @brief Get field bd_addr from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE 957 * @param event packet 958 * @param Pointer to storage for bd_addr 959 * @note: btstack_type B 960 */ 961 static inline void hci_event_simple_pairing_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 962 reverse_bd_addr(&event[3], bd_addr); 963 } 964 965 /** 966 * @brief Get field state from event BTSTACK_EVENT_STATE 967 * @param event packet 968 * @return state 969 * @note: btstack_type 1 970 */ 971 static inline uint8_t btstack_event_state_get_state(const uint8_t * event){ 972 return event[2]; 973 } 974 975 /** 976 * @brief Get field number_connections from event BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 977 * @param event packet 978 * @return number_connections 979 * @note: btstack_type 1 980 */ 981 static inline uint8_t btstack_event_nr_connections_changed_get_number_connections(const uint8_t * event){ 982 return event[2]; 983 } 984 985 986 /** 987 * @brief Get field discoverable from event BTSTACK_EVENT_DISCOVERABLE_ENABLED 988 * @param event packet 989 * @return discoverable 990 * @note: btstack_type 1 991 */ 992 static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t * event){ 993 return event[2]; 994 } 995 996 /** 997 * @brief Get field active from event HCI_EVENT_TRANSPORT_SLEEP_MODE 998 * @param event packet 999 * @return active 1000 * @note: btstack_type 1 1001 */ 1002 static inline uint8_t hci_event_transport_sleep_mode_get_active(const uint8_t * event){ 1003 return event[2]; 1004 } 1005 1006 /** 1007 * @brief Get field handle from event HCI_EVENT_SCO_CAN_SEND_NOW 1008 * @param event packet 1009 * @param Pointer to storage for handle 1010 * @note: btstack_type B 1011 */ 1012 static inline void hci_event_sco_can_send_now_get_handle(const uint8_t * event, bd_addr_t handle){ 1013 reverse_bd_addr(&event[2], handle); 1014 } 1015 1016 /** 1017 * @brief Get field status from event L2CAP_EVENT_CHANNEL_OPENED 1018 * @param event packet 1019 * @return status 1020 * @note: btstack_type 1 1021 */ 1022 static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t * event){ 1023 return event[2]; 1024 } 1025 /** 1026 * @brief Get field address from event L2CAP_EVENT_CHANNEL_OPENED 1027 * @param event packet 1028 * @param Pointer to storage for address 1029 * @note: btstack_type B 1030 */ 1031 static inline void l2cap_event_channel_opened_get_address(const uint8_t * event, bd_addr_t address){ 1032 reverse_bd_addr(&event[3], address); 1033 } 1034 /** 1035 * @brief Get field handle from event L2CAP_EVENT_CHANNEL_OPENED 1036 * @param event packet 1037 * @return handle 1038 * @note: btstack_type H 1039 */ 1040 static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t * event){ 1041 return little_endian_read_16(event, 9); 1042 } 1043 /** 1044 * @brief Get field psm from event L2CAP_EVENT_CHANNEL_OPENED 1045 * @param event packet 1046 * @return psm 1047 * @note: btstack_type 2 1048 */ 1049 static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t * event){ 1050 return little_endian_read_16(event, 11); 1051 } 1052 /** 1053 * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_OPENED 1054 * @param event packet 1055 * @return local_cid 1056 * @note: btstack_type 2 1057 */ 1058 static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t * event){ 1059 return little_endian_read_16(event, 13); 1060 } 1061 /** 1062 * @brief Get field remote_cid from event L2CAP_EVENT_CHANNEL_OPENED 1063 * @param event packet 1064 * @return remote_cid 1065 * @note: btstack_type 2 1066 */ 1067 static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t * event){ 1068 return little_endian_read_16(event, 15); 1069 } 1070 /** 1071 * @brief Get field local_mtu from event L2CAP_EVENT_CHANNEL_OPENED 1072 * @param event packet 1073 * @return local_mtu 1074 * @note: btstack_type 2 1075 */ 1076 static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t * event){ 1077 return little_endian_read_16(event, 17); 1078 } 1079 /** 1080 * @brief Get field remote_mtu from event L2CAP_EVENT_CHANNEL_OPENED 1081 * @param event packet 1082 * @return remote_mtu 1083 * @note: btstack_type 2 1084 */ 1085 static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t * event){ 1086 return little_endian_read_16(event, 19); 1087 } 1088 /** 1089 * @brief Get field flush_timeout from event L2CAP_EVENT_CHANNEL_OPENED 1090 * @param event packet 1091 * @return flush_timeout 1092 * @note: btstack_type 2 1093 */ 1094 static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t * event){ 1095 return little_endian_read_16(event, 21); 1096 } 1097 /** 1098 * @brief Get field incoming from event L2CAP_EVENT_CHANNEL_OPENED 1099 * @param event packet 1100 * @return incoming 1101 * @note: btstack_type 1 1102 */ 1103 static inline uint8_t l2cap_event_channel_opened_get_incoming(const uint8_t * event){ 1104 return event[23]; 1105 } 1106 1107 /** 1108 * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_CLOSED 1109 * @param event packet 1110 * @return local_cid 1111 * @note: btstack_type 2 1112 */ 1113 static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t * event){ 1114 return little_endian_read_16(event, 2); 1115 } 1116 1117 /** 1118 * @brief Get field address from event L2CAP_EVENT_INCOMING_CONNECTION 1119 * @param event packet 1120 * @param Pointer to storage for address 1121 * @note: btstack_type B 1122 */ 1123 static inline void l2cap_event_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ 1124 reverse_bd_addr(&event[2], address); 1125 } 1126 /** 1127 * @brief Get field handle from event L2CAP_EVENT_INCOMING_CONNECTION 1128 * @param event packet 1129 * @return handle 1130 * @note: btstack_type H 1131 */ 1132 static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t * event){ 1133 return little_endian_read_16(event, 8); 1134 } 1135 /** 1136 * @brief Get field psm from event L2CAP_EVENT_INCOMING_CONNECTION 1137 * @param event packet 1138 * @return psm 1139 * @note: btstack_type 2 1140 */ 1141 static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t * event){ 1142 return little_endian_read_16(event, 10); 1143 } 1144 /** 1145 * @brief Get field local_cid from event L2CAP_EVENT_INCOMING_CONNECTION 1146 * @param event packet 1147 * @return local_cid 1148 * @note: btstack_type 2 1149 */ 1150 static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t * event){ 1151 return little_endian_read_16(event, 12); 1152 } 1153 /** 1154 * @brief Get field remote_cid from event L2CAP_EVENT_INCOMING_CONNECTION 1155 * @param event packet 1156 * @return remote_cid 1157 * @note: btstack_type 2 1158 */ 1159 static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t * event){ 1160 return little_endian_read_16(event, 14); 1161 } 1162 1163 /** 1164 * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1165 * @param event packet 1166 * @return handle 1167 * @note: btstack_type H 1168 */ 1169 static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t * event){ 1170 return little_endian_read_16(event, 2); 1171 } 1172 /** 1173 * @brief Get field interval_min from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1174 * @param event packet 1175 * @return interval_min 1176 * @note: btstack_type 2 1177 */ 1178 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t * event){ 1179 return little_endian_read_16(event, 4); 1180 } 1181 /** 1182 * @brief Get field interval_max from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1183 * @param event packet 1184 * @return interval_max 1185 * @note: btstack_type 2 1186 */ 1187 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t * event){ 1188 return little_endian_read_16(event, 6); 1189 } 1190 /** 1191 * @brief Get field latencey from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1192 * @param event packet 1193 * @return latencey 1194 * @note: btstack_type 2 1195 */ 1196 static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t * event){ 1197 return little_endian_read_16(event, 8); 1198 } 1199 /** 1200 * @brief Get field timeout_multiplier from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1201 * @param event packet 1202 * @return timeout_multiplier 1203 * @note: btstack_type 2 1204 */ 1205 static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t * event){ 1206 return little_endian_read_16(event, 10); 1207 } 1208 1209 /** 1210 * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 1211 * @param event packet 1212 * @return handle 1213 * @note: btstack_type H 1214 */ 1215 static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t * event){ 1216 return little_endian_read_16(event, 2); 1217 } 1218 /** 1219 * @brief Get field result from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 1220 * @param event packet 1221 * @return result 1222 * @note: btstack_type 2 1223 */ 1224 static inline uint16_t l2cap_event_connection_parameter_update_response_get_result(const uint8_t * event){ 1225 return little_endian_read_16(event, 4); 1226 } 1227 1228 /** 1229 * @brief Get field local_cid from event L2CAP_EVENT_CAN_SEND_NOW 1230 * @param event packet 1231 * @return local_cid 1232 * @note: btstack_type 2 1233 */ 1234 static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * event){ 1235 return little_endian_read_16(event, 2); 1236 } 1237 1238 /** 1239 * @brief Get field address_type from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1240 * @param event packet 1241 * @return address_type 1242 * @note: btstack_type 1 1243 */ 1244 static inline uint8_t l2cap_event_le_incoming_connection_get_address_type(const uint8_t * event){ 1245 return event[2]; 1246 } 1247 /** 1248 * @brief Get field address from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1249 * @param event packet 1250 * @param Pointer to storage for address 1251 * @note: btstack_type B 1252 */ 1253 static inline void l2cap_event_le_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ 1254 reverse_bd_addr(&event[3], address); 1255 } 1256 /** 1257 * @brief Get field handle from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1258 * @param event packet 1259 * @return handle 1260 * @note: btstack_type H 1261 */ 1262 static inline hci_con_handle_t l2cap_event_le_incoming_connection_get_handle(const uint8_t * event){ 1263 return little_endian_read_16(event, 9); 1264 } 1265 /** 1266 * @brief Get field psm from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1267 * @param event packet 1268 * @return psm 1269 * @note: btstack_type 2 1270 */ 1271 static inline uint16_t l2cap_event_le_incoming_connection_get_psm(const uint8_t * event){ 1272 return little_endian_read_16(event, 11); 1273 } 1274 /** 1275 * @brief Get field local_cid from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1276 * @param event packet 1277 * @return local_cid 1278 * @note: btstack_type 2 1279 */ 1280 static inline uint16_t l2cap_event_le_incoming_connection_get_local_cid(const uint8_t * event){ 1281 return little_endian_read_16(event, 13); 1282 } 1283 /** 1284 * @brief Get field remote_cid from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1285 * @param event packet 1286 * @return remote_cid 1287 * @note: btstack_type 2 1288 */ 1289 static inline uint16_t l2cap_event_le_incoming_connection_get_remote_cid(const uint8_t * event){ 1290 return little_endian_read_16(event, 15); 1291 } 1292 /** 1293 * @brief Get field remote_mtu from event L2CAP_EVENT_LE_INCOMING_CONNECTION 1294 * @param event packet 1295 * @return remote_mtu 1296 * @note: btstack_type 2 1297 */ 1298 static inline uint16_t l2cap_event_le_incoming_connection_get_remote_mtu(const uint8_t * event){ 1299 return little_endian_read_16(event, 17); 1300 } 1301 1302 /** 1303 * @brief Get field status from event L2CAP_EVENT_LE_CHANNEL_OPENED 1304 * @param event packet 1305 * @return status 1306 * @note: btstack_type 1 1307 */ 1308 static inline uint8_t l2cap_event_le_channel_opened_get_status(const uint8_t * event){ 1309 return event[2]; 1310 } 1311 /** 1312 * @brief Get field address_type from event L2CAP_EVENT_LE_CHANNEL_OPENED 1313 * @param event packet 1314 * @return address_type 1315 * @note: btstack_type 1 1316 */ 1317 static inline uint8_t l2cap_event_le_channel_opened_get_address_type(const uint8_t * event){ 1318 return event[3]; 1319 } 1320 /** 1321 * @brief Get field address from event L2CAP_EVENT_LE_CHANNEL_OPENED 1322 * @param event packet 1323 * @param Pointer to storage for address 1324 * @note: btstack_type B 1325 */ 1326 static inline void l2cap_event_le_channel_opened_get_address(const uint8_t * event, bd_addr_t address){ 1327 reverse_bd_addr(&event[4], address); 1328 } 1329 /** 1330 * @brief Get field handle from event L2CAP_EVENT_LE_CHANNEL_OPENED 1331 * @param event packet 1332 * @return handle 1333 * @note: btstack_type H 1334 */ 1335 static inline hci_con_handle_t l2cap_event_le_channel_opened_get_handle(const uint8_t * event){ 1336 return little_endian_read_16(event, 10); 1337 } 1338 /** 1339 * @brief Get field incoming from event L2CAP_EVENT_LE_CHANNEL_OPENED 1340 * @param event packet 1341 * @return incoming 1342 * @note: btstack_type 1 1343 */ 1344 static inline uint8_t l2cap_event_le_channel_opened_get_incoming(const uint8_t * event){ 1345 return event[12]; 1346 } 1347 /** 1348 * @brief Get field psm from event L2CAP_EVENT_LE_CHANNEL_OPENED 1349 * @param event packet 1350 * @return psm 1351 * @note: btstack_type 2 1352 */ 1353 static inline uint16_t l2cap_event_le_channel_opened_get_psm(const uint8_t * event){ 1354 return little_endian_read_16(event, 13); 1355 } 1356 /** 1357 * @brief Get field local_cid from event L2CAP_EVENT_LE_CHANNEL_OPENED 1358 * @param event packet 1359 * @return local_cid 1360 * @note: btstack_type 2 1361 */ 1362 static inline uint16_t l2cap_event_le_channel_opened_get_local_cid(const uint8_t * event){ 1363 return little_endian_read_16(event, 15); 1364 } 1365 /** 1366 * @brief Get field remote_cid from event L2CAP_EVENT_LE_CHANNEL_OPENED 1367 * @param event packet 1368 * @return remote_cid 1369 * @note: btstack_type 2 1370 */ 1371 static inline uint16_t l2cap_event_le_channel_opened_get_remote_cid(const uint8_t * event){ 1372 return little_endian_read_16(event, 17); 1373 } 1374 /** 1375 * @brief Get field local_mtu from event L2CAP_EVENT_LE_CHANNEL_OPENED 1376 * @param event packet 1377 * @return local_mtu 1378 * @note: btstack_type 2 1379 */ 1380 static inline uint16_t l2cap_event_le_channel_opened_get_local_mtu(const uint8_t * event){ 1381 return little_endian_read_16(event, 19); 1382 } 1383 /** 1384 * @brief Get field remote_mtu from event L2CAP_EVENT_LE_CHANNEL_OPENED 1385 * @param event packet 1386 * @return remote_mtu 1387 * @note: btstack_type 2 1388 */ 1389 static inline uint16_t l2cap_event_le_channel_opened_get_remote_mtu(const uint8_t * event){ 1390 return little_endian_read_16(event, 21); 1391 } 1392 1393 /** 1394 * @brief Get field local_cid from event L2CAP_EVENT_LE_CHANNEL_CLOSED 1395 * @param event packet 1396 * @return local_cid 1397 * @note: btstack_type 2 1398 */ 1399 static inline uint16_t l2cap_event_le_channel_closed_get_local_cid(const uint8_t * event){ 1400 return little_endian_read_16(event, 2); 1401 } 1402 1403 /** 1404 * @brief Get field local_cid from event L2CAP_EVENT_LE_CAN_SEND_NOW 1405 * @param event packet 1406 * @return local_cid 1407 * @note: btstack_type 2 1408 */ 1409 static inline uint16_t l2cap_event_le_can_send_now_get_local_cid(const uint8_t * event){ 1410 return little_endian_read_16(event, 2); 1411 } 1412 1413 /** 1414 * @brief Get field local_cid from event L2CAP_EVENT_LE_PACKET_SENT 1415 * @param event packet 1416 * @return local_cid 1417 * @note: btstack_type 2 1418 */ 1419 static inline uint16_t l2cap_event_le_packet_sent_get_local_cid(const uint8_t * event){ 1420 return little_endian_read_16(event, 2); 1421 } 1422 1423 /** 1424 * @brief Get field status from event RFCOMM_EVENT_CHANNEL_OPENED 1425 * @param event packet 1426 * @return status 1427 * @note: btstack_type 1 1428 */ 1429 static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t * event){ 1430 return event[2]; 1431 } 1432 /** 1433 * @brief Get field bd_addr from event RFCOMM_EVENT_CHANNEL_OPENED 1434 * @param event packet 1435 * @param Pointer to storage for bd_addr 1436 * @note: btstack_type B 1437 */ 1438 static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1439 reverse_bd_addr(&event[3], bd_addr); 1440 } 1441 /** 1442 * @brief Get field con_handle from event RFCOMM_EVENT_CHANNEL_OPENED 1443 * @param event packet 1444 * @return con_handle 1445 * @note: btstack_type 2 1446 */ 1447 static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t * event){ 1448 return little_endian_read_16(event, 9); 1449 } 1450 /** 1451 * @brief Get field server_channel from event RFCOMM_EVENT_CHANNEL_OPENED 1452 * @param event packet 1453 * @return server_channel 1454 * @note: btstack_type 1 1455 */ 1456 static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t * event){ 1457 return event[11]; 1458 } 1459 /** 1460 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_OPENED 1461 * @param event packet 1462 * @return rfcomm_cid 1463 * @note: btstack_type 2 1464 */ 1465 static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t * event){ 1466 return little_endian_read_16(event, 12); 1467 } 1468 /** 1469 * @brief Get field max_frame_size from event RFCOMM_EVENT_CHANNEL_OPENED 1470 * @param event packet 1471 * @return max_frame_size 1472 * @note: btstack_type 2 1473 */ 1474 static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t * event){ 1475 return little_endian_read_16(event, 14); 1476 } 1477 /** 1478 * @brief Get field incoming from event RFCOMM_EVENT_CHANNEL_OPENED 1479 * @param event packet 1480 * @return incoming 1481 * @note: btstack_type 1 1482 */ 1483 static inline uint8_t rfcomm_event_channel_opened_get_incoming(const uint8_t * event){ 1484 return event[16]; 1485 } 1486 1487 /** 1488 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_CLOSED 1489 * @param event packet 1490 * @return rfcomm_cid 1491 * @note: btstack_type 2 1492 */ 1493 static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t * event){ 1494 return little_endian_read_16(event, 2); 1495 } 1496 1497 /** 1498 * @brief Get field bd_addr from event RFCOMM_EVENT_INCOMING_CONNECTION 1499 * @param event packet 1500 * @param Pointer to storage for bd_addr 1501 * @note: btstack_type B 1502 */ 1503 static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1504 reverse_bd_addr(&event[2], bd_addr); 1505 } 1506 /** 1507 * @brief Get field server_channel from event RFCOMM_EVENT_INCOMING_CONNECTION 1508 * @param event packet 1509 * @return server_channel 1510 * @note: btstack_type 1 1511 */ 1512 static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t * event){ 1513 return event[8]; 1514 } 1515 /** 1516 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_INCOMING_CONNECTION 1517 * @param event packet 1518 * @return rfcomm_cid 1519 * @note: btstack_type 2 1520 */ 1521 static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t * event){ 1522 return little_endian_read_16(event, 9); 1523 } 1524 1525 /** 1526 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_LINE_STATUS 1527 * @param event packet 1528 * @return rfcomm_cid 1529 * @note: btstack_type 2 1530 */ 1531 static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t * event){ 1532 return little_endian_read_16(event, 2); 1533 } 1534 /** 1535 * @brief Get field line_status from event RFCOMM_EVENT_REMOTE_LINE_STATUS 1536 * @param event packet 1537 * @return line_status 1538 * @note: btstack_type 1 1539 */ 1540 static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t * event){ 1541 return event[4]; 1542 } 1543 1544 /** 1545 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_MODEM_STATUS 1546 * @param event packet 1547 * @return rfcomm_cid 1548 * @note: btstack_type 2 1549 */ 1550 static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t * event){ 1551 return little_endian_read_16(event, 2); 1552 } 1553 /** 1554 * @brief Get field modem_status from event RFCOMM_EVENT_REMOTE_MODEM_STATUS 1555 * @param event packet 1556 * @return modem_status 1557 * @note: btstack_type 1 1558 */ 1559 static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t * event){ 1560 return event[4]; 1561 } 1562 1563 /** 1564 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CAN_SEND_NOW 1565 * @param event packet 1566 * @return rfcomm_cid 1567 * @note: btstack_type 2 1568 */ 1569 static inline uint16_t rfcomm_event_can_send_now_get_rfcomm_cid(const uint8_t * event){ 1570 return little_endian_read_16(event, 2); 1571 } 1572 1573 /** 1574 * @brief Get field status from event SDP_EVENT_QUERY_COMPLETE 1575 * @param event packet 1576 * @return status 1577 * @note: btstack_type 1 1578 */ 1579 static inline uint8_t sdp_event_query_complete_get_status(const uint8_t * event){ 1580 return event[2]; 1581 } 1582 1583 /** 1584 * @brief Get field rfcomm_channel from event SDP_EVENT_QUERY_RFCOMM_SERVICE 1585 * @param event packet 1586 * @return rfcomm_channel 1587 * @note: btstack_type 1 1588 */ 1589 static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t * event){ 1590 return event[2]; 1591 } 1592 /** 1593 * @brief Get field name from event SDP_EVENT_QUERY_RFCOMM_SERVICE 1594 * @param event packet 1595 * @return name 1596 * @note: btstack_type T 1597 */ 1598 static inline const char * sdp_event_query_rfcomm_service_get_name(const uint8_t * event){ 1599 return (const char *) &event[3]; 1600 } 1601 1602 /** 1603 * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1604 * @param event packet 1605 * @return record_id 1606 * @note: btstack_type 2 1607 */ 1608 static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t * event){ 1609 return little_endian_read_16(event, 2); 1610 } 1611 /** 1612 * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1613 * @param event packet 1614 * @return attribute_id 1615 * @note: btstack_type 2 1616 */ 1617 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t * event){ 1618 return little_endian_read_16(event, 4); 1619 } 1620 /** 1621 * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1622 * @param event packet 1623 * @return attribute_length 1624 * @note: btstack_type 2 1625 */ 1626 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t * event){ 1627 return little_endian_read_16(event, 6); 1628 } 1629 /** 1630 * @brief Get field data_offset from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1631 * @param event packet 1632 * @return data_offset 1633 * @note: btstack_type 2 1634 */ 1635 static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t * event){ 1636 return little_endian_read_16(event, 8); 1637 } 1638 /** 1639 * @brief Get field data from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1640 * @param event packet 1641 * @return data 1642 * @note: btstack_type 1 1643 */ 1644 static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t * event){ 1645 return event[10]; 1646 } 1647 1648 /** 1649 * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1650 * @param event packet 1651 * @return record_id 1652 * @note: btstack_type 2 1653 */ 1654 static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t * event){ 1655 return little_endian_read_16(event, 2); 1656 } 1657 /** 1658 * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1659 * @param event packet 1660 * @return attribute_id 1661 * @note: btstack_type 2 1662 */ 1663 static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t * event){ 1664 return little_endian_read_16(event, 4); 1665 } 1666 /** 1667 * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1668 * @param event packet 1669 * @return attribute_length 1670 * @note: btstack_type L 1671 */ 1672 static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t * event){ 1673 return little_endian_read_16(event, 6); 1674 } 1675 /** 1676 * @brief Get field attribute_value from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1677 * @param event packet 1678 * @return attribute_value 1679 * @note: btstack_type V 1680 */ 1681 static inline const uint8_t * sdp_event_query_attribute_value_get_attribute_value(const uint8_t * event){ 1682 return &event[8]; 1683 } 1684 1685 /** 1686 * @brief Get field total_count from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1687 * @param event packet 1688 * @return total_count 1689 * @note: btstack_type 2 1690 */ 1691 static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t * event){ 1692 return little_endian_read_16(event, 2); 1693 } 1694 /** 1695 * @brief Get field record_index from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1696 * @param event packet 1697 * @return record_index 1698 * @note: btstack_type 2 1699 */ 1700 static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t * event){ 1701 return little_endian_read_16(event, 4); 1702 } 1703 /** 1704 * @brief Get field record_handle from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1705 * @param event packet 1706 * @return record_handle 1707 * @note: btstack_type 4 1708 */ 1709 static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t * event){ 1710 return little_endian_read_32(event, 6); 1711 } 1712 1713 #ifdef ENABLE_BLE 1714 /** 1715 * @brief Get field handle from event GATT_EVENT_QUERY_COMPLETE 1716 * @param event packet 1717 * @return handle 1718 * @note: btstack_type H 1719 */ 1720 static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t * event){ 1721 return little_endian_read_16(event, 2); 1722 } 1723 /** 1724 * @brief Get field status from event GATT_EVENT_QUERY_COMPLETE 1725 * @param event packet 1726 * @return status 1727 * @note: btstack_type 1 1728 */ 1729 static inline uint8_t gatt_event_query_complete_get_status(const uint8_t * event){ 1730 return event[4]; 1731 } 1732 #endif 1733 1734 #ifdef ENABLE_BLE 1735 /** 1736 * @brief Get field handle from event GATT_EVENT_SERVICE_QUERY_RESULT 1737 * @param event packet 1738 * @return handle 1739 * @note: btstack_type H 1740 */ 1741 static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t * event){ 1742 return little_endian_read_16(event, 2); 1743 } 1744 /** 1745 * @brief Get field service from event GATT_EVENT_SERVICE_QUERY_RESULT 1746 * @param event packet 1747 * @param Pointer to storage for service 1748 * @note: btstack_type X 1749 */ 1750 static inline void gatt_event_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1751 gatt_client_deserialize_service(event, 4, service); 1752 } 1753 #endif 1754 1755 #ifdef ENABLE_BLE 1756 /** 1757 * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 1758 * @param event packet 1759 * @return handle 1760 * @note: btstack_type H 1761 */ 1762 static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t * event){ 1763 return little_endian_read_16(event, 2); 1764 } 1765 /** 1766 * @brief Get field characteristic from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 1767 * @param event packet 1768 * @param Pointer to storage for characteristic 1769 * @note: btstack_type Y 1770 */ 1771 static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t * event, gatt_client_characteristic_t * characteristic){ 1772 gatt_client_deserialize_characteristic(event, 4, characteristic); 1773 } 1774 #endif 1775 1776 #ifdef ENABLE_BLE 1777 /** 1778 * @brief Get field handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1779 * @param event packet 1780 * @return handle 1781 * @note: btstack_type H 1782 */ 1783 static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){ 1784 return little_endian_read_16(event, 2); 1785 } 1786 /** 1787 * @brief Get field include_handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1788 * @param event packet 1789 * @return include_handle 1790 * @note: btstack_type 2 1791 */ 1792 static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){ 1793 return little_endian_read_16(event, 4); 1794 } 1795 /** 1796 * @brief Get field service from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1797 * @param event packet 1798 * @param Pointer to storage for service 1799 * @note: btstack_type X 1800 */ 1801 static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1802 gatt_client_deserialize_service(event, 6, service); 1803 } 1804 #endif 1805 1806 #ifdef ENABLE_BLE 1807 /** 1808 * @brief Get field handle from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 1809 * @param event packet 1810 * @return handle 1811 * @note: btstack_type H 1812 */ 1813 static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t * event){ 1814 return little_endian_read_16(event, 2); 1815 } 1816 /** 1817 * @brief Get field characteristic_descriptor from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 1818 * @param event packet 1819 * @param Pointer to storage for characteristic_descriptor 1820 * @note: btstack_type Z 1821 */ 1822 static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t * event, gatt_client_characteristic_descriptor_t * characteristic_descriptor){ 1823 gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor); 1824 } 1825 #endif 1826 1827 #ifdef ENABLE_BLE 1828 /** 1829 * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1830 * @param event packet 1831 * @return handle 1832 * @note: btstack_type H 1833 */ 1834 static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t * event){ 1835 return little_endian_read_16(event, 2); 1836 } 1837 /** 1838 * @brief Get field value_handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1839 * @param event packet 1840 * @return value_handle 1841 * @note: btstack_type 2 1842 */ 1843 static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1844 return little_endian_read_16(event, 4); 1845 } 1846 /** 1847 * @brief Get field value_length from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1848 * @param event packet 1849 * @return value_length 1850 * @note: btstack_type L 1851 */ 1852 static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1853 return little_endian_read_16(event, 6); 1854 } 1855 /** 1856 * @brief Get field value from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1857 * @param event packet 1858 * @return value 1859 * @note: btstack_type V 1860 */ 1861 static inline const uint8_t * gatt_event_characteristic_value_query_result_get_value(const uint8_t * event){ 1862 return &event[8]; 1863 } 1864 #endif 1865 1866 #ifdef ENABLE_BLE 1867 /** 1868 * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1869 * @param event packet 1870 * @return handle 1871 * @note: btstack_type H 1872 */ 1873 static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t * event){ 1874 return little_endian_read_16(event, 2); 1875 } 1876 /** 1877 * @brief Get field value_handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1878 * @param event packet 1879 * @return value_handle 1880 * @note: btstack_type 2 1881 */ 1882 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1883 return little_endian_read_16(event, 4); 1884 } 1885 /** 1886 * @brief Get field value_offset from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1887 * @param event packet 1888 * @return value_offset 1889 * @note: btstack_type 2 1890 */ 1891 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t * event){ 1892 return little_endian_read_16(event, 6); 1893 } 1894 /** 1895 * @brief Get field value_length from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1896 * @param event packet 1897 * @return value_length 1898 * @note: btstack_type L 1899 */ 1900 static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1901 return little_endian_read_16(event, 8); 1902 } 1903 /** 1904 * @brief Get field value from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1905 * @param event packet 1906 * @return value 1907 * @note: btstack_type V 1908 */ 1909 static inline const uint8_t * gatt_event_long_characteristic_value_query_result_get_value(const uint8_t * event){ 1910 return &event[10]; 1911 } 1912 #endif 1913 1914 #ifdef ENABLE_BLE 1915 /** 1916 * @brief Get field handle from event GATT_EVENT_NOTIFICATION 1917 * @param event packet 1918 * @return handle 1919 * @note: btstack_type H 1920 */ 1921 static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t * event){ 1922 return little_endian_read_16(event, 2); 1923 } 1924 /** 1925 * @brief Get field value_handle from event GATT_EVENT_NOTIFICATION 1926 * @param event packet 1927 * @return value_handle 1928 * @note: btstack_type 2 1929 */ 1930 static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t * event){ 1931 return little_endian_read_16(event, 4); 1932 } 1933 /** 1934 * @brief Get field value_length from event GATT_EVENT_NOTIFICATION 1935 * @param event packet 1936 * @return value_length 1937 * @note: btstack_type L 1938 */ 1939 static inline int gatt_event_notification_get_value_length(const uint8_t * event){ 1940 return little_endian_read_16(event, 6); 1941 } 1942 /** 1943 * @brief Get field value from event GATT_EVENT_NOTIFICATION 1944 * @param event packet 1945 * @return value 1946 * @note: btstack_type V 1947 */ 1948 static inline const uint8_t * gatt_event_notification_get_value(const uint8_t * event){ 1949 return &event[8]; 1950 } 1951 #endif 1952 1953 #ifdef ENABLE_BLE 1954 /** 1955 * @brief Get field handle from event GATT_EVENT_INDICATION 1956 * @param event packet 1957 * @return handle 1958 * @note: btstack_type H 1959 */ 1960 static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t * event){ 1961 return little_endian_read_16(event, 2); 1962 } 1963 /** 1964 * @brief Get field value_handle from event GATT_EVENT_INDICATION 1965 * @param event packet 1966 * @return value_handle 1967 * @note: btstack_type 2 1968 */ 1969 static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t * event){ 1970 return little_endian_read_16(event, 4); 1971 } 1972 /** 1973 * @brief Get field value_length from event GATT_EVENT_INDICATION 1974 * @param event packet 1975 * @return value_length 1976 * @note: btstack_type L 1977 */ 1978 static inline int gatt_event_indication_get_value_length(const uint8_t * event){ 1979 return little_endian_read_16(event, 6); 1980 } 1981 /** 1982 * @brief Get field value from event GATT_EVENT_INDICATION 1983 * @param event packet 1984 * @return value 1985 * @note: btstack_type V 1986 */ 1987 static inline const uint8_t * gatt_event_indication_get_value(const uint8_t * event){ 1988 return &event[8]; 1989 } 1990 #endif 1991 1992 #ifdef ENABLE_BLE 1993 /** 1994 * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1995 * @param event packet 1996 * @return handle 1997 * @note: btstack_type H 1998 */ 1999 static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_handle(const uint8_t * event){ 2000 return little_endian_read_16(event, 2); 2001 } 2002 /** 2003 * @brief Get field descriptor_handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2004 * @param event packet 2005 * @return descriptor_handle 2006 * @note: btstack_type 2 2007 */ 2008 static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t * event){ 2009 return little_endian_read_16(event, 4); 2010 } 2011 /** 2012 * @brief Get field descriptor_length from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2013 * @param event packet 2014 * @return descriptor_length 2015 * @note: btstack_type L 2016 */ 2017 static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 2018 return little_endian_read_16(event, 6); 2019 } 2020 /** 2021 * @brief Get field descriptor from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2022 * @param event packet 2023 * @return descriptor 2024 * @note: btstack_type V 2025 */ 2026 static inline const uint8_t * gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 2027 return &event[8]; 2028 } 2029 #endif 2030 2031 #ifdef ENABLE_BLE 2032 /** 2033 * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2034 * @param event packet 2035 * @return handle 2036 * @note: btstack_type H 2037 */ 2038 static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t * event){ 2039 return little_endian_read_16(event, 2); 2040 } 2041 /** 2042 * @brief Get field descriptor_offset from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2043 * @param event packet 2044 * @return descriptor_offset 2045 * @note: btstack_type 2 2046 */ 2047 static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t * event){ 2048 return little_endian_read_16(event, 4); 2049 } 2050 /** 2051 * @brief Get field descriptor_length from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2052 * @param event packet 2053 * @return descriptor_length 2054 * @note: btstack_type L 2055 */ 2056 static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 2057 return little_endian_read_16(event, 6); 2058 } 2059 /** 2060 * @brief Get field descriptor from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 2061 * @param event packet 2062 * @return descriptor 2063 * @note: btstack_type V 2064 */ 2065 static inline const uint8_t * gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 2066 return &event[8]; 2067 } 2068 #endif 2069 2070 #ifdef ENABLE_BLE 2071 /** 2072 * @brief Get field handle from event GATT_EVENT_MTU 2073 * @param event packet 2074 * @return handle 2075 * @note: btstack_type H 2076 */ 2077 static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t * event){ 2078 return little_endian_read_16(event, 2); 2079 } 2080 /** 2081 * @brief Get field MTU from event GATT_EVENT_MTU 2082 * @param event packet 2083 * @return MTU 2084 * @note: btstack_type 2 2085 */ 2086 static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t * event){ 2087 return little_endian_read_16(event, 4); 2088 } 2089 #endif 2090 2091 /** 2092 * @brief Get field handle from event ATT_EVENT_MTU_EXCHANGE_COMPLETE 2093 * @param event packet 2094 * @return handle 2095 * @note: btstack_type H 2096 */ 2097 static inline hci_con_handle_t att_event_mtu_exchange_complete_get_handle(const uint8_t * event){ 2098 return little_endian_read_16(event, 2); 2099 } 2100 /** 2101 * @brief Get field MTU from event ATT_EVENT_MTU_EXCHANGE_COMPLETE 2102 * @param event packet 2103 * @return MTU 2104 * @note: btstack_type 2 2105 */ 2106 static inline uint16_t att_event_mtu_exchange_complete_get_MTU(const uint8_t * event){ 2107 return little_endian_read_16(event, 4); 2108 } 2109 2110 /** 2111 * @brief Get field status from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 2112 * @param event packet 2113 * @return status 2114 * @note: btstack_type 1 2115 */ 2116 static inline uint8_t att_event_handle_value_indication_complete_get_status(const uint8_t * event){ 2117 return event[2]; 2118 } 2119 /** 2120 * @brief Get field conn_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 2121 * @param event packet 2122 * @return conn_handle 2123 * @note: btstack_type H 2124 */ 2125 static inline hci_con_handle_t att_event_handle_value_indication_complete_get_conn_handle(const uint8_t * event){ 2126 return little_endian_read_16(event, 3); 2127 } 2128 /** 2129 * @brief Get field attribute_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 2130 * @param event packet 2131 * @return attribute_handle 2132 * @note: btstack_type 2 2133 */ 2134 static inline uint16_t att_event_handle_value_indication_complete_get_attribute_handle(const uint8_t * event){ 2135 return little_endian_read_16(event, 5); 2136 } 2137 2138 2139 /** 2140 * @brief Get field status from event BNEP_EVENT_SERVICE_REGISTERED 2141 * @param event packet 2142 * @return status 2143 * @note: btstack_type 1 2144 */ 2145 static inline uint8_t bnep_event_service_registered_get_status(const uint8_t * event){ 2146 return event[2]; 2147 } 2148 /** 2149 * @brief Get field service_uuid from event BNEP_EVENT_SERVICE_REGISTERED 2150 * @param event packet 2151 * @return service_uuid 2152 * @note: btstack_type 2 2153 */ 2154 static inline uint16_t bnep_event_service_registered_get_service_uuid(const uint8_t * event){ 2155 return little_endian_read_16(event, 3); 2156 } 2157 2158 /** 2159 * @brief Get field status from event BNEP_EVENT_CHANNEL_OPENED 2160 * @param event packet 2161 * @return status 2162 * @note: btstack_type 1 2163 */ 2164 static inline uint8_t bnep_event_channel_opened_get_status(const uint8_t * event){ 2165 return event[2]; 2166 } 2167 /** 2168 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_OPENED 2169 * @param event packet 2170 * @return bnep_cid 2171 * @note: btstack_type 2 2172 */ 2173 static inline uint16_t bnep_event_channel_opened_get_bnep_cid(const uint8_t * event){ 2174 return little_endian_read_16(event, 3); 2175 } 2176 /** 2177 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_OPENED 2178 * @param event packet 2179 * @return source_uuid 2180 * @note: btstack_type 2 2181 */ 2182 static inline uint16_t bnep_event_channel_opened_get_source_uuid(const uint8_t * event){ 2183 return little_endian_read_16(event, 5); 2184 } 2185 /** 2186 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_OPENED 2187 * @param event packet 2188 * @return destination_uuid 2189 * @note: btstack_type 2 2190 */ 2191 static inline uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t * event){ 2192 return little_endian_read_16(event, 7); 2193 } 2194 /** 2195 * @brief Get field mtu from event BNEP_EVENT_CHANNEL_OPENED 2196 * @param event packet 2197 * @return mtu 2198 * @note: btstack_type 2 2199 */ 2200 static inline uint16_t bnep_event_channel_opened_get_mtu(const uint8_t * event){ 2201 return little_endian_read_16(event, 9); 2202 } 2203 /** 2204 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_OPENED 2205 * @param event packet 2206 * @param Pointer to storage for remote_address 2207 * @note: btstack_type B 2208 */ 2209 static inline void bnep_event_channel_opened_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 2210 reverse_bd_addr(&event[11], remote_address); 2211 } 2212 2213 /** 2214 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_CLOSED 2215 * @param event packet 2216 * @return bnep_cid 2217 * @note: btstack_type 2 2218 */ 2219 static inline uint16_t bnep_event_channel_closed_get_bnep_cid(const uint8_t * event){ 2220 return little_endian_read_16(event, 2); 2221 } 2222 /** 2223 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_CLOSED 2224 * @param event packet 2225 * @return source_uuid 2226 * @note: btstack_type 2 2227 */ 2228 static inline uint16_t bnep_event_channel_closed_get_source_uuid(const uint8_t * event){ 2229 return little_endian_read_16(event, 4); 2230 } 2231 /** 2232 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_CLOSED 2233 * @param event packet 2234 * @return destination_uuid 2235 * @note: btstack_type 2 2236 */ 2237 static inline uint16_t bnep_event_channel_closed_get_destination_uuid(const uint8_t * event){ 2238 return little_endian_read_16(event, 6); 2239 } 2240 /** 2241 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_CLOSED 2242 * @param event packet 2243 * @param Pointer to storage for remote_address 2244 * @note: btstack_type B 2245 */ 2246 static inline void bnep_event_channel_closed_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 2247 reverse_bd_addr(&event[8], remote_address); 2248 } 2249 2250 /** 2251 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_TIMEOUT 2252 * @param event packet 2253 * @return bnep_cid 2254 * @note: btstack_type 2 2255 */ 2256 static inline uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t * event){ 2257 return little_endian_read_16(event, 2); 2258 } 2259 /** 2260 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT 2261 * @param event packet 2262 * @return source_uuid 2263 * @note: btstack_type 2 2264 */ 2265 static inline uint16_t bnep_event_channel_timeout_get_source_uuid(const uint8_t * event){ 2266 return little_endian_read_16(event, 4); 2267 } 2268 /** 2269 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT 2270 * @param event packet 2271 * @return destination_uuid 2272 * @note: btstack_type 2 2273 */ 2274 static inline uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t * event){ 2275 return little_endian_read_16(event, 6); 2276 } 2277 /** 2278 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_TIMEOUT 2279 * @param event packet 2280 * @param Pointer to storage for remote_address 2281 * @note: btstack_type B 2282 */ 2283 static inline void bnep_event_channel_timeout_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 2284 reverse_bd_addr(&event[8], remote_address); 2285 } 2286 /** 2287 * @brief Get field channel_state from event BNEP_EVENT_CHANNEL_TIMEOUT 2288 * @param event packet 2289 * @return channel_state 2290 * @note: btstack_type 1 2291 */ 2292 static inline uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t * event){ 2293 return event[14]; 2294 } 2295 2296 /** 2297 * @brief Get field bnep_cid from event BNEP_EVENT_CAN_SEND_NOW 2298 * @param event packet 2299 * @return bnep_cid 2300 * @note: btstack_type 2 2301 */ 2302 static inline uint16_t bnep_event_can_send_now_get_bnep_cid(const uint8_t * event){ 2303 return little_endian_read_16(event, 2); 2304 } 2305 /** 2306 * @brief Get field source_uuid from event BNEP_EVENT_CAN_SEND_NOW 2307 * @param event packet 2308 * @return source_uuid 2309 * @note: btstack_type 2 2310 */ 2311 static inline uint16_t bnep_event_can_send_now_get_source_uuid(const uint8_t * event){ 2312 return little_endian_read_16(event, 4); 2313 } 2314 /** 2315 * @brief Get field destination_uuid from event BNEP_EVENT_CAN_SEND_NOW 2316 * @param event packet 2317 * @return destination_uuid 2318 * @note: btstack_type 2 2319 */ 2320 static inline uint16_t bnep_event_can_send_now_get_destination_uuid(const uint8_t * event){ 2321 return little_endian_read_16(event, 6); 2322 } 2323 /** 2324 * @brief Get field remote_address from event BNEP_EVENT_CAN_SEND_NOW 2325 * @param event packet 2326 * @param Pointer to storage for remote_address 2327 * @note: btstack_type B 2328 */ 2329 static inline void bnep_event_can_send_now_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 2330 reverse_bd_addr(&event[8], remote_address); 2331 } 2332 2333 #ifdef ENABLE_BLE 2334 /** 2335 * @brief Get field handle from event SM_EVENT_JUST_WORKS_REQUEST 2336 * @param event packet 2337 * @return handle 2338 * @note: btstack_type H 2339 */ 2340 static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t * event){ 2341 return little_endian_read_16(event, 2); 2342 } 2343 /** 2344 * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_REQUEST 2345 * @param event packet 2346 * @return addr_type 2347 * @note: btstack_type 1 2348 */ 2349 static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t * event){ 2350 return event[4]; 2351 } 2352 /** 2353 * @brief Get field address from event SM_EVENT_JUST_WORKS_REQUEST 2354 * @param event packet 2355 * @param Pointer to storage for address 2356 * @note: btstack_type B 2357 */ 2358 static inline void sm_event_just_works_request_get_address(const uint8_t * event, bd_addr_t address){ 2359 reverse_bd_addr(&event[5], address); 2360 } 2361 #endif 2362 2363 #ifdef ENABLE_BLE 2364 /** 2365 * @brief Get field handle from event SM_EVENT_JUST_WORKS_CANCEL 2366 * @param event packet 2367 * @return handle 2368 * @note: btstack_type H 2369 */ 2370 static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t * event){ 2371 return little_endian_read_16(event, 2); 2372 } 2373 /** 2374 * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_CANCEL 2375 * @param event packet 2376 * @return addr_type 2377 * @note: btstack_type 1 2378 */ 2379 static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t * event){ 2380 return event[4]; 2381 } 2382 /** 2383 * @brief Get field address from event SM_EVENT_JUST_WORKS_CANCEL 2384 * @param event packet 2385 * @param Pointer to storage for address 2386 * @note: btstack_type B 2387 */ 2388 static inline void sm_event_just_works_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2389 reverse_bd_addr(&event[5], address); 2390 } 2391 #endif 2392 2393 #ifdef ENABLE_BLE 2394 /** 2395 * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2396 * @param event packet 2397 * @return handle 2398 * @note: btstack_type H 2399 */ 2400 static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t * event){ 2401 return little_endian_read_16(event, 2); 2402 } 2403 /** 2404 * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2405 * @param event packet 2406 * @return addr_type 2407 * @note: btstack_type 1 2408 */ 2409 static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t * event){ 2410 return event[4]; 2411 } 2412 /** 2413 * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2414 * @param event packet 2415 * @param Pointer to storage for address 2416 * @note: btstack_type B 2417 */ 2418 static inline void sm_event_passkey_display_number_get_address(const uint8_t * event, bd_addr_t address){ 2419 reverse_bd_addr(&event[5], address); 2420 } 2421 /** 2422 * @brief Get field passkey from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2423 * @param event packet 2424 * @return passkey 2425 * @note: btstack_type 4 2426 */ 2427 static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t * event){ 2428 return little_endian_read_32(event, 11); 2429 } 2430 #endif 2431 2432 #ifdef ENABLE_BLE 2433 /** 2434 * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2435 * @param event packet 2436 * @return handle 2437 * @note: btstack_type H 2438 */ 2439 static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t * event){ 2440 return little_endian_read_16(event, 2); 2441 } 2442 /** 2443 * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2444 * @param event packet 2445 * @return addr_type 2446 * @note: btstack_type 1 2447 */ 2448 static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t * event){ 2449 return event[4]; 2450 } 2451 /** 2452 * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2453 * @param event packet 2454 * @param Pointer to storage for address 2455 * @note: btstack_type B 2456 */ 2457 static inline void sm_event_passkey_display_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2458 reverse_bd_addr(&event[5], address); 2459 } 2460 #endif 2461 2462 #ifdef ENABLE_BLE 2463 /** 2464 * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_NUMBER 2465 * @param event packet 2466 * @return handle 2467 * @note: btstack_type H 2468 */ 2469 static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t * event){ 2470 return little_endian_read_16(event, 2); 2471 } 2472 /** 2473 * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_NUMBER 2474 * @param event packet 2475 * @return addr_type 2476 * @note: btstack_type 1 2477 */ 2478 static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t * event){ 2479 return event[4]; 2480 } 2481 /** 2482 * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_NUMBER 2483 * @param event packet 2484 * @param Pointer to storage for address 2485 * @note: btstack_type B 2486 */ 2487 static inline void sm_event_passkey_input_number_get_address(const uint8_t * event, bd_addr_t address){ 2488 reverse_bd_addr(&event[5], address); 2489 } 2490 #endif 2491 2492 #ifdef ENABLE_BLE 2493 /** 2494 * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_CANCEL 2495 * @param event packet 2496 * @return handle 2497 * @note: btstack_type H 2498 */ 2499 static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t * event){ 2500 return little_endian_read_16(event, 2); 2501 } 2502 /** 2503 * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_CANCEL 2504 * @param event packet 2505 * @return addr_type 2506 * @note: btstack_type 1 2507 */ 2508 static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t * event){ 2509 return event[4]; 2510 } 2511 /** 2512 * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_CANCEL 2513 * @param event packet 2514 * @param Pointer to storage for address 2515 * @note: btstack_type B 2516 */ 2517 static inline void sm_event_passkey_input_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2518 reverse_bd_addr(&event[5], address); 2519 } 2520 #endif 2521 2522 #ifdef ENABLE_BLE 2523 /** 2524 * @brief Get field handle from event SM_EVENT_NUMERIC_COMPARISON_REQUEST 2525 * @param event packet 2526 * @return handle 2527 * @note: btstack_type H 2528 */ 2529 static inline hci_con_handle_t sm_event_numeric_comparison_request_get_handle(const uint8_t * event){ 2530 return little_endian_read_16(event, 2); 2531 } 2532 /** 2533 * @brief Get field addr_type from event SM_EVENT_NUMERIC_COMPARISON_REQUEST 2534 * @param event packet 2535 * @return addr_type 2536 * @note: btstack_type 1 2537 */ 2538 static inline uint8_t sm_event_numeric_comparison_request_get_addr_type(const uint8_t * event){ 2539 return event[4]; 2540 } 2541 /** 2542 * @brief Get field address from event SM_EVENT_NUMERIC_COMPARISON_REQUEST 2543 * @param event packet 2544 * @param Pointer to storage for address 2545 * @note: btstack_type B 2546 */ 2547 static inline void sm_event_numeric_comparison_request_get_address(const uint8_t * event, bd_addr_t address){ 2548 reverse_bd_addr(&event[5], address); 2549 } 2550 /** 2551 * @brief Get field passkey from event SM_EVENT_NUMERIC_COMPARISON_REQUEST 2552 * @param event packet 2553 * @return passkey 2554 * @note: btstack_type 4 2555 */ 2556 static inline uint32_t sm_event_numeric_comparison_request_get_passkey(const uint8_t * event){ 2557 return little_endian_read_32(event, 11); 2558 } 2559 #endif 2560 2561 #ifdef ENABLE_BLE 2562 /** 2563 * @brief Get field handle from event SM_EVENT_NUMERIC_COMPARISON_CANCEL 2564 * @param event packet 2565 * @return handle 2566 * @note: btstack_type H 2567 */ 2568 static inline hci_con_handle_t sm_event_numeric_comparison_cancel_get_handle(const uint8_t * event){ 2569 return little_endian_read_16(event, 2); 2570 } 2571 /** 2572 * @brief Get field addr_type from event SM_EVENT_NUMERIC_COMPARISON_CANCEL 2573 * @param event packet 2574 * @return addr_type 2575 * @note: btstack_type 1 2576 */ 2577 static inline uint8_t sm_event_numeric_comparison_cancel_get_addr_type(const uint8_t * event){ 2578 return event[4]; 2579 } 2580 /** 2581 * @brief Get field address from event SM_EVENT_NUMERIC_COMPARISON_CANCEL 2582 * @param event packet 2583 * @param Pointer to storage for address 2584 * @note: btstack_type B 2585 */ 2586 static inline void sm_event_numeric_comparison_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2587 reverse_bd_addr(&event[5], address); 2588 } 2589 #endif 2590 2591 #ifdef ENABLE_BLE 2592 /** 2593 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2594 * @param event packet 2595 * @return handle 2596 * @note: btstack_type H 2597 */ 2598 static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t * event){ 2599 return little_endian_read_16(event, 2); 2600 } 2601 /** 2602 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2603 * @param event packet 2604 * @return addr_type 2605 * @note: btstack_type 1 2606 */ 2607 static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t * event){ 2608 return event[4]; 2609 } 2610 /** 2611 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2612 * @param event packet 2613 * @param Pointer to storage for address 2614 * @note: btstack_type B 2615 */ 2616 static inline void sm_event_identity_resolving_started_get_address(const uint8_t * event, bd_addr_t address){ 2617 reverse_bd_addr(&event[5], address); 2618 } 2619 #endif 2620 2621 #ifdef ENABLE_BLE 2622 /** 2623 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2624 * @param event packet 2625 * @return handle 2626 * @note: btstack_type H 2627 */ 2628 static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t * event){ 2629 return little_endian_read_16(event, 2); 2630 } 2631 /** 2632 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2633 * @param event packet 2634 * @return addr_type 2635 * @note: btstack_type 1 2636 */ 2637 static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t * event){ 2638 return event[4]; 2639 } 2640 /** 2641 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2642 * @param event packet 2643 * @param Pointer to storage for address 2644 * @note: btstack_type B 2645 */ 2646 static inline void sm_event_identity_resolving_failed_get_address(const uint8_t * event, bd_addr_t address){ 2647 reverse_bd_addr(&event[5], address); 2648 } 2649 #endif 2650 2651 #ifdef ENABLE_BLE 2652 /** 2653 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2654 * @param event packet 2655 * @return handle 2656 * @note: btstack_type H 2657 */ 2658 static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t * event){ 2659 return little_endian_read_16(event, 2); 2660 } 2661 /** 2662 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2663 * @param event packet 2664 * @return addr_type 2665 * @note: btstack_type 1 2666 */ 2667 static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t * event){ 2668 return event[4]; 2669 } 2670 /** 2671 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2672 * @param event packet 2673 * @param Pointer to storage for address 2674 * @note: btstack_type B 2675 */ 2676 static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t * event, bd_addr_t address){ 2677 reverse_bd_addr(&event[5], address); 2678 } 2679 /** 2680 * @brief Get field identity_addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2681 * @param event packet 2682 * @return identity_addr_type 2683 * @note: btstack_type 1 2684 */ 2685 static inline uint8_t sm_event_identity_resolving_succeeded_get_identity_addr_type(const uint8_t * event){ 2686 return event[11]; 2687 } 2688 /** 2689 * @brief Get field identity_address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2690 * @param event packet 2691 * @param Pointer to storage for identity_address 2692 * @note: btstack_type B 2693 */ 2694 static inline void sm_event_identity_resolving_succeeded_get_identity_address(const uint8_t * event, bd_addr_t identity_address){ 2695 reverse_bd_addr(&event[12], identity_address); 2696 } 2697 /** 2698 * @brief Get field index_internal from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2699 * @param event packet 2700 * @return index_internal 2701 * @note: btstack_type 2 2702 */ 2703 static inline uint16_t sm_event_identity_resolving_succeeded_get_index_internal(const uint8_t * event){ 2704 return little_endian_read_16(event, 18); 2705 } 2706 #endif 2707 2708 #ifdef ENABLE_BLE 2709 /** 2710 * @brief Get field handle from event SM_EVENT_AUTHORIZATION_REQUEST 2711 * @param event packet 2712 * @return handle 2713 * @note: btstack_type H 2714 */ 2715 static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t * event){ 2716 return little_endian_read_16(event, 2); 2717 } 2718 /** 2719 * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_REQUEST 2720 * @param event packet 2721 * @return addr_type 2722 * @note: btstack_type 1 2723 */ 2724 static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t * event){ 2725 return event[4]; 2726 } 2727 /** 2728 * @brief Get field address from event SM_EVENT_AUTHORIZATION_REQUEST 2729 * @param event packet 2730 * @param Pointer to storage for address 2731 * @note: btstack_type B 2732 */ 2733 static inline void sm_event_authorization_request_get_address(const uint8_t * event, bd_addr_t address){ 2734 reverse_bd_addr(&event[5], address); 2735 } 2736 #endif 2737 2738 #ifdef ENABLE_BLE 2739 /** 2740 * @brief Get field handle from event SM_EVENT_AUTHORIZATION_RESULT 2741 * @param event packet 2742 * @return handle 2743 * @note: btstack_type H 2744 */ 2745 static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t * event){ 2746 return little_endian_read_16(event, 2); 2747 } 2748 /** 2749 * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_RESULT 2750 * @param event packet 2751 * @return addr_type 2752 * @note: btstack_type 1 2753 */ 2754 static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t * event){ 2755 return event[4]; 2756 } 2757 /** 2758 * @brief Get field address from event SM_EVENT_AUTHORIZATION_RESULT 2759 * @param event packet 2760 * @param Pointer to storage for address 2761 * @note: btstack_type B 2762 */ 2763 static inline void sm_event_authorization_result_get_address(const uint8_t * event, bd_addr_t address){ 2764 reverse_bd_addr(&event[5], address); 2765 } 2766 /** 2767 * @brief Get field authorization_result from event SM_EVENT_AUTHORIZATION_RESULT 2768 * @param event packet 2769 * @return authorization_result 2770 * @note: btstack_type 1 2771 */ 2772 static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t * event){ 2773 return event[11]; 2774 } 2775 #endif 2776 2777 #ifdef ENABLE_BLE 2778 /** 2779 * @brief Get field handle from event SM_EVENT_KEYPRESS_NOTIFICATION 2780 * @param event packet 2781 * @return handle 2782 * @note: btstack_type H 2783 */ 2784 static inline hci_con_handle_t sm_event_keypress_notification_get_handle(const uint8_t * event){ 2785 return little_endian_read_16(event, 2); 2786 } 2787 /** 2788 * @brief Get field action from event SM_EVENT_KEYPRESS_NOTIFICATION 2789 * @param event packet 2790 * @return action 2791 * @note: btstack_type 1 2792 */ 2793 static inline uint8_t sm_event_keypress_notification_get_action(const uint8_t * event){ 2794 return event[4]; 2795 } 2796 #endif 2797 2798 #ifdef ENABLE_BLE 2799 /** 2800 * @brief Get field handle from event SM_EVENT_IDENTITY_CREATED 2801 * @param event packet 2802 * @return handle 2803 * @note: btstack_type H 2804 */ 2805 static inline hci_con_handle_t sm_event_identity_created_get_handle(const uint8_t * event){ 2806 return little_endian_read_16(event, 2); 2807 } 2808 /** 2809 * @brief Get field addr_type from event SM_EVENT_IDENTITY_CREATED 2810 * @param event packet 2811 * @return addr_type 2812 * @note: btstack_type 1 2813 */ 2814 static inline uint8_t sm_event_identity_created_get_addr_type(const uint8_t * event){ 2815 return event[4]; 2816 } 2817 /** 2818 * @brief Get field address from event SM_EVENT_IDENTITY_CREATED 2819 * @param event packet 2820 * @param Pointer to storage for address 2821 * @note: btstack_type B 2822 */ 2823 static inline void sm_event_identity_created_get_address(const uint8_t * event, bd_addr_t address){ 2824 reverse_bd_addr(&event[5], address); 2825 } 2826 /** 2827 * @brief Get field identity_addr_type from event SM_EVENT_IDENTITY_CREATED 2828 * @param event packet 2829 * @return identity_addr_type 2830 * @note: btstack_type 1 2831 */ 2832 static inline uint8_t sm_event_identity_created_get_identity_addr_type(const uint8_t * event){ 2833 return event[11]; 2834 } 2835 /** 2836 * @brief Get field identity_address from event SM_EVENT_IDENTITY_CREATED 2837 * @param event packet 2838 * @param Pointer to storage for identity_address 2839 * @note: btstack_type B 2840 */ 2841 static inline void sm_event_identity_created_get_identity_address(const uint8_t * event, bd_addr_t identity_address){ 2842 reverse_bd_addr(&event[12], identity_address); 2843 } 2844 #endif 2845 2846 /** 2847 * @brief Get field handle from event GAP_EVENT_SECURITY_LEVEL 2848 * @param event packet 2849 * @return handle 2850 * @note: btstack_type H 2851 */ 2852 static inline hci_con_handle_t gap_event_security_level_get_handle(const uint8_t * event){ 2853 return little_endian_read_16(event, 2); 2854 } 2855 /** 2856 * @brief Get field security_level from event GAP_EVENT_SECURITY_LEVEL 2857 * @param event packet 2858 * @return security_level 2859 * @note: btstack_type 1 2860 */ 2861 static inline uint8_t gap_event_security_level_get_security_level(const uint8_t * event){ 2862 return event[4]; 2863 } 2864 2865 /** 2866 * @brief Get field status from event GAP_EVENT_DEDICATED_BONDING_COMPLETED 2867 * @param event packet 2868 * @return status 2869 * @note: btstack_type 1 2870 */ 2871 static inline uint8_t gap_event_dedicated_bonding_completed_get_status(const uint8_t * event){ 2872 return event[2]; 2873 } 2874 /** 2875 * @brief Get field address from event GAP_EVENT_DEDICATED_BONDING_COMPLETED 2876 * @param event packet 2877 * @param Pointer to storage for address 2878 * @note: btstack_type B 2879 */ 2880 static inline void gap_event_dedicated_bonding_completed_get_address(const uint8_t * event, bd_addr_t address){ 2881 reverse_bd_addr(&event[3], address); 2882 } 2883 2884 /** 2885 * @brief Get field advertising_event_type from event GAP_EVENT_ADVERTISING_REPORT 2886 * @param event packet 2887 * @return advertising_event_type 2888 * @note: btstack_type 1 2889 */ 2890 static inline uint8_t gap_event_advertising_report_get_advertising_event_type(const uint8_t * event){ 2891 return event[2]; 2892 } 2893 /** 2894 * @brief Get field address_type from event GAP_EVENT_ADVERTISING_REPORT 2895 * @param event packet 2896 * @return address_type 2897 * @note: btstack_type 1 2898 */ 2899 static inline uint8_t gap_event_advertising_report_get_address_type(const uint8_t * event){ 2900 return event[3]; 2901 } 2902 /** 2903 * @brief Get field address from event GAP_EVENT_ADVERTISING_REPORT 2904 * @param event packet 2905 * @param Pointer to storage for address 2906 * @note: btstack_type B 2907 */ 2908 static inline void gap_event_advertising_report_get_address(const uint8_t * event, bd_addr_t address){ 2909 reverse_bd_addr(&event[4], address); 2910 } 2911 /** 2912 * @brief Get field rssi from event GAP_EVENT_ADVERTISING_REPORT 2913 * @param event packet 2914 * @return rssi 2915 * @note: btstack_type 1 2916 */ 2917 static inline uint8_t gap_event_advertising_report_get_rssi(const uint8_t * event){ 2918 return event[10]; 2919 } 2920 /** 2921 * @brief Get field data_length from event GAP_EVENT_ADVERTISING_REPORT 2922 * @param event packet 2923 * @return data_length 2924 * @note: btstack_type J 2925 */ 2926 static inline int gap_event_advertising_report_get_data_length(const uint8_t * event){ 2927 return event[11]; 2928 } 2929 /** 2930 * @brief Get field data from event GAP_EVENT_ADVERTISING_REPORT 2931 * @param event packet 2932 * @return data 2933 * @note: btstack_type V 2934 */ 2935 static inline const uint8_t * gap_event_advertising_report_get_data(const uint8_t * event){ 2936 return &event[12]; 2937 } 2938 2939 /** 2940 * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2941 * @param event packet 2942 * @return status 2943 * @note: btstack_type 1 2944 */ 2945 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){ 2946 return event[3]; 2947 } 2948 /** 2949 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2950 * @param event packet 2951 * @return connection_handle 2952 * @note: btstack_type H 2953 */ 2954 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){ 2955 return little_endian_read_16(event, 4); 2956 } 2957 /** 2958 * @brief Get field role from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2959 * @param event packet 2960 * @return role 2961 * @note: btstack_type 1 2962 */ 2963 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){ 2964 return event[6]; 2965 } 2966 /** 2967 * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2968 * @param event packet 2969 * @return peer_address_type 2970 * @note: btstack_type 1 2971 */ 2972 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){ 2973 return event[7]; 2974 } 2975 /** 2976 * @brief Get field peer_address from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2977 * @param event packet 2978 * @param Pointer to storage for peer_address 2979 * @note: btstack_type B 2980 */ 2981 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){ 2982 reverse_bd_addr(&event[8], peer_address); 2983 } 2984 /** 2985 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2986 * @param event packet 2987 * @return conn_interval 2988 * @note: btstack_type 2 2989 */ 2990 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){ 2991 return little_endian_read_16(event, 14); 2992 } 2993 /** 2994 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2995 * @param event packet 2996 * @return conn_latency 2997 * @note: btstack_type 2 2998 */ 2999 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){ 3000 return little_endian_read_16(event, 16); 3001 } 3002 /** 3003 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 3004 * @param event packet 3005 * @return supervision_timeout 3006 * @note: btstack_type 2 3007 */ 3008 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){ 3009 return little_endian_read_16(event, 18); 3010 } 3011 /** 3012 * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 3013 * @param event packet 3014 * @return master_clock_accuracy 3015 * @note: btstack_type 1 3016 */ 3017 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 3018 return event[20]; 3019 } 3020 3021 /** 3022 * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3023 * @param event packet 3024 * @return status 3025 * @note: btstack_type 1 3026 */ 3027 static inline uint8_t hci_subevent_le_connection_update_complete_get_status(const uint8_t * event){ 3028 return event[3]; 3029 } 3030 /** 3031 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3032 * @param event packet 3033 * @return connection_handle 3034 * @note: btstack_type H 3035 */ 3036 static inline hci_con_handle_t hci_subevent_le_connection_update_complete_get_connection_handle(const uint8_t * event){ 3037 return little_endian_read_16(event, 4); 3038 } 3039 /** 3040 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3041 * @param event packet 3042 * @return conn_interval 3043 * @note: btstack_type 2 3044 */ 3045 static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_interval(const uint8_t * event){ 3046 return little_endian_read_16(event, 6); 3047 } 3048 /** 3049 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3050 * @param event packet 3051 * @return conn_latency 3052 * @note: btstack_type 2 3053 */ 3054 static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_latency(const uint8_t * event){ 3055 return little_endian_read_16(event, 8); 3056 } 3057 /** 3058 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3059 * @param event packet 3060 * @return supervision_timeout 3061 * @note: btstack_type 2 3062 */ 3063 static inline uint16_t hci_subevent_le_connection_update_complete_get_supervision_timeout(const uint8_t * event){ 3064 return little_endian_read_16(event, 10); 3065 } 3066 3067 /** 3068 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3069 * @param event packet 3070 * @return connection_handle 3071 * @note: btstack_type H 3072 */ 3073 // static inline hci_con_handle_t hci_subevent_le_read_remote_used_features_complete_get_connection_handle(const uint8_t * event){ 3074 // not implemented yet 3075 // } 3076 /** 3077 * @brief Get field random_number from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3078 * @param event packet 3079 * @return random_number 3080 * @note: btstack_type D 3081 */ 3082 // static inline const uint8_t * hci_subevent_le_read_remote_used_features_complete_get_random_number(const uint8_t * event){ 3083 // not implemented yet 3084 // } 3085 /** 3086 * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3087 * @param event packet 3088 * @return encryption_diversifier 3089 * @note: btstack_type 2 3090 */ 3091 // static inline uint16_t hci_subevent_le_read_remote_used_features_complete_get_encryption_diversifier(const uint8_t * event){ 3092 // not implemented yet 3093 // } 3094 3095 /** 3096 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3097 * @param event packet 3098 * @return connection_handle 3099 * @note: btstack_type H 3100 */ 3101 // static inline hci_con_handle_t hci_subevent_le_long_term_key_request_get_connection_handle(const uint8_t * event){ 3102 // not implemented yet 3103 // } 3104 /** 3105 * @brief Get field random_number from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3106 * @param event packet 3107 * @return random_number 3108 * @note: btstack_type D 3109 */ 3110 // static inline const uint8_t * hci_subevent_le_long_term_key_request_get_random_number(const uint8_t * event){ 3111 // not implemented yet 3112 // } 3113 /** 3114 * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3115 * @param event packet 3116 * @return encryption_diversifier 3117 * @note: btstack_type 2 3118 */ 3119 // static inline uint16_t hci_subevent_le_long_term_key_request_get_encryption_diversifier(const uint8_t * event){ 3120 // not implemented yet 3121 // } 3122 3123 /** 3124 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3125 * @param event packet 3126 * @return connection_handle 3127 * @note: btstack_type H 3128 */ 3129 static inline hci_con_handle_t hci_subevent_le_remote_connection_parameter_request_get_connection_handle(const uint8_t * event){ 3130 return little_endian_read_16(event, 3); 3131 } 3132 /** 3133 * @brief Get field interval_min from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3134 * @param event packet 3135 * @return interval_min 3136 * @note: btstack_type 2 3137 */ 3138 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_min(const uint8_t * event){ 3139 return little_endian_read_16(event, 5); 3140 } 3141 /** 3142 * @brief Get field interval_max from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3143 * @param event packet 3144 * @return interval_max 3145 * @note: btstack_type 2 3146 */ 3147 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_max(const uint8_t * event){ 3148 return little_endian_read_16(event, 7); 3149 } 3150 /** 3151 * @brief Get field latency from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3152 * @param event packet 3153 * @return latency 3154 * @note: btstack_type 2 3155 */ 3156 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_latency(const uint8_t * event){ 3157 return little_endian_read_16(event, 9); 3158 } 3159 /** 3160 * @brief Get field timeout from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3161 * @param event packet 3162 * @return timeout 3163 * @note: btstack_type 2 3164 */ 3165 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_timeout(const uint8_t * event){ 3166 return little_endian_read_16(event, 11); 3167 } 3168 3169 /** 3170 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3171 * @param event packet 3172 * @return connection_handle 3173 * @note: btstack_type H 3174 */ 3175 static inline hci_con_handle_t hci_subevent_le_data_length_change_get_connection_handle(const uint8_t * event){ 3176 return little_endian_read_16(event, 3); 3177 } 3178 /** 3179 * @brief Get field max_tx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3180 * @param event packet 3181 * @return max_tx_octets 3182 * @note: btstack_type 2 3183 */ 3184 static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_octets(const uint8_t * event){ 3185 return little_endian_read_16(event, 5); 3186 } 3187 /** 3188 * @brief Get field max_tx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3189 * @param event packet 3190 * @return max_tx_time 3191 * @note: btstack_type 2 3192 */ 3193 static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_time(const uint8_t * event){ 3194 return little_endian_read_16(event, 7); 3195 } 3196 /** 3197 * @brief Get field max_rx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3198 * @param event packet 3199 * @return max_rx_octets 3200 * @note: btstack_type 2 3201 */ 3202 static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_octets(const uint8_t * event){ 3203 return little_endian_read_16(event, 9); 3204 } 3205 /** 3206 * @brief Get field max_rx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3207 * @param event packet 3208 * @return max_rx_time 3209 * @note: btstack_type 2 3210 */ 3211 static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_time(const uint8_t * event){ 3212 return little_endian_read_16(event, 11); 3213 } 3214 3215 /** 3216 * @brief Get field status from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3217 * @param event packet 3218 * @return status 3219 * @note: btstack_type 1 3220 */ 3221 static inline uint8_t hci_subevent_le_read_local_p256_public_key_complete_get_status(const uint8_t * event){ 3222 return event[3]; 3223 } 3224 /** 3225 * @brief Get field dhkey_x from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3226 * @param event packet 3227 * @param Pointer to storage for dhkey_x 3228 * @note: btstack_type Q 3229 */ 3230 static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_x(const uint8_t * event, uint8_t * dhkey_x){ 3231 reverse_bytes(&event[4], dhkey_x, 32); 3232 } 3233 /** 3234 * @brief Get field dhkey_y from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3235 * @param event packet 3236 * @param Pointer to storage for dhkey_y 3237 * @note: btstack_type Q 3238 */ 3239 static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_y(const uint8_t * event, uint8_t * dhkey_y){ 3240 reverse_bytes(&event[36], dhkey_y, 32); 3241 } 3242 3243 /** 3244 * @brief Get field status from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3245 * @param event packet 3246 * @return status 3247 * @note: btstack_type 1 3248 */ 3249 static inline uint8_t hci_subevent_le_generate_dhkey_complete_get_status(const uint8_t * event){ 3250 return event[3]; 3251 } 3252 /** 3253 * @brief Get field dhkey_x from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3254 * @param event packet 3255 * @param Pointer to storage for dhkey_x 3256 * @note: btstack_type Q 3257 */ 3258 static inline void hci_subevent_le_generate_dhkey_complete_get_dhkey_x(const uint8_t * event, uint8_t * dhkey_x){ 3259 reverse_bytes(&event[4], dhkey_x, 32); 3260 } 3261 /** 3262 * @brief Get field dhkey_y from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3263 * @param event packet 3264 * @param Pointer to storage for dhkey_y 3265 * @note: btstack_type Q 3266 */ 3267 static inline void hci_subevent_le_generate_dhkey_complete_get_dhkey_y(const uint8_t * event, uint8_t * dhkey_y){ 3268 reverse_bytes(&event[36], dhkey_y, 32); 3269 } 3270 3271 /** 3272 * @brief Get field status from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3273 * @param event packet 3274 * @return status 3275 * @note: btstack_type 1 3276 */ 3277 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_status(const uint8_t * event){ 3278 return event[3]; 3279 } 3280 /** 3281 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3282 * @param event packet 3283 * @return connection_handle 3284 * @note: btstack_type H 3285 */ 3286 static inline hci_con_handle_t hci_subevent_le_enhanced_connection_complete_get_connection_handle(const uint8_t * event){ 3287 return little_endian_read_16(event, 4); 3288 } 3289 /** 3290 * @brief Get field role from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3291 * @param event packet 3292 * @return role 3293 * @note: btstack_type 1 3294 */ 3295 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_role(const uint8_t * event){ 3296 return event[6]; 3297 } 3298 /** 3299 * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3300 * @param event packet 3301 * @return peer_address_type 3302 * @note: btstack_type 1 3303 */ 3304 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_peer_address_type(const uint8_t * event){ 3305 return event[7]; 3306 } 3307 /** 3308 * @brief Get field perr_addresss from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3309 * @param event packet 3310 * @param Pointer to storage for perr_addresss 3311 * @note: btstack_type B 3312 */ 3313 static inline void hci_subevent_le_enhanced_connection_complete_get_perr_addresss(const uint8_t * event, bd_addr_t perr_addresss){ 3314 reverse_bd_addr(&event[8], perr_addresss); 3315 } 3316 /** 3317 * @brief Get field local_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3318 * @param event packet 3319 * @param Pointer to storage for local_resolvable_private_addres 3320 * @note: btstack_type B 3321 */ 3322 static inline void hci_subevent_le_enhanced_connection_complete_get_local_resolvable_private_addres(const uint8_t * event, bd_addr_t local_resolvable_private_addres){ 3323 reverse_bd_addr(&event[14], local_resolvable_private_addres); 3324 } 3325 /** 3326 * @brief Get field peer_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3327 * @param event packet 3328 * @param Pointer to storage for peer_resolvable_private_addres 3329 * @note: btstack_type B 3330 */ 3331 static inline void hci_subevent_le_enhanced_connection_complete_get_peer_resolvable_private_addres(const uint8_t * event, bd_addr_t peer_resolvable_private_addres){ 3332 reverse_bd_addr(&event[20], peer_resolvable_private_addres); 3333 } 3334 /** 3335 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3336 * @param event packet 3337 * @return conn_interval 3338 * @note: btstack_type 2 3339 */ 3340 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_interval(const uint8_t * event){ 3341 return little_endian_read_16(event, 26); 3342 } 3343 /** 3344 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3345 * @param event packet 3346 * @return conn_latency 3347 * @note: btstack_type 2 3348 */ 3349 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_latency(const uint8_t * event){ 3350 return little_endian_read_16(event, 28); 3351 } 3352 /** 3353 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3354 * @param event packet 3355 * @return supervision_timeout 3356 * @note: btstack_type 2 3357 */ 3358 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_supervision_timeout(const uint8_t * event){ 3359 return little_endian_read_16(event, 30); 3360 } 3361 /** 3362 * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3363 * @param event packet 3364 * @return master_clock_accuracy 3365 * @note: btstack_type 1 3366 */ 3367 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 3368 return event[32]; 3369 } 3370 3371 /** 3372 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 3373 * @param event packet 3374 * @return status 3375 * @note: btstack_type 1 3376 */ 3377 static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t * event){ 3378 return event[3]; 3379 } 3380 3381 /** 3382 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 3383 * @param event packet 3384 * @return status 3385 * @note: btstack_type 1 3386 */ 3387 static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t * event){ 3388 return event[3]; 3389 } 3390 3391 /** 3392 * @brief Get field status from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 3393 * @param event packet 3394 * @return status 3395 * @note: btstack_type 1 3396 */ 3397 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){ 3398 return event[3]; 3399 } 3400 /** 3401 * @brief Get field handle from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 3402 * @param event packet 3403 * @return handle 3404 * @note: btstack_type H 3405 */ 3406 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){ 3407 return little_endian_read_16(event, 4); 3408 } 3409 3410 /** 3411 * @brief Get field status from event HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 3412 * @param event packet 3413 * @return status 3414 * @note: btstack_type 1 3415 */ 3416 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){ 3417 return event[3]; 3418 } 3419 3420 3421 /** 3422 * @brief Get field gain from event HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 3423 * @param event packet 3424 * @return gain 3425 * @note: btstack_type 1 3426 */ 3427 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){ 3428 return event[3]; 3429 } 3430 3431 /** 3432 * @brief Get field gain from event HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 3433 * @param event packet 3434 * @return gain 3435 * @note: btstack_type 1 3436 */ 3437 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){ 3438 return event[3]; 3439 } 3440 3441 /** 3442 * @brief Get field value_length from event HSP_SUBEVENT_HS_COMMAND 3443 * @param event packet 3444 * @return value_length 3445 * @note: btstack_type J 3446 */ 3447 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){ 3448 return event[3]; 3449 } 3450 /** 3451 * @brief Get field value from event HSP_SUBEVENT_HS_COMMAND 3452 * @param event packet 3453 * @return value 3454 * @note: btstack_type V 3455 */ 3456 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){ 3457 return &event[4]; 3458 } 3459 3460 /** 3461 * @brief Get field value_length from event HSP_SUBEVENT_AG_INDICATION 3462 * @param event packet 3463 * @return value_length 3464 * @note: btstack_type J 3465 */ 3466 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){ 3467 return event[3]; 3468 } 3469 /** 3470 * @brief Get field value from event HSP_SUBEVENT_AG_INDICATION 3471 * @param event packet 3472 * @return value 3473 * @note: btstack_type V 3474 */ 3475 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){ 3476 return &event[4]; 3477 } 3478 3479 /** 3480 * @brief Get field status from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3481 * @param event packet 3482 * @return status 3483 * @note: btstack_type 1 3484 */ 3485 static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t * event){ 3486 return event[3]; 3487 } 3488 /** 3489 * @brief Get field con_handle from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3490 * @param event packet 3491 * @return con_handle 3492 * @note: btstack_type H 3493 */ 3494 static inline hci_con_handle_t hfp_subevent_service_level_connection_established_get_con_handle(const uint8_t * event){ 3495 return little_endian_read_16(event, 4); 3496 } 3497 /** 3498 * @brief Get field bd_addr from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3499 * @param event packet 3500 * @param Pointer to storage for bd_addr 3501 * @note: btstack_type B 3502 */ 3503 static inline void hfp_subevent_service_level_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3504 reverse_bd_addr(&event[6], bd_addr); 3505 } 3506 3507 3508 /** 3509 * @brief Get field status from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3510 * @param event packet 3511 * @return status 3512 * @note: btstack_type 1 3513 */ 3514 static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){ 3515 return event[3]; 3516 } 3517 /** 3518 * @brief Get field handle from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3519 * @param event packet 3520 * @return handle 3521 * @note: btstack_type H 3522 */ 3523 static inline hci_con_handle_t hfp_subevent_audio_connection_established_get_handle(const uint8_t * event){ 3524 return little_endian_read_16(event, 4); 3525 } 3526 /** 3527 * @brief Get field bd_addr from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3528 * @param event packet 3529 * @param Pointer to storage for bd_addr 3530 * @note: btstack_type B 3531 */ 3532 static inline void hfp_subevent_audio_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3533 reverse_bd_addr(&event[6], bd_addr); 3534 } 3535 /** 3536 * @brief Get field negotiated_codec from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3537 * @param event packet 3538 * @return negotiated_codec 3539 * @note: btstack_type 1 3540 */ 3541 static inline uint8_t hfp_subevent_audio_connection_established_get_negotiated_codec(const uint8_t * event){ 3542 return event[12]; 3543 } 3544 3545 3546 /** 3547 * @brief Get field status from event HFP_SUBEVENT_COMPLETE 3548 * @param event packet 3549 * @return status 3550 * @note: btstack_type 1 3551 */ 3552 static inline uint8_t hfp_subevent_complete_get_status(const uint8_t * event){ 3553 return event[3]; 3554 } 3555 3556 /** 3557 * @brief Get field indicator_index from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3558 * @param event packet 3559 * @return indicator_index 3560 * @note: btstack_type 1 3561 */ 3562 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t * event){ 3563 return event[3]; 3564 } 3565 /** 3566 * @brief Get field indicator_status from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3567 * @param event packet 3568 * @return indicator_status 3569 * @note: btstack_type 1 3570 */ 3571 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t * event){ 3572 return event[4]; 3573 } 3574 /** 3575 * @brief Get field indicator_name from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3576 * @param event packet 3577 * @return indicator_name 3578 * @note: btstack_type T 3579 */ 3580 static inline const char * hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t * event){ 3581 return (const char *) &event[5]; 3582 } 3583 3584 /** 3585 * @brief Get field network_operator_mode from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3586 * @param event packet 3587 * @return network_operator_mode 3588 * @note: btstack_type 1 3589 */ 3590 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t * event){ 3591 return event[3]; 3592 } 3593 /** 3594 * @brief Get field network_operator_format from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3595 * @param event packet 3596 * @return network_operator_format 3597 * @note: btstack_type 1 3598 */ 3599 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t * event){ 3600 return event[4]; 3601 } 3602 /** 3603 * @brief Get field network_operator_name from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3604 * @param event packet 3605 * @return network_operator_name 3606 * @note: btstack_type T 3607 */ 3608 static inline const char * hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t * event){ 3609 return (const char *) &event[5]; 3610 } 3611 3612 /** 3613 * @brief Get field error from event HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 3614 * @param event packet 3615 * @return error 3616 * @note: btstack_type 1 3617 */ 3618 static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t * event){ 3619 return event[3]; 3620 } 3621 3622 3623 3624 3625 /** 3626 * @brief Get field number from event HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 3627 * @param event packet 3628 * @return number 3629 * @note: btstack_type T 3630 */ 3631 static inline const char * hfp_subevent_place_call_with_number_get_number(const uint8_t * event){ 3632 return (const char *) &event[3]; 3633 } 3634 3635 3636 /** 3637 * @brief Get field number from event HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 3638 * @param event packet 3639 * @return number 3640 * @note: btstack_type T 3641 */ 3642 static inline const char * hfp_subevent_number_for_voice_tag_get_number(const uint8_t * event){ 3643 return (const char *) &event[3]; 3644 } 3645 3646 /** 3647 * @brief Get field dtmf from event HFP_SUBEVENT_TRANSMIT_DTMF_CODES 3648 * @param event packet 3649 * @return dtmf 3650 * @note: btstack_type T 3651 */ 3652 static inline const char * hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t * event){ 3653 return (const char *) &event[3]; 3654 } 3655 3656 3657 3658 3659 /** 3660 * @brief Get field status from event HFP_SUBEVENT_SPEAKER_VOLUME 3661 * @param event packet 3662 * @return status 3663 * @note: btstack_type 1 3664 */ 3665 static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t * event){ 3666 return event[3]; 3667 } 3668 /** 3669 * @brief Get field gain from event HFP_SUBEVENT_SPEAKER_VOLUME 3670 * @param event packet 3671 * @return gain 3672 * @note: btstack_type 1 3673 */ 3674 static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t * event){ 3675 return event[4]; 3676 } 3677 3678 /** 3679 * @brief Get field status from event HFP_SUBEVENT_MICROPHONE_VOLUME 3680 * @param event packet 3681 * @return status 3682 * @note: btstack_type 1 3683 */ 3684 static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t * event){ 3685 return event[3]; 3686 } 3687 /** 3688 * @brief Get field gain from event HFP_SUBEVENT_MICROPHONE_VOLUME 3689 * @param event packet 3690 * @return gain 3691 * @note: btstack_type 1 3692 */ 3693 static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t * event){ 3694 return event[4]; 3695 } 3696 3697 /** 3698 * @brief Get field type from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 3699 * @param event packet 3700 * @return type 3701 * @note: btstack_type 1 3702 */ 3703 static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t * event){ 3704 return event[3]; 3705 } 3706 /** 3707 * @brief Get field number from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 3708 * @param event packet 3709 * @return number 3710 * @note: btstack_type T 3711 */ 3712 static inline const char * hfp_subevent_call_waiting_notification_get_number(const uint8_t * event){ 3713 return (const char *) &event[4]; 3714 } 3715 3716 /** 3717 * @brief Get field type from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 3718 * @param event packet 3719 * @return type 3720 * @note: btstack_type 1 3721 */ 3722 static inline uint8_t hfp_subevent_calling_line_indetification_notification_get_type(const uint8_t * event){ 3723 return event[3]; 3724 } 3725 /** 3726 * @brief Get field number from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 3727 * @param event packet 3728 * @return number 3729 * @note: btstack_type T 3730 */ 3731 static inline const char * hfp_subevent_calling_line_indetification_notification_get_number(const uint8_t * event){ 3732 return (const char *) &event[4]; 3733 } 3734 3735 /** 3736 * @brief Get field clcc_idx from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3737 * @param event packet 3738 * @return clcc_idx 3739 * @note: btstack_type 1 3740 */ 3741 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t * event){ 3742 return event[3]; 3743 } 3744 /** 3745 * @brief Get field clcc_dir from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3746 * @param event packet 3747 * @return clcc_dir 3748 * @note: btstack_type 1 3749 */ 3750 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t * event){ 3751 return event[4]; 3752 } 3753 /** 3754 * @brief Get field clcc_status from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3755 * @param event packet 3756 * @return clcc_status 3757 * @note: btstack_type 1 3758 */ 3759 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t * event){ 3760 return event[5]; 3761 } 3762 /** 3763 * @brief Get field clcc_mpty from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3764 * @param event packet 3765 * @return clcc_mpty 3766 * @note: btstack_type 1 3767 */ 3768 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t * event){ 3769 return event[6]; 3770 } 3771 /** 3772 * @brief Get field bnip_type from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3773 * @param event packet 3774 * @return bnip_type 3775 * @note: btstack_type 1 3776 */ 3777 static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t * event){ 3778 return event[7]; 3779 } 3780 /** 3781 * @brief Get field bnip_number from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3782 * @param event packet 3783 * @return bnip_number 3784 * @note: btstack_type T 3785 */ 3786 static inline const char * hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t * event){ 3787 return (const char *) &event[8]; 3788 } 3789 3790 /** 3791 * @brief Get field status from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3792 * @param event packet 3793 * @return status 3794 * @note: btstack_type 1 3795 */ 3796 static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t * event){ 3797 return event[3]; 3798 } 3799 /** 3800 * @brief Get field bnip_type from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3801 * @param event packet 3802 * @return bnip_type 3803 * @note: btstack_type 1 3804 */ 3805 static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t * event){ 3806 return event[4]; 3807 } 3808 /** 3809 * @brief Get field bnip_number from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3810 * @param event packet 3811 * @return bnip_number 3812 * @note: btstack_type T 3813 */ 3814 static inline const char * hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t * event){ 3815 return (const char *) &event[5]; 3816 } 3817 3818 /** 3819 * @brief Get field value from event HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 3820 * @param event packet 3821 * @return value 3822 * @note: btstack_type T 3823 */ 3824 static inline const char * hfp_subevent_response_and_hold_status_get_value(const uint8_t * event){ 3825 return (const char *) &event[3]; 3826 } 3827 3828 #ifdef ENABLE_BLE 3829 /** 3830 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_CONNECTED 3831 * @param event packet 3832 * @return handle 3833 * @note: btstack_type H 3834 */ 3835 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){ 3836 return little_endian_read_16(event, 3); 3837 } 3838 #endif 3839 3840 #ifdef ENABLE_BLE 3841 /** 3842 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3843 * @param event packet 3844 * @return handle 3845 * @note: btstack_type H 3846 */ 3847 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){ 3848 return little_endian_read_16(event, 3); 3849 } 3850 /** 3851 * @brief Get field attribute_id from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3852 * @param event packet 3853 * @return attribute_id 3854 * @note: btstack_type 2 3855 */ 3856 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){ 3857 return little_endian_read_16(event, 5); 3858 } 3859 /** 3860 * @brief Get field text from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3861 * @param event packet 3862 * @return text 3863 * @note: btstack_type T 3864 */ 3865 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){ 3866 return (const char *) &event[7]; 3867 } 3868 #endif 3869 3870 #ifdef ENABLE_BLE 3871 /** 3872 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_DISCONNECTED 3873 * @param event packet 3874 * @return handle 3875 * @note: btstack_type H 3876 */ 3877 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){ 3878 return little_endian_read_16(event, 3); 3879 } 3880 #endif 3881 3882 /** 3883 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3884 * @param event packet 3885 * @return avdtp_cid 3886 * @note: btstack_type H 3887 */ 3888 static inline hci_con_handle_t avdtp_subevent_signaling_accept_get_avdtp_cid(const uint8_t * event){ 3889 return little_endian_read_16(event, 3); 3890 } 3891 /** 3892 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3893 * @param event packet 3894 * @return int_seid 3895 * @note: btstack_type 1 3896 */ 3897 static inline uint8_t avdtp_subevent_signaling_accept_get_int_seid(const uint8_t * event){ 3898 return event[5]; 3899 } 3900 /** 3901 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3902 * @param event packet 3903 * @return signal_identifier 3904 * @note: btstack_type 1 3905 */ 3906 static inline uint8_t avdtp_subevent_signaling_accept_get_signal_identifier(const uint8_t * event){ 3907 return event[6]; 3908 } 3909 /** 3910 * @brief Get field status from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3911 * @param event packet 3912 * @return status 3913 * @note: btstack_type 1 3914 */ 3915 static inline uint8_t avdtp_subevent_signaling_accept_get_status(const uint8_t * event){ 3916 return event[7]; 3917 } 3918 3919 /** 3920 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_REJECT 3921 * @param event packet 3922 * @return avdtp_cid 3923 * @note: btstack_type H 3924 */ 3925 static inline hci_con_handle_t avdtp_subevent_signaling_reject_get_avdtp_cid(const uint8_t * event){ 3926 return little_endian_read_16(event, 3); 3927 } 3928 /** 3929 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_REJECT 3930 * @param event packet 3931 * @return int_seid 3932 * @note: btstack_type 1 3933 */ 3934 static inline uint8_t avdtp_subevent_signaling_reject_get_int_seid(const uint8_t * event){ 3935 return event[5]; 3936 } 3937 /** 3938 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_REJECT 3939 * @param event packet 3940 * @return signal_identifier 3941 * @note: btstack_type 1 3942 */ 3943 static inline uint8_t avdtp_subevent_signaling_reject_get_signal_identifier(const uint8_t * event){ 3944 return event[6]; 3945 } 3946 3947 /** 3948 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 3949 * @param event packet 3950 * @return avdtp_cid 3951 * @note: btstack_type H 3952 */ 3953 static inline hci_con_handle_t avdtp_subevent_signaling_general_reject_get_avdtp_cid(const uint8_t * event){ 3954 return little_endian_read_16(event, 3); 3955 } 3956 /** 3957 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 3958 * @param event packet 3959 * @return int_seid 3960 * @note: btstack_type 1 3961 */ 3962 static inline uint8_t avdtp_subevent_signaling_general_reject_get_int_seid(const uint8_t * event){ 3963 return event[5]; 3964 } 3965 /** 3966 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 3967 * @param event packet 3968 * @return signal_identifier 3969 * @note: btstack_type 1 3970 */ 3971 static inline uint8_t avdtp_subevent_signaling_general_reject_get_signal_identifier(const uint8_t * event){ 3972 return event[6]; 3973 } 3974 3975 /** 3976 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3977 * @param event packet 3978 * @return avdtp_cid 3979 * @note: btstack_type H 3980 */ 3981 static inline hci_con_handle_t avdtp_subevent_signaling_connection_established_get_avdtp_cid(const uint8_t * event){ 3982 return little_endian_read_16(event, 3); 3983 } 3984 /** 3985 * @brief Get field bd_addr from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3986 * @param event packet 3987 * @param Pointer to storage for bd_addr 3988 * @note: btstack_type B 3989 */ 3990 static inline void avdtp_subevent_signaling_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3991 reverse_bd_addr(&event[5], bd_addr); 3992 } 3993 /** 3994 * @brief Get field status from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3995 * @param event packet 3996 * @return status 3997 * @note: btstack_type 1 3998 */ 3999 static inline uint8_t avdtp_subevent_signaling_connection_established_get_status(const uint8_t * event){ 4000 return event[11]; 4001 } 4002 4003 /** 4004 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 4005 * @param event packet 4006 * @return avdtp_cid 4007 * @note: btstack_type H 4008 */ 4009 static inline hci_con_handle_t avdtp_subevent_signaling_connection_released_get_avdtp_cid(const uint8_t * event){ 4010 return little_endian_read_16(event, 3); 4011 } 4012 4013 /** 4014 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4015 * @param event packet 4016 * @return avdtp_cid 4017 * @note: btstack_type H 4018 */ 4019 static inline hci_con_handle_t avdtp_subevent_signaling_sep_found_get_avdtp_cid(const uint8_t * event){ 4020 return little_endian_read_16(event, 3); 4021 } 4022 /** 4023 * @brief Get field seid from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4024 * @param event packet 4025 * @return seid 4026 * @note: btstack_type 1 4027 */ 4028 static inline uint8_t avdtp_subevent_signaling_sep_found_get_seid(const uint8_t * event){ 4029 return event[5]; 4030 } 4031 /** 4032 * @brief Get field in_use from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4033 * @param event packet 4034 * @return in_use 4035 * @note: btstack_type 1 4036 */ 4037 static inline uint8_t avdtp_subevent_signaling_sep_found_get_in_use(const uint8_t * event){ 4038 return event[6]; 4039 } 4040 /** 4041 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4042 * @param event packet 4043 * @return media_type 4044 * @note: btstack_type 1 4045 */ 4046 static inline uint8_t avdtp_subevent_signaling_sep_found_get_media_type(const uint8_t * event){ 4047 return event[7]; 4048 } 4049 /** 4050 * @brief Get field sep_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4051 * @param event packet 4052 * @return sep_type 4053 * @note: btstack_type 1 4054 */ 4055 static inline uint8_t avdtp_subevent_signaling_sep_found_get_sep_type(const uint8_t * event){ 4056 return event[8]; 4057 } 4058 4059 /** 4060 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4061 * @param event packet 4062 * @return avdtp_cid 4063 * @note: btstack_type H 4064 */ 4065 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_sbc_capability_get_avdtp_cid(const uint8_t * event){ 4066 return little_endian_read_16(event, 3); 4067 } 4068 /** 4069 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4070 * @param event packet 4071 * @return int_seid 4072 * @note: btstack_type 1 4073 */ 4074 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_int_seid(const uint8_t * event){ 4075 return event[5]; 4076 } 4077 /** 4078 * @brief Get field acp_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4079 * @param event packet 4080 * @return acp_seid 4081 * @note: btstack_type 1 4082 */ 4083 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_acp_seid(const uint8_t * event){ 4084 return event[6]; 4085 } 4086 /** 4087 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4088 * @param event packet 4089 * @return media_type 4090 * @note: btstack_type 1 4091 */ 4092 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_media_type(const uint8_t * event){ 4093 return event[7]; 4094 } 4095 /** 4096 * @brief Get field sampling_frequency_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4097 * @param event packet 4098 * @return sampling_frequency_bitmap 4099 * @note: btstack_type 1 4100 */ 4101 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_sampling_frequency_bitmap(const uint8_t * event){ 4102 return event[8]; 4103 } 4104 /** 4105 * @brief Get field channel_mode_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4106 * @param event packet 4107 * @return channel_mode_bitmap 4108 * @note: btstack_type 1 4109 */ 4110 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_channel_mode_bitmap(const uint8_t * event){ 4111 return event[9]; 4112 } 4113 /** 4114 * @brief Get field block_length_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4115 * @param event packet 4116 * @return block_length_bitmap 4117 * @note: btstack_type 1 4118 */ 4119 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_block_length_bitmap(const uint8_t * event){ 4120 return event[10]; 4121 } 4122 /** 4123 * @brief Get field subbands_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4124 * @param event packet 4125 * @return subbands_bitmap 4126 * @note: btstack_type 1 4127 */ 4128 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_subbands_bitmap(const uint8_t * event){ 4129 return event[11]; 4130 } 4131 /** 4132 * @brief Get field allocation_method_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4133 * @param event packet 4134 * @return allocation_method_bitmap 4135 * @note: btstack_type 1 4136 */ 4137 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_allocation_method_bitmap(const uint8_t * event){ 4138 return event[12]; 4139 } 4140 /** 4141 * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4142 * @param event packet 4143 * @return min_bitpool_value 4144 * @note: btstack_type 1 4145 */ 4146 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(const uint8_t * event){ 4147 return event[13]; 4148 } 4149 /** 4150 * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4151 * @param event packet 4152 * @return max_bitpool_value 4153 * @note: btstack_type 1 4154 */ 4155 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_max_bitpool_value(const uint8_t * event){ 4156 return event[14]; 4157 } 4158 4159 /** 4160 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4161 * @param event packet 4162 * @return avdtp_cid 4163 * @note: btstack_type H 4164 */ 4165 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_other_capability_get_avdtp_cid(const uint8_t * event){ 4166 return little_endian_read_16(event, 3); 4167 } 4168 /** 4169 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4170 * @param event packet 4171 * @return int_seid 4172 * @note: btstack_type 1 4173 */ 4174 static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_int_seid(const uint8_t * event){ 4175 return event[5]; 4176 } 4177 /** 4178 * @brief Get field acp_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4179 * @param event packet 4180 * @return acp_seid 4181 * @note: btstack_type 1 4182 */ 4183 static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_acp_seid(const uint8_t * event){ 4184 return event[6]; 4185 } 4186 /** 4187 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4188 * @param event packet 4189 * @return media_type 4190 * @note: btstack_type 1 4191 */ 4192 static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_media_type(const uint8_t * event){ 4193 return event[7]; 4194 } 4195 /** 4196 * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4197 * @param event packet 4198 * @return media_codec_type 4199 * @note: btstack_type 2 4200 */ 4201 static inline uint16_t avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_type(const uint8_t * event){ 4202 return little_endian_read_16(event, 8); 4203 } 4204 /** 4205 * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4206 * @param event packet 4207 * @return media_codec_information_len 4208 * @note: btstack_type L 4209 */ 4210 static inline int avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information_len(const uint8_t * event){ 4211 return little_endian_read_16(event, 10); 4212 } 4213 /** 4214 * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4215 * @param event packet 4216 * @return media_codec_information 4217 * @note: btstack_type V 4218 */ 4219 static inline const uint8_t * avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information(const uint8_t * event){ 4220 return &event[12]; 4221 } 4222 4223 /** 4224 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4225 * @param event packet 4226 * @return avdtp_cid 4227 * @note: btstack_type H 4228 */ 4229 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_avdtp_cid(const uint8_t * event){ 4230 return little_endian_read_16(event, 3); 4231 } 4232 /** 4233 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4234 * @param event packet 4235 * @return int_seid 4236 * @note: btstack_type 1 4237 */ 4238 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_int_seid(const uint8_t * event){ 4239 return event[5]; 4240 } 4241 /** 4242 * @brief Get field acp_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4243 * @param event packet 4244 * @return acp_seid 4245 * @note: btstack_type 1 4246 */ 4247 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_acp_seid(const uint8_t * event){ 4248 return event[6]; 4249 } 4250 /** 4251 * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4252 * @param event packet 4253 * @return reconfigure 4254 * @note: btstack_type 1 4255 */ 4256 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_reconfigure(const uint8_t * event){ 4257 return event[7]; 4258 } 4259 /** 4260 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4261 * @param event packet 4262 * @return media_type 4263 * @note: btstack_type 1 4264 */ 4265 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_media_type(const uint8_t * event){ 4266 return event[8]; 4267 } 4268 /** 4269 * @brief Get field sampling_frequency from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4270 * @param event packet 4271 * @return sampling_frequency 4272 * @note: btstack_type 2 4273 */ 4274 static inline uint16_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_sampling_frequency(const uint8_t * event){ 4275 return little_endian_read_16(event, 9); 4276 } 4277 /** 4278 * @brief Get field channel_mode from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4279 * @param event packet 4280 * @return channel_mode 4281 * @note: btstack_type 1 4282 */ 4283 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(const uint8_t * event){ 4284 return event[11]; 4285 } 4286 /** 4287 * @brief Get field num_channels from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4288 * @param event packet 4289 * @return num_channels 4290 * @note: btstack_type 1 4291 */ 4292 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_num_channels(const uint8_t * event){ 4293 return event[12]; 4294 } 4295 /** 4296 * @brief Get field block_length from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4297 * @param event packet 4298 * @return block_length 4299 * @note: btstack_type 1 4300 */ 4301 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_block_length(const uint8_t * event){ 4302 return event[13]; 4303 } 4304 /** 4305 * @brief Get field subbands from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4306 * @param event packet 4307 * @return subbands 4308 * @note: btstack_type 1 4309 */ 4310 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_subbands(const uint8_t * event){ 4311 return event[14]; 4312 } 4313 /** 4314 * @brief Get field allocation_method from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4315 * @param event packet 4316 * @return allocation_method 4317 * @note: btstack_type 1 4318 */ 4319 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(const uint8_t * event){ 4320 return event[15]; 4321 } 4322 /** 4323 * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4324 * @param event packet 4325 * @return min_bitpool_value 4326 * @note: btstack_type 1 4327 */ 4328 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(const uint8_t * event){ 4329 return event[16]; 4330 } 4331 /** 4332 * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4333 * @param event packet 4334 * @return max_bitpool_value 4335 * @note: btstack_type 1 4336 */ 4337 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(const uint8_t * event){ 4338 return event[17]; 4339 } 4340 4341 /** 4342 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4343 * @param event packet 4344 * @return avdtp_cid 4345 * @note: btstack_type H 4346 */ 4347 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_other_configuration_get_avdtp_cid(const uint8_t * event){ 4348 return little_endian_read_16(event, 3); 4349 } 4350 /** 4351 * @brief Get field int_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4352 * @param event packet 4353 * @return int_seid 4354 * @note: btstack_type 1 4355 */ 4356 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_int_seid(const uint8_t * event){ 4357 return event[5]; 4358 } 4359 /** 4360 * @brief Get field acp_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4361 * @param event packet 4362 * @return acp_seid 4363 * @note: btstack_type 1 4364 */ 4365 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_acp_seid(const uint8_t * event){ 4366 return event[6]; 4367 } 4368 /** 4369 * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4370 * @param event packet 4371 * @return reconfigure 4372 * @note: btstack_type 1 4373 */ 4374 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_reconfigure(const uint8_t * event){ 4375 return event[7]; 4376 } 4377 /** 4378 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4379 * @param event packet 4380 * @return media_type 4381 * @note: btstack_type 1 4382 */ 4383 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_type(const uint8_t * event){ 4384 return event[8]; 4385 } 4386 /** 4387 * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4388 * @param event packet 4389 * @return media_codec_type 4390 * @note: btstack_type 2 4391 */ 4392 static inline uint16_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_type(const uint8_t * event){ 4393 return little_endian_read_16(event, 9); 4394 } 4395 /** 4396 * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4397 * @param event packet 4398 * @return media_codec_information_len 4399 * @note: btstack_type L 4400 */ 4401 static inline int avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information_len(const uint8_t * event){ 4402 return little_endian_read_16(event, 11); 4403 } 4404 /** 4405 * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4406 * @param event packet 4407 * @return media_codec_information 4408 * @note: btstack_type V 4409 */ 4410 static inline const uint8_t * avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information(const uint8_t * event){ 4411 return &event[13]; 4412 } 4413 4414 /** 4415 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4416 * @param event packet 4417 * @return avdtp_cid 4418 * @note: btstack_type H 4419 */ 4420 static inline hci_con_handle_t avdtp_subevent_streaming_connection_established_get_avdtp_cid(const uint8_t * event){ 4421 return little_endian_read_16(event, 3); 4422 } 4423 /** 4424 * @brief Get field int_seid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4425 * @param event packet 4426 * @return int_seid 4427 * @note: btstack_type 1 4428 */ 4429 static inline uint8_t avdtp_subevent_streaming_connection_established_get_int_seid(const uint8_t * event){ 4430 return event[5]; 4431 } 4432 /** 4433 * @brief Get field acp_seid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4434 * @param event packet 4435 * @return acp_seid 4436 * @note: btstack_type 1 4437 */ 4438 static inline uint8_t avdtp_subevent_streaming_connection_established_get_acp_seid(const uint8_t * event){ 4439 return event[6]; 4440 } 4441 /** 4442 * @brief Get field status from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4443 * @param event packet 4444 * @return status 4445 * @note: btstack_type 1 4446 */ 4447 static inline uint8_t avdtp_subevent_streaming_connection_established_get_status(const uint8_t * event){ 4448 return event[7]; 4449 } 4450 4451 /** 4452 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED 4453 * @param event packet 4454 * @return avdtp_cid 4455 * @note: btstack_type H 4456 */ 4457 static inline hci_con_handle_t avdtp_subevent_streaming_connection_released_get_avdtp_cid(const uint8_t * event){ 4458 return little_endian_read_16(event, 3); 4459 } 4460 4461 /** 4462 * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 4463 * @param event packet 4464 * @return avdtp_cid 4465 * @note: btstack_type H 4466 */ 4467 static inline hci_con_handle_t avdtp_subevent_streaming_can_send_media_packet_now_get_avdtp_cid(const uint8_t * event){ 4468 return little_endian_read_16(event, 3); 4469 } 4470 /** 4471 * @brief Get field int_seid from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 4472 * @param event packet 4473 * @return int_seid 4474 * @note: btstack_type 1 4475 */ 4476 static inline uint8_t avdtp_subevent_streaming_can_send_media_packet_now_get_int_seid(const uint8_t * event){ 4477 return event[5]; 4478 } 4479 /** 4480 * @brief Get field sequence_number from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 4481 * @param event packet 4482 * @return sequence_number 4483 * @note: btstack_type 2 4484 */ 4485 static inline uint16_t avdtp_subevent_streaming_can_send_media_packet_now_get_sequence_number(const uint8_t * event){ 4486 return little_endian_read_16(event, 6); 4487 } 4488 4489 /** 4490 * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_ESTABLISHED 4491 * @param event packet 4492 * @return a2dp_cid 4493 * @note: btstack_type H 4494 */ 4495 static inline hci_con_handle_t a2dp_subevent_stream_established_get_a2dp_cid(const uint8_t * event){ 4496 return little_endian_read_16(event, 3); 4497 } 4498 /** 4499 * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_ESTABLISHED 4500 * @param event packet 4501 * @return local_seid 4502 * @note: btstack_type 1 4503 */ 4504 static inline uint8_t a2dp_subevent_stream_established_get_local_seid(const uint8_t * event){ 4505 return event[5]; 4506 } 4507 /** 4508 * @brief Get field remote_seid from event A2DP_SUBEVENT_STREAM_ESTABLISHED 4509 * @param event packet 4510 * @return remote_seid 4511 * @note: btstack_type 1 4512 */ 4513 static inline uint8_t a2dp_subevent_stream_established_get_remote_seid(const uint8_t * event){ 4514 return event[6]; 4515 } 4516 /** 4517 * @brief Get field status from event A2DP_SUBEVENT_STREAM_ESTABLISHED 4518 * @param event packet 4519 * @return status 4520 * @note: btstack_type 1 4521 */ 4522 static inline uint8_t a2dp_subevent_stream_established_get_status(const uint8_t * event){ 4523 return event[7]; 4524 } 4525 4526 /** 4527 * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_START_ACCEPTED 4528 * @param event packet 4529 * @return a2dp_cid 4530 * @note: btstack_type H 4531 */ 4532 static inline hci_con_handle_t a2dp_subevent_stream_start_accepted_get_a2dp_cid(const uint8_t * event){ 4533 return little_endian_read_16(event, 3); 4534 } 4535 /** 4536 * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_START_ACCEPTED 4537 * @param event packet 4538 * @return local_seid 4539 * @note: btstack_type 1 4540 */ 4541 static inline uint8_t a2dp_subevent_stream_start_accepted_get_local_seid(const uint8_t * event){ 4542 return event[5]; 4543 } 4544 4545 /** 4546 * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_SUSPENDED 4547 * @param event packet 4548 * @return a2dp_cid 4549 * @note: btstack_type H 4550 */ 4551 static inline hci_con_handle_t a2dp_subevent_stream_suspended_get_a2dp_cid(const uint8_t * event){ 4552 return little_endian_read_16(event, 3); 4553 } 4554 /** 4555 * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_SUSPENDED 4556 * @param event packet 4557 * @return local_seid 4558 * @note: btstack_type 1 4559 */ 4560 static inline uint8_t a2dp_subevent_stream_suspended_get_local_seid(const uint8_t * event){ 4561 return event[5]; 4562 } 4563 4564 /** 4565 * @brief Get field avdtp_cid from event A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 4566 * @param event packet 4567 * @return avdtp_cid 4568 * @note: btstack_type H 4569 */ 4570 static inline hci_con_handle_t a2dp_subevent_streaming_can_send_media_packet_now_get_avdtp_cid(const uint8_t * event){ 4571 return little_endian_read_16(event, 3); 4572 } 4573 /** 4574 * @brief Get field local_seid from event A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW 4575 * @param event packet 4576 * @return local_seid 4577 * @note: btstack_type 1 4578 */ 4579 static inline uint8_t a2dp_subevent_streaming_can_send_media_packet_now_get_local_seid(const uint8_t * event){ 4580 return event[5]; 4581 } 4582 4583 /** 4584 * @brief Get field avdtp_cid from event A2DP_SUBEVENT_STREAM_RELEASED 4585 * @param event packet 4586 * @return avdtp_cid 4587 * @note: btstack_type H 4588 */ 4589 static inline hci_con_handle_t a2dp_subevent_stream_released_get_avdtp_cid(const uint8_t * event){ 4590 return little_endian_read_16(event, 3); 4591 } 4592 /** 4593 * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_RELEASED 4594 * @param event packet 4595 * @return local_seid 4596 * @note: btstack_type 1 4597 */ 4598 static inline uint8_t a2dp_subevent_stream_released_get_local_seid(const uint8_t * event){ 4599 return event[5]; 4600 } 4601 4602 /** 4603 * @brief Get field con_handle from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4604 * @param event packet 4605 * @return con_handle 4606 * @note: btstack_type H 4607 */ 4608 static inline hci_con_handle_t avrcp_subevent_connection_established_get_con_handle(const uint8_t * event){ 4609 return little_endian_read_16(event, 3); 4610 } 4611 /** 4612 * @brief Get field status from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4613 * @param event packet 4614 * @return status 4615 * @note: btstack_type 1 4616 */ 4617 static inline uint8_t avrcp_subevent_connection_established_get_status(const uint8_t * event){ 4618 return event[5]; 4619 } 4620 /** 4621 * @brief Get field local_cid from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4622 * @param event packet 4623 * @return local_cid 4624 * @note: btstack_type 2 4625 */ 4626 static inline uint16_t avrcp_subevent_connection_established_get_local_cid(const uint8_t * event){ 4627 return little_endian_read_16(event, 6); 4628 } 4629 /** 4630 * @brief Get field bd_addr from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4631 * @param event packet 4632 * @param Pointer to storage for bd_addr 4633 * @note: btstack_type B 4634 */ 4635 static inline void avrcp_subevent_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 4636 reverse_bd_addr(&event[8], bd_addr); 4637 } 4638 4639 /** 4640 * @brief Get field con_handle from event AVRCP_SUBEVENT_CONNECTION_RELEASED 4641 * @param event packet 4642 * @return con_handle 4643 * @note: btstack_type H 4644 */ 4645 static inline hci_con_handle_t avrcp_subevent_connection_released_get_con_handle(const uint8_t * event){ 4646 return little_endian_read_16(event, 3); 4647 } 4648 4649 /** 4650 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4651 * @param event packet 4652 * @return con_handle 4653 * @note: btstack_type H 4654 */ 4655 static inline hci_con_handle_t avrcp_subevent_now_playing_info_get_con_handle(const uint8_t * event){ 4656 return little_endian_read_16(event, 3); 4657 } 4658 /** 4659 * @brief Get field status from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4660 * @param event packet 4661 * @return status 4662 * @note: btstack_type 1 4663 */ 4664 static inline uint8_t avrcp_subevent_now_playing_info_get_status(const uint8_t * event){ 4665 return event[5]; 4666 } 4667 /** 4668 * @brief Get field track from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4669 * @param event packet 4670 * @return track 4671 * @note: btstack_type 1 4672 */ 4673 static inline uint8_t avrcp_subevent_now_playing_info_get_track(const uint8_t * event){ 4674 return event[6]; 4675 } 4676 /** 4677 * @brief Get field total_tracks from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4678 * @param event packet 4679 * @return total_tracks 4680 * @note: btstack_type 1 4681 */ 4682 static inline uint8_t avrcp_subevent_now_playing_info_get_total_tracks(const uint8_t * event){ 4683 return event[7]; 4684 } 4685 /** 4686 * @brief Get field song_length from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4687 * @param event packet 4688 * @return song_length 4689 * @note: btstack_type 4 4690 */ 4691 static inline uint32_t avrcp_subevent_now_playing_info_get_song_length(const uint8_t * event){ 4692 return little_endian_read_32(event, 8); 4693 } 4694 /** 4695 * @brief Get field title_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4696 * @param event packet 4697 * @return title_len 4698 * @note: btstack_type J 4699 */ 4700 static inline int avrcp_subevent_now_playing_info_get_title_len(const uint8_t * event){ 4701 return event[12]; 4702 } 4703 /** 4704 * @brief Get field title from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4705 * @param event packet 4706 * @return title 4707 * @note: btstack_type V 4708 */ 4709 static inline const uint8_t * avrcp_subevent_now_playing_info_get_title(const uint8_t * event){ 4710 return &event[13]; 4711 } 4712 /** 4713 * @brief Get field artist_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4714 * @param event packet 4715 * @return artist_len 4716 * @note: btstack_type J 4717 */ 4718 static inline int avrcp_subevent_now_playing_info_get_artist_len(const uint8_t * event){ 4719 return event[13 + event[12]]; 4720 } 4721 /** 4722 * @brief Get field artist from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4723 * @param event packet 4724 * @return artist 4725 * @note: btstack_type V 4726 */ 4727 static inline const uint8_t * avrcp_subevent_now_playing_info_get_artist(const uint8_t * event){ 4728 return &event[13 + event[12] + 1]; 4729 } 4730 /** 4731 * @brief Get field album_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4732 * @param event packet 4733 * @return album_len 4734 * @note: btstack_type J 4735 */ 4736 static inline int avrcp_subevent_now_playing_info_get_album_len(const uint8_t * event){ 4737 return event[13 + event[12] + 1 + event[13 + event[12]]]; 4738 } 4739 /** 4740 * @brief Get field album from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4741 * @param event packet 4742 * @return album 4743 * @note: btstack_type V 4744 */ 4745 static inline const uint8_t * avrcp_subevent_now_playing_info_get_album(const uint8_t * event){ 4746 return &event[13 + event[12] + 1 + event[13 + event[12]] + 1]; 4747 } 4748 /** 4749 * @brief Get field genre_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4750 * @param event packet 4751 * @return genre_len 4752 * @note: btstack_type J 4753 */ 4754 static inline int avrcp_subevent_now_playing_info_get_genre_len(const uint8_t * event){ 4755 return event[13 + event[12] + 1 + event[13 + event[12]] + 1 + event[13 + event[12] + 1 + event[13 + event[12]]]]; 4756 } 4757 /** 4758 * @brief Get field genre from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4759 * @param event packet 4760 * @return genre 4761 * @note: btstack_type V 4762 */ 4763 static inline const uint8_t * avrcp_subevent_now_playing_info_get_genre(const uint8_t * event){ 4764 return &event[13 + event[12] + 1 + event[13 + event[12]] + 1 + event[13 + event[12] + 1 + event[13 + event[12]]] + 1]; 4765 } 4766 4767 /** 4768 * @brief Get field con_handle from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4769 * @param event packet 4770 * @return con_handle 4771 * @note: btstack_type H 4772 */ 4773 static inline hci_con_handle_t avrcp_subevent_shuffle_and_repeat_mode_get_con_handle(const uint8_t * event){ 4774 return little_endian_read_16(event, 3); 4775 } 4776 /** 4777 * @brief Get field status from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4778 * @param event packet 4779 * @return status 4780 * @note: btstack_type 1 4781 */ 4782 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_status(const uint8_t * event){ 4783 return event[5]; 4784 } 4785 /** 4786 * @brief Get field repeat_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4787 * @param event packet 4788 * @return repeat_mode 4789 * @note: btstack_type 1 4790 */ 4791 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_repeat_mode(const uint8_t * event){ 4792 return event[6]; 4793 } 4794 /** 4795 * @brief Get field shuffle_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4796 * @param event packet 4797 * @return shuffle_mode 4798 * @note: btstack_type 1 4799 */ 4800 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_shuffle_mode(const uint8_t * event){ 4801 return event[7]; 4802 } 4803 4804 /** 4805 * @brief Get field con_handle from event AVRCP_SUBEVENT_PLAY_STATUS 4806 * @param event packet 4807 * @return con_handle 4808 * @note: btstack_type H 4809 */ 4810 static inline hci_con_handle_t avrcp_subevent_play_status_get_con_handle(const uint8_t * event){ 4811 return little_endian_read_16(event, 3); 4812 } 4813 /** 4814 * @brief Get field status from event AVRCP_SUBEVENT_PLAY_STATUS 4815 * @param event packet 4816 * @return status 4817 * @note: btstack_type 1 4818 */ 4819 static inline uint8_t avrcp_subevent_play_status_get_status(const uint8_t * event){ 4820 return event[5]; 4821 } 4822 /** 4823 * @brief Get field song_length from event AVRCP_SUBEVENT_PLAY_STATUS 4824 * @param event packet 4825 * @return song_length 4826 * @note: btstack_type 4 4827 */ 4828 static inline uint32_t avrcp_subevent_play_status_get_song_length(const uint8_t * event){ 4829 return little_endian_read_32(event, 6); 4830 } 4831 /** 4832 * @brief Get field song_position from event AVRCP_SUBEVENT_PLAY_STATUS 4833 * @param event packet 4834 * @return song_position 4835 * @note: btstack_type 4 4836 */ 4837 static inline uint32_t avrcp_subevent_play_status_get_song_position(const uint8_t * event){ 4838 return little_endian_read_32(event, 10); 4839 } 4840 /** 4841 * @brief Get field play_status from event AVRCP_SUBEVENT_PLAY_STATUS 4842 * @param event packet 4843 * @return play_status 4844 * @note: btstack_type 1 4845 */ 4846 static inline uint8_t avrcp_subevent_play_status_get_play_status(const uint8_t * event){ 4847 return event[14]; 4848 } 4849 4850 /** 4851 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4852 * @param event packet 4853 * @return con_handle 4854 * @note: btstack_type H 4855 */ 4856 static inline hci_con_handle_t avrcp_subevent_notification_playback_status_changed_get_con_handle(const uint8_t * event){ 4857 return little_endian_read_16(event, 3); 4858 } 4859 /** 4860 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4861 * @param event packet 4862 * @return status 4863 * @note: btstack_type 1 4864 */ 4865 static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_status(const uint8_t * event){ 4866 return event[5]; 4867 } 4868 /** 4869 * @brief Get field playback_status from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4870 * @param event packet 4871 * @return playback_status 4872 * @note: btstack_type 1 4873 */ 4874 static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_playback_status(const uint8_t * event){ 4875 return event[6]; 4876 } 4877 4878 /** 4879 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4880 * @param event packet 4881 * @return con_handle 4882 * @note: btstack_type H 4883 */ 4884 static inline hci_con_handle_t avrcp_subevent_notification_track_changed_get_con_handle(const uint8_t * event){ 4885 return little_endian_read_16(event, 3); 4886 } 4887 /** 4888 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4889 * @param event packet 4890 * @return status 4891 * @note: btstack_type 1 4892 */ 4893 static inline uint8_t avrcp_subevent_notification_track_changed_get_status(const uint8_t * event){ 4894 return event[5]; 4895 } 4896 /** 4897 * @brief Get field track_status from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4898 * @param event packet 4899 * @return track_status 4900 * @note: btstack_type 1 4901 */ 4902 static inline uint8_t avrcp_subevent_notification_track_changed_get_track_status(const uint8_t * event){ 4903 return event[6]; 4904 } 4905 4906 /** 4907 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 4908 * @param event packet 4909 * @return con_handle 4910 * @note: btstack_type H 4911 */ 4912 static inline hci_con_handle_t avrcp_subevent_notification_now_playing_content_changed_get_con_handle(const uint8_t * event){ 4913 return little_endian_read_16(event, 3); 4914 } 4915 /** 4916 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 4917 * @param event packet 4918 * @return status 4919 * @note: btstack_type 1 4920 */ 4921 static inline uint8_t avrcp_subevent_notification_now_playing_content_changed_get_status(const uint8_t * event){ 4922 return event[5]; 4923 } 4924 4925 /** 4926 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 4927 * @param event packet 4928 * @return con_handle 4929 * @note: btstack_type H 4930 */ 4931 static inline hci_con_handle_t avrcp_subevent_notification_available_players_changed_get_con_handle(const uint8_t * event){ 4932 return little_endian_read_16(event, 3); 4933 } 4934 /** 4935 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 4936 * @param event packet 4937 * @return status 4938 * @note: btstack_type 1 4939 */ 4940 static inline uint8_t avrcp_subevent_notification_available_players_changed_get_status(const uint8_t * event){ 4941 return event[5]; 4942 } 4943 4944 /** 4945 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4946 * @param event packet 4947 * @return con_handle 4948 * @note: btstack_type H 4949 */ 4950 static inline hci_con_handle_t avrcp_subevent_notification_volume_changed_get_con_handle(const uint8_t * event){ 4951 return little_endian_read_16(event, 3); 4952 } 4953 /** 4954 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4955 * @param event packet 4956 * @return status 4957 * @note: btstack_type 1 4958 */ 4959 static inline uint8_t avrcp_subevent_notification_volume_changed_get_status(const uint8_t * event){ 4960 return event[5]; 4961 } 4962 /** 4963 * @brief Get field absolute_volume from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4964 * @param event packet 4965 * @return absolute_volume 4966 * @note: btstack_type 1 4967 */ 4968 static inline uint8_t avrcp_subevent_notification_volume_changed_get_absolute_volume(const uint8_t * event){ 4969 return event[6]; 4970 } 4971 4972 /** 4973 * @brief Get field con_handle from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4974 * @param event packet 4975 * @return con_handle 4976 * @note: btstack_type H 4977 */ 4978 static inline hci_con_handle_t avrcp_subevent_set_absolute_volume_response_get_con_handle(const uint8_t * event){ 4979 return little_endian_read_16(event, 3); 4980 } 4981 /** 4982 * @brief Get field status from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4983 * @param event packet 4984 * @return status 4985 * @note: btstack_type 1 4986 */ 4987 static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_status(const uint8_t * event){ 4988 return event[5]; 4989 } 4990 /** 4991 * @brief Get field absolute_volume from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4992 * @param event packet 4993 * @return absolute_volume 4994 * @note: btstack_type 1 4995 */ 4996 static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_absolute_volume(const uint8_t * event){ 4997 return event[6]; 4998 } 4999 5000 /** 5001 * @brief Get field con_handle from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 5002 * @param event packet 5003 * @return con_handle 5004 * @note: btstack_type H 5005 */ 5006 static inline hci_con_handle_t avrcp_subevent_enable_notification_complete_get_con_handle(const uint8_t * event){ 5007 return little_endian_read_16(event, 3); 5008 } 5009 /** 5010 * @brief Get field status from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 5011 * @param event packet 5012 * @return status 5013 * @note: btstack_type 1 5014 */ 5015 static inline uint8_t avrcp_subevent_enable_notification_complete_get_status(const uint8_t * event){ 5016 return event[5]; 5017 } 5018 /** 5019 * @brief Get field notification_id from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 5020 * @param event packet 5021 * @return notification_id 5022 * @note: btstack_type 1 5023 */ 5024 static inline uint8_t avrcp_subevent_enable_notification_complete_get_notification_id(const uint8_t * event){ 5025 return event[6]; 5026 } 5027 5028 /** 5029 * @brief Get field con_handle from event AVRCP_SUBEVENT_OPERATION_START 5030 * @param event packet 5031 * @return con_handle 5032 * @note: btstack_type H 5033 */ 5034 static inline hci_con_handle_t avrcp_subevent_operation_start_get_con_handle(const uint8_t * event){ 5035 return little_endian_read_16(event, 3); 5036 } 5037 /** 5038 * @brief Get field status from event AVRCP_SUBEVENT_OPERATION_START 5039 * @param event packet 5040 * @return status 5041 * @note: btstack_type 1 5042 */ 5043 static inline uint8_t avrcp_subevent_operation_start_get_status(const uint8_t * event){ 5044 return event[5]; 5045 } 5046 /** 5047 * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_START 5048 * @param event packet 5049 * @return operation_id 5050 * @note: btstack_type 1 5051 */ 5052 static inline uint8_t avrcp_subevent_operation_start_get_operation_id(const uint8_t * event){ 5053 return event[6]; 5054 } 5055 5056 /** 5057 * @brief Get field con_handle from event AVRCP_SUBEVENT_OPERATION_COMPLETE 5058 * @param event packet 5059 * @return con_handle 5060 * @note: btstack_type H 5061 */ 5062 static inline hci_con_handle_t avrcp_subevent_operation_complete_get_con_handle(const uint8_t * event){ 5063 return little_endian_read_16(event, 3); 5064 } 5065 /** 5066 * @brief Get field status from event AVRCP_SUBEVENT_OPERATION_COMPLETE 5067 * @param event packet 5068 * @return status 5069 * @note: btstack_type 1 5070 */ 5071 static inline uint8_t avrcp_subevent_operation_complete_get_status(const uint8_t * event){ 5072 return event[5]; 5073 } 5074 /** 5075 * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_COMPLETE 5076 * @param event packet 5077 * @return operation_id 5078 * @note: btstack_type 1 5079 */ 5080 static inline uint8_t avrcp_subevent_operation_complete_get_operation_id(const uint8_t * event){ 5081 return event[6]; 5082 } 5083 5084 /** 5085 * @brief Get field con_handle from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 5086 * @param event packet 5087 * @return con_handle 5088 * @note: btstack_type H 5089 */ 5090 static inline hci_con_handle_t avrcp_subevent_player_application_value_response_get_con_handle(const uint8_t * event){ 5091 return little_endian_read_16(event, 3); 5092 } 5093 /** 5094 * @brief Get field status from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 5095 * @param event packet 5096 * @return status 5097 * @note: btstack_type 1 5098 */ 5099 static inline uint8_t avrcp_subevent_player_application_value_response_get_status(const uint8_t * event){ 5100 return event[5]; 5101 } 5102 5103 /** 5104 * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_OPENED 5105 * @param event packet 5106 * @return goep_cid 5107 * @note: btstack_type 2 5108 */ 5109 static inline uint16_t goep_subevent_connection_opened_get_goep_cid(const uint8_t * event){ 5110 return little_endian_read_16(event, 3); 5111 } 5112 /** 5113 * @brief Get field status from event GOEP_SUBEVENT_CONNECTION_OPENED 5114 * @param event packet 5115 * @return status 5116 * @note: btstack_type 1 5117 */ 5118 static inline uint8_t goep_subevent_connection_opened_get_status(const uint8_t * event){ 5119 return event[5]; 5120 } 5121 /** 5122 * @brief Get field bd_addr from event GOEP_SUBEVENT_CONNECTION_OPENED 5123 * @param event packet 5124 * @param Pointer to storage for bd_addr 5125 * @note: btstack_type B 5126 */ 5127 static inline void goep_subevent_connection_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 5128 reverse_bd_addr(&event[6], bd_addr); 5129 } 5130 /** 5131 * @brief Get field con_handle from event GOEP_SUBEVENT_CONNECTION_OPENED 5132 * @param event packet 5133 * @return con_handle 5134 * @note: btstack_type H 5135 */ 5136 static inline hci_con_handle_t goep_subevent_connection_opened_get_con_handle(const uint8_t * event){ 5137 return little_endian_read_16(event, 12); 5138 } 5139 /** 5140 * @brief Get field incoming from event GOEP_SUBEVENT_CONNECTION_OPENED 5141 * @param event packet 5142 * @return incoming 5143 * @note: btstack_type 1 5144 */ 5145 static inline uint8_t goep_subevent_connection_opened_get_incoming(const uint8_t * event){ 5146 return event[14]; 5147 } 5148 5149 /** 5150 * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_CLOSED 5151 * @param event packet 5152 * @return goep_cid 5153 * @note: btstack_type 2 5154 */ 5155 static inline uint16_t goep_subevent_connection_closed_get_goep_cid(const uint8_t * event){ 5156 return little_endian_read_16(event, 3); 5157 } 5158 5159 /** 5160 * @brief Get field goep_cid from event GOEP_SUBEVENT_CAN_SEND_NOW 5161 * @param event packet 5162 * @return goep_cid 5163 * @note: btstack_type 2 5164 */ 5165 static inline uint16_t goep_subevent_can_send_now_get_goep_cid(const uint8_t * event){ 5166 return little_endian_read_16(event, 3); 5167 } 5168 5169 /** 5170 * @brief Get field pbap_cid from event PBAP_SUBEVENT_CONNECTION_OPENED 5171 * @param event packet 5172 * @return pbap_cid 5173 * @note: btstack_type 2 5174 */ 5175 static inline uint16_t pbap_subevent_connection_opened_get_pbap_cid(const uint8_t * event){ 5176 return little_endian_read_16(event, 3); 5177 } 5178 /** 5179 * @brief Get field status from event PBAP_SUBEVENT_CONNECTION_OPENED 5180 * @param event packet 5181 * @return status 5182 * @note: btstack_type 1 5183 */ 5184 static inline uint8_t pbap_subevent_connection_opened_get_status(const uint8_t * event){ 5185 return event[5]; 5186 } 5187 /** 5188 * @brief Get field bd_addr from event PBAP_SUBEVENT_CONNECTION_OPENED 5189 * @param event packet 5190 * @param Pointer to storage for bd_addr 5191 * @note: btstack_type B 5192 */ 5193 static inline void pbap_subevent_connection_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 5194 reverse_bd_addr(&event[6], bd_addr); 5195 } 5196 /** 5197 * @brief Get field con_handle from event PBAP_SUBEVENT_CONNECTION_OPENED 5198 * @param event packet 5199 * @return con_handle 5200 * @note: btstack_type H 5201 */ 5202 static inline hci_con_handle_t pbap_subevent_connection_opened_get_con_handle(const uint8_t * event){ 5203 return little_endian_read_16(event, 12); 5204 } 5205 /** 5206 * @brief Get field incoming from event PBAP_SUBEVENT_CONNECTION_OPENED 5207 * @param event packet 5208 * @return incoming 5209 * @note: btstack_type 1 5210 */ 5211 static inline uint8_t pbap_subevent_connection_opened_get_incoming(const uint8_t * event){ 5212 return event[14]; 5213 } 5214 5215 /** 5216 * @brief Get field goep_cid from event PBAP_SUBEVENT_CONNECTION_CLOSED 5217 * @param event packet 5218 * @return goep_cid 5219 * @note: btstack_type 2 5220 */ 5221 static inline uint16_t pbap_subevent_connection_closed_get_goep_cid(const uint8_t * event){ 5222 return little_endian_read_16(event, 3); 5223 } 5224 5225 /** 5226 * @brief Get field goep_cid from event PBAP_SUBEVENT_OPERATION_COMPLETED 5227 * @param event packet 5228 * @return goep_cid 5229 * @note: btstack_type 2 5230 */ 5231 static inline uint16_t pbap_subevent_operation_completed_get_goep_cid(const uint8_t * event){ 5232 return little_endian_read_16(event, 3); 5233 } 5234 /** 5235 * @brief Get field status from event PBAP_SUBEVENT_OPERATION_COMPLETED 5236 * @param event packet 5237 * @return status 5238 * @note: btstack_type 1 5239 */ 5240 static inline uint8_t pbap_subevent_operation_completed_get_status(const uint8_t * event){ 5241 return event[5]; 5242 } 5243 5244 5245 5246 /* API_END */ 5247 5248 #if defined __cplusplus 5249 } 5250 #endif 5251 5252 #endif // __BTSTACK_EVENT_H 5253