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