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