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 status from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2941 * @param event packet 2942 * @return status 2943 * @note: btstack_type 1 2944 */ 2945 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){ 2946 return event[3]; 2947 } 2948 /** 2949 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2950 * @param event packet 2951 * @return connection_handle 2952 * @note: btstack_type H 2953 */ 2954 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){ 2955 return little_endian_read_16(event, 4); 2956 } 2957 /** 2958 * @brief Get field role from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2959 * @param event packet 2960 * @return role 2961 * @note: btstack_type 1 2962 */ 2963 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){ 2964 return event[6]; 2965 } 2966 /** 2967 * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2968 * @param event packet 2969 * @return peer_address_type 2970 * @note: btstack_type 1 2971 */ 2972 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){ 2973 return event[7]; 2974 } 2975 /** 2976 * @brief Get field peer_address from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2977 * @param event packet 2978 * @param Pointer to storage for peer_address 2979 * @note: btstack_type B 2980 */ 2981 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){ 2982 reverse_bd_addr(&event[8], peer_address); 2983 } 2984 /** 2985 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2986 * @param event packet 2987 * @return conn_interval 2988 * @note: btstack_type 2 2989 */ 2990 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){ 2991 return little_endian_read_16(event, 14); 2992 } 2993 /** 2994 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2995 * @param event packet 2996 * @return conn_latency 2997 * @note: btstack_type 2 2998 */ 2999 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){ 3000 return little_endian_read_16(event, 16); 3001 } 3002 /** 3003 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 3004 * @param event packet 3005 * @return supervision_timeout 3006 * @note: btstack_type 2 3007 */ 3008 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){ 3009 return little_endian_read_16(event, 18); 3010 } 3011 /** 3012 * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 3013 * @param event packet 3014 * @return master_clock_accuracy 3015 * @note: btstack_type 1 3016 */ 3017 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 3018 return event[20]; 3019 } 3020 3021 /** 3022 * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3023 * @param event packet 3024 * @return status 3025 * @note: btstack_type 1 3026 */ 3027 static inline uint8_t hci_subevent_le_connection_update_complete_get_status(const uint8_t * event){ 3028 return event[3]; 3029 } 3030 /** 3031 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3032 * @param event packet 3033 * @return connection_handle 3034 * @note: btstack_type H 3035 */ 3036 static inline hci_con_handle_t hci_subevent_le_connection_update_complete_get_connection_handle(const uint8_t * event){ 3037 return little_endian_read_16(event, 4); 3038 } 3039 /** 3040 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3041 * @param event packet 3042 * @return conn_interval 3043 * @note: btstack_type 2 3044 */ 3045 static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_interval(const uint8_t * event){ 3046 return little_endian_read_16(event, 6); 3047 } 3048 /** 3049 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3050 * @param event packet 3051 * @return conn_latency 3052 * @note: btstack_type 2 3053 */ 3054 static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_latency(const uint8_t * event){ 3055 return little_endian_read_16(event, 8); 3056 } 3057 /** 3058 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 3059 * @param event packet 3060 * @return supervision_timeout 3061 * @note: btstack_type 2 3062 */ 3063 static inline uint16_t hci_subevent_le_connection_update_complete_get_supervision_timeout(const uint8_t * event){ 3064 return little_endian_read_16(event, 10); 3065 } 3066 3067 /** 3068 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3069 * @param event packet 3070 * @return connection_handle 3071 * @note: btstack_type H 3072 */ 3073 // static inline hci_con_handle_t hci_subevent_le_read_remote_used_features_complete_get_connection_handle(const uint8_t * event){ 3074 // not implemented yet 3075 // } 3076 /** 3077 * @brief Get field random_number from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3078 * @param event packet 3079 * @return random_number 3080 * @note: btstack_type D 3081 */ 3082 // static inline const uint8_t * hci_subevent_le_read_remote_used_features_complete_get_random_number(const uint8_t * event){ 3083 // not implemented yet 3084 // } 3085 /** 3086 * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 3087 * @param event packet 3088 * @return encryption_diversifier 3089 * @note: btstack_type 2 3090 */ 3091 // static inline uint16_t hci_subevent_le_read_remote_used_features_complete_get_encryption_diversifier(const uint8_t * event){ 3092 // not implemented yet 3093 // } 3094 3095 /** 3096 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3097 * @param event packet 3098 * @return connection_handle 3099 * @note: btstack_type H 3100 */ 3101 // static inline hci_con_handle_t hci_subevent_le_long_term_key_request_get_connection_handle(const uint8_t * event){ 3102 // not implemented yet 3103 // } 3104 /** 3105 * @brief Get field random_number from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3106 * @param event packet 3107 * @return random_number 3108 * @note: btstack_type D 3109 */ 3110 // static inline const uint8_t * hci_subevent_le_long_term_key_request_get_random_number(const uint8_t * event){ 3111 // not implemented yet 3112 // } 3113 /** 3114 * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 3115 * @param event packet 3116 * @return encryption_diversifier 3117 * @note: btstack_type 2 3118 */ 3119 // static inline uint16_t hci_subevent_le_long_term_key_request_get_encryption_diversifier(const uint8_t * event){ 3120 // not implemented yet 3121 // } 3122 3123 /** 3124 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3125 * @param event packet 3126 * @return connection_handle 3127 * @note: btstack_type H 3128 */ 3129 static inline hci_con_handle_t hci_subevent_le_remote_connection_parameter_request_get_connection_handle(const uint8_t * event){ 3130 return little_endian_read_16(event, 3); 3131 } 3132 /** 3133 * @brief Get field interval_min from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3134 * @param event packet 3135 * @return interval_min 3136 * @note: btstack_type 2 3137 */ 3138 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_min(const uint8_t * event){ 3139 return little_endian_read_16(event, 5); 3140 } 3141 /** 3142 * @brief Get field interval_max from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3143 * @param event packet 3144 * @return interval_max 3145 * @note: btstack_type 2 3146 */ 3147 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_max(const uint8_t * event){ 3148 return little_endian_read_16(event, 7); 3149 } 3150 /** 3151 * @brief Get field latency from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3152 * @param event packet 3153 * @return latency 3154 * @note: btstack_type 2 3155 */ 3156 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_latency(const uint8_t * event){ 3157 return little_endian_read_16(event, 9); 3158 } 3159 /** 3160 * @brief Get field timeout from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 3161 * @param event packet 3162 * @return timeout 3163 * @note: btstack_type 2 3164 */ 3165 static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_timeout(const uint8_t * event){ 3166 return little_endian_read_16(event, 11); 3167 } 3168 3169 /** 3170 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3171 * @param event packet 3172 * @return connection_handle 3173 * @note: btstack_type H 3174 */ 3175 static inline hci_con_handle_t hci_subevent_le_data_length_change_get_connection_handle(const uint8_t * event){ 3176 return little_endian_read_16(event, 3); 3177 } 3178 /** 3179 * @brief Get field max_tx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3180 * @param event packet 3181 * @return max_tx_octets 3182 * @note: btstack_type 2 3183 */ 3184 static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_octets(const uint8_t * event){ 3185 return little_endian_read_16(event, 5); 3186 } 3187 /** 3188 * @brief Get field max_tx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3189 * @param event packet 3190 * @return max_tx_time 3191 * @note: btstack_type 2 3192 */ 3193 static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_time(const uint8_t * event){ 3194 return little_endian_read_16(event, 7); 3195 } 3196 /** 3197 * @brief Get field max_rx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3198 * @param event packet 3199 * @return max_rx_octets 3200 * @note: btstack_type 2 3201 */ 3202 static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_octets(const uint8_t * event){ 3203 return little_endian_read_16(event, 9); 3204 } 3205 /** 3206 * @brief Get field max_rx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 3207 * @param event packet 3208 * @return max_rx_time 3209 * @note: btstack_type 2 3210 */ 3211 static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_time(const uint8_t * event){ 3212 return little_endian_read_16(event, 11); 3213 } 3214 3215 /** 3216 * @brief Get field status from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3217 * @param event packet 3218 * @return status 3219 * @note: btstack_type 1 3220 */ 3221 static inline uint8_t hci_subevent_le_read_local_p256_public_key_complete_get_status(const uint8_t * event){ 3222 return event[3]; 3223 } 3224 /** 3225 * @brief Get field dhkey_x from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3226 * @param event packet 3227 * @param Pointer to storage for dhkey_x 3228 * @note: btstack_type Q 3229 */ 3230 static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_x(const uint8_t * event, uint8_t * dhkey_x){ 3231 reverse_bytes(&event[4], dhkey_x, 32); 3232 } 3233 /** 3234 * @brief Get field dhkey_y from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 3235 * @param event packet 3236 * @param Pointer to storage for dhkey_y 3237 * @note: btstack_type Q 3238 */ 3239 static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_y(const uint8_t * event, uint8_t * dhkey_y){ 3240 reverse_bytes(&event[36], dhkey_y, 32); 3241 } 3242 3243 /** 3244 * @brief Get field status from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3245 * @param event packet 3246 * @return status 3247 * @note: btstack_type 1 3248 */ 3249 static inline uint8_t hci_subevent_le_generate_dhkey_complete_get_status(const uint8_t * event){ 3250 return event[3]; 3251 } 3252 /** 3253 * @brief Get field dhkey_x from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3254 * @param event packet 3255 * @param Pointer to storage for dhkey_x 3256 * @note: btstack_type Q 3257 */ 3258 static inline void hci_subevent_le_generate_dhkey_complete_get_dhkey_x(const uint8_t * event, uint8_t * dhkey_x){ 3259 reverse_bytes(&event[4], dhkey_x, 32); 3260 } 3261 /** 3262 * @brief Get field dhkey_y from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE 3263 * @param event packet 3264 * @param Pointer to storage for dhkey_y 3265 * @note: btstack_type Q 3266 */ 3267 static inline void hci_subevent_le_generate_dhkey_complete_get_dhkey_y(const uint8_t * event, uint8_t * dhkey_y){ 3268 reverse_bytes(&event[36], dhkey_y, 32); 3269 } 3270 3271 /** 3272 * @brief Get field status from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3273 * @param event packet 3274 * @return status 3275 * @note: btstack_type 1 3276 */ 3277 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_status(const uint8_t * event){ 3278 return event[3]; 3279 } 3280 /** 3281 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3282 * @param event packet 3283 * @return connection_handle 3284 * @note: btstack_type H 3285 */ 3286 static inline hci_con_handle_t hci_subevent_le_enhanced_connection_complete_get_connection_handle(const uint8_t * event){ 3287 return little_endian_read_16(event, 4); 3288 } 3289 /** 3290 * @brief Get field role from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3291 * @param event packet 3292 * @return role 3293 * @note: btstack_type 1 3294 */ 3295 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_role(const uint8_t * event){ 3296 return event[6]; 3297 } 3298 /** 3299 * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3300 * @param event packet 3301 * @return peer_address_type 3302 * @note: btstack_type 1 3303 */ 3304 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_peer_address_type(const uint8_t * event){ 3305 return event[7]; 3306 } 3307 /** 3308 * @brief Get field perr_addresss from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3309 * @param event packet 3310 * @param Pointer to storage for perr_addresss 3311 * @note: btstack_type B 3312 */ 3313 static inline void hci_subevent_le_enhanced_connection_complete_get_perr_addresss(const uint8_t * event, bd_addr_t perr_addresss){ 3314 reverse_bd_addr(&event[8], perr_addresss); 3315 } 3316 /** 3317 * @brief Get field local_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3318 * @param event packet 3319 * @param Pointer to storage for local_resolvable_private_addres 3320 * @note: btstack_type B 3321 */ 3322 static inline void hci_subevent_le_enhanced_connection_complete_get_local_resolvable_private_addres(const uint8_t * event, bd_addr_t local_resolvable_private_addres){ 3323 reverse_bd_addr(&event[14], local_resolvable_private_addres); 3324 } 3325 /** 3326 * @brief Get field peer_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3327 * @param event packet 3328 * @param Pointer to storage for peer_resolvable_private_addres 3329 * @note: btstack_type B 3330 */ 3331 static inline void hci_subevent_le_enhanced_connection_complete_get_peer_resolvable_private_addres(const uint8_t * event, bd_addr_t peer_resolvable_private_addres){ 3332 reverse_bd_addr(&event[20], peer_resolvable_private_addres); 3333 } 3334 /** 3335 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3336 * @param event packet 3337 * @return conn_interval 3338 * @note: btstack_type 2 3339 */ 3340 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_interval(const uint8_t * event){ 3341 return little_endian_read_16(event, 26); 3342 } 3343 /** 3344 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3345 * @param event packet 3346 * @return conn_latency 3347 * @note: btstack_type 2 3348 */ 3349 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_latency(const uint8_t * event){ 3350 return little_endian_read_16(event, 28); 3351 } 3352 /** 3353 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3354 * @param event packet 3355 * @return supervision_timeout 3356 * @note: btstack_type 2 3357 */ 3358 static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_supervision_timeout(const uint8_t * event){ 3359 return little_endian_read_16(event, 30); 3360 } 3361 /** 3362 * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE 3363 * @param event packet 3364 * @return master_clock_accuracy 3365 * @note: btstack_type 1 3366 */ 3367 static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 3368 return event[32]; 3369 } 3370 3371 /** 3372 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 3373 * @param event packet 3374 * @return status 3375 * @note: btstack_type 1 3376 */ 3377 static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t * event){ 3378 return event[3]; 3379 } 3380 3381 /** 3382 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 3383 * @param event packet 3384 * @return status 3385 * @note: btstack_type 1 3386 */ 3387 static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t * event){ 3388 return event[3]; 3389 } 3390 3391 /** 3392 * @brief Get field status from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 3393 * @param event packet 3394 * @return status 3395 * @note: btstack_type 1 3396 */ 3397 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){ 3398 return event[3]; 3399 } 3400 /** 3401 * @brief Get field handle from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 3402 * @param event packet 3403 * @return handle 3404 * @note: btstack_type H 3405 */ 3406 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){ 3407 return little_endian_read_16(event, 4); 3408 } 3409 3410 /** 3411 * @brief Get field status from event HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 3412 * @param event packet 3413 * @return status 3414 * @note: btstack_type 1 3415 */ 3416 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){ 3417 return event[3]; 3418 } 3419 3420 3421 /** 3422 * @brief Get field gain from event HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 3423 * @param event packet 3424 * @return gain 3425 * @note: btstack_type 1 3426 */ 3427 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){ 3428 return event[3]; 3429 } 3430 3431 /** 3432 * @brief Get field gain from event HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 3433 * @param event packet 3434 * @return gain 3435 * @note: btstack_type 1 3436 */ 3437 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){ 3438 return event[3]; 3439 } 3440 3441 /** 3442 * @brief Get field value_length from event HSP_SUBEVENT_HS_COMMAND 3443 * @param event packet 3444 * @return value_length 3445 * @note: btstack_type J 3446 */ 3447 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){ 3448 return event[3]; 3449 } 3450 /** 3451 * @brief Get field value from event HSP_SUBEVENT_HS_COMMAND 3452 * @param event packet 3453 * @return value 3454 * @note: btstack_type V 3455 */ 3456 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){ 3457 return &event[4]; 3458 } 3459 3460 /** 3461 * @brief Get field value_length from event HSP_SUBEVENT_AG_INDICATION 3462 * @param event packet 3463 * @return value_length 3464 * @note: btstack_type J 3465 */ 3466 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){ 3467 return event[3]; 3468 } 3469 /** 3470 * @brief Get field value from event HSP_SUBEVENT_AG_INDICATION 3471 * @param event packet 3472 * @return value 3473 * @note: btstack_type V 3474 */ 3475 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){ 3476 return &event[4]; 3477 } 3478 3479 /** 3480 * @brief Get field status from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3481 * @param event packet 3482 * @return status 3483 * @note: btstack_type 1 3484 */ 3485 static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t * event){ 3486 return event[3]; 3487 } 3488 /** 3489 * @brief Get field con_handle from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3490 * @param event packet 3491 * @return con_handle 3492 * @note: btstack_type H 3493 */ 3494 static inline hci_con_handle_t hfp_subevent_service_level_connection_established_get_con_handle(const uint8_t * event){ 3495 return little_endian_read_16(event, 4); 3496 } 3497 /** 3498 * @brief Get field bd_addr from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 3499 * @param event packet 3500 * @param Pointer to storage for bd_addr 3501 * @note: btstack_type B 3502 */ 3503 static inline void hfp_subevent_service_level_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3504 reverse_bd_addr(&event[6], bd_addr); 3505 } 3506 3507 3508 /** 3509 * @brief Get field status from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3510 * @param event packet 3511 * @return status 3512 * @note: btstack_type 1 3513 */ 3514 static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){ 3515 return event[3]; 3516 } 3517 /** 3518 * @brief Get field handle from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3519 * @param event packet 3520 * @return handle 3521 * @note: btstack_type H 3522 */ 3523 static inline hci_con_handle_t hfp_subevent_audio_connection_established_get_handle(const uint8_t * event){ 3524 return little_endian_read_16(event, 4); 3525 } 3526 /** 3527 * @brief Get field bd_addr from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3528 * @param event packet 3529 * @param Pointer to storage for bd_addr 3530 * @note: btstack_type B 3531 */ 3532 static inline void hfp_subevent_audio_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3533 reverse_bd_addr(&event[6], bd_addr); 3534 } 3535 /** 3536 * @brief Get field negotiated_codec from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 3537 * @param event packet 3538 * @return negotiated_codec 3539 * @note: btstack_type 1 3540 */ 3541 static inline uint8_t hfp_subevent_audio_connection_established_get_negotiated_codec(const uint8_t * event){ 3542 return event[12]; 3543 } 3544 3545 3546 /** 3547 * @brief Get field status from event HFP_SUBEVENT_COMPLETE 3548 * @param event packet 3549 * @return status 3550 * @note: btstack_type 1 3551 */ 3552 static inline uint8_t hfp_subevent_complete_get_status(const uint8_t * event){ 3553 return event[3]; 3554 } 3555 3556 /** 3557 * @brief Get field indicator_index from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3558 * @param event packet 3559 * @return indicator_index 3560 * @note: btstack_type 1 3561 */ 3562 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t * event){ 3563 return event[3]; 3564 } 3565 /** 3566 * @brief Get field indicator_status from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3567 * @param event packet 3568 * @return indicator_status 3569 * @note: btstack_type 1 3570 */ 3571 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t * event){ 3572 return event[4]; 3573 } 3574 /** 3575 * @brief Get field indicator_name from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 3576 * @param event packet 3577 * @return indicator_name 3578 * @note: btstack_type T 3579 */ 3580 static inline const char * hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t * event){ 3581 return (const char *) &event[5]; 3582 } 3583 3584 /** 3585 * @brief Get field network_operator_mode from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3586 * @param event packet 3587 * @return network_operator_mode 3588 * @note: btstack_type 1 3589 */ 3590 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t * event){ 3591 return event[3]; 3592 } 3593 /** 3594 * @brief Get field network_operator_format from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3595 * @param event packet 3596 * @return network_operator_format 3597 * @note: btstack_type 1 3598 */ 3599 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t * event){ 3600 return event[4]; 3601 } 3602 /** 3603 * @brief Get field network_operator_name from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 3604 * @param event packet 3605 * @return network_operator_name 3606 * @note: btstack_type T 3607 */ 3608 static inline const char * hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t * event){ 3609 return (const char *) &event[5]; 3610 } 3611 3612 /** 3613 * @brief Get field error from event HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 3614 * @param event packet 3615 * @return error 3616 * @note: btstack_type 1 3617 */ 3618 static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t * event){ 3619 return event[3]; 3620 } 3621 3622 3623 3624 3625 /** 3626 * @brief Get field number from event HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 3627 * @param event packet 3628 * @return number 3629 * @note: btstack_type T 3630 */ 3631 static inline const char * hfp_subevent_place_call_with_number_get_number(const uint8_t * event){ 3632 return (const char *) &event[3]; 3633 } 3634 3635 3636 /** 3637 * @brief Get field number from event HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 3638 * @param event packet 3639 * @return number 3640 * @note: btstack_type T 3641 */ 3642 static inline const char * hfp_subevent_number_for_voice_tag_get_number(const uint8_t * event){ 3643 return (const char *) &event[3]; 3644 } 3645 3646 /** 3647 * @brief Get field dtmf from event HFP_SUBEVENT_TRANSMIT_DTMF_CODES 3648 * @param event packet 3649 * @return dtmf 3650 * @note: btstack_type T 3651 */ 3652 static inline const char * hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t * event){ 3653 return (const char *) &event[3]; 3654 } 3655 3656 3657 3658 3659 /** 3660 * @brief Get field status from event HFP_SUBEVENT_SPEAKER_VOLUME 3661 * @param event packet 3662 * @return status 3663 * @note: btstack_type 1 3664 */ 3665 static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t * event){ 3666 return event[3]; 3667 } 3668 /** 3669 * @brief Get field gain from event HFP_SUBEVENT_SPEAKER_VOLUME 3670 * @param event packet 3671 * @return gain 3672 * @note: btstack_type 1 3673 */ 3674 static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t * event){ 3675 return event[4]; 3676 } 3677 3678 /** 3679 * @brief Get field status from event HFP_SUBEVENT_MICROPHONE_VOLUME 3680 * @param event packet 3681 * @return status 3682 * @note: btstack_type 1 3683 */ 3684 static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t * event){ 3685 return event[3]; 3686 } 3687 /** 3688 * @brief Get field gain from event HFP_SUBEVENT_MICROPHONE_VOLUME 3689 * @param event packet 3690 * @return gain 3691 * @note: btstack_type 1 3692 */ 3693 static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t * event){ 3694 return event[4]; 3695 } 3696 3697 /** 3698 * @brief Get field type from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 3699 * @param event packet 3700 * @return type 3701 * @note: btstack_type 1 3702 */ 3703 static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t * event){ 3704 return event[3]; 3705 } 3706 /** 3707 * @brief Get field number from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 3708 * @param event packet 3709 * @return number 3710 * @note: btstack_type T 3711 */ 3712 static inline const char * hfp_subevent_call_waiting_notification_get_number(const uint8_t * event){ 3713 return (const char *) &event[4]; 3714 } 3715 3716 /** 3717 * @brief Get field type from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 3718 * @param event packet 3719 * @return type 3720 * @note: btstack_type 1 3721 */ 3722 static inline uint8_t hfp_subevent_calling_line_indetification_notification_get_type(const uint8_t * event){ 3723 return event[3]; 3724 } 3725 /** 3726 * @brief Get field number from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 3727 * @param event packet 3728 * @return number 3729 * @note: btstack_type T 3730 */ 3731 static inline const char * hfp_subevent_calling_line_indetification_notification_get_number(const uint8_t * event){ 3732 return (const char *) &event[4]; 3733 } 3734 3735 /** 3736 * @brief Get field clcc_idx from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3737 * @param event packet 3738 * @return clcc_idx 3739 * @note: btstack_type 1 3740 */ 3741 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t * event){ 3742 return event[3]; 3743 } 3744 /** 3745 * @brief Get field clcc_dir from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3746 * @param event packet 3747 * @return clcc_dir 3748 * @note: btstack_type 1 3749 */ 3750 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t * event){ 3751 return event[4]; 3752 } 3753 /** 3754 * @brief Get field clcc_status from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3755 * @param event packet 3756 * @return clcc_status 3757 * @note: btstack_type 1 3758 */ 3759 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t * event){ 3760 return event[5]; 3761 } 3762 /** 3763 * @brief Get field clcc_mpty from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3764 * @param event packet 3765 * @return clcc_mpty 3766 * @note: btstack_type 1 3767 */ 3768 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t * event){ 3769 return event[6]; 3770 } 3771 /** 3772 * @brief Get field bnip_type from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3773 * @param event packet 3774 * @return bnip_type 3775 * @note: btstack_type 1 3776 */ 3777 static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t * event){ 3778 return event[7]; 3779 } 3780 /** 3781 * @brief Get field bnip_number from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 3782 * @param event packet 3783 * @return bnip_number 3784 * @note: btstack_type T 3785 */ 3786 static inline const char * hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t * event){ 3787 return (const char *) &event[8]; 3788 } 3789 3790 /** 3791 * @brief Get field status from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3792 * @param event packet 3793 * @return status 3794 * @note: btstack_type 1 3795 */ 3796 static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t * event){ 3797 return event[3]; 3798 } 3799 /** 3800 * @brief Get field bnip_type from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3801 * @param event packet 3802 * @return bnip_type 3803 * @note: btstack_type 1 3804 */ 3805 static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t * event){ 3806 return event[4]; 3807 } 3808 /** 3809 * @brief Get field bnip_number from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 3810 * @param event packet 3811 * @return bnip_number 3812 * @note: btstack_type T 3813 */ 3814 static inline const char * hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t * event){ 3815 return (const char *) &event[5]; 3816 } 3817 3818 /** 3819 * @brief Get field value from event HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 3820 * @param event packet 3821 * @return value 3822 * @note: btstack_type T 3823 */ 3824 static inline const char * hfp_subevent_response_and_hold_status_get_value(const uint8_t * event){ 3825 return (const char *) &event[3]; 3826 } 3827 3828 #ifdef ENABLE_BLE 3829 /** 3830 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_CONNECTED 3831 * @param event packet 3832 * @return handle 3833 * @note: btstack_type H 3834 */ 3835 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){ 3836 return little_endian_read_16(event, 3); 3837 } 3838 #endif 3839 3840 #ifdef ENABLE_BLE 3841 /** 3842 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3843 * @param event packet 3844 * @return handle 3845 * @note: btstack_type H 3846 */ 3847 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){ 3848 return little_endian_read_16(event, 3); 3849 } 3850 /** 3851 * @brief Get field attribute_id from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3852 * @param event packet 3853 * @return attribute_id 3854 * @note: btstack_type 2 3855 */ 3856 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){ 3857 return little_endian_read_16(event, 5); 3858 } 3859 /** 3860 * @brief Get field text from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 3861 * @param event packet 3862 * @return text 3863 * @note: btstack_type T 3864 */ 3865 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){ 3866 return (const char *) &event[7]; 3867 } 3868 #endif 3869 3870 #ifdef ENABLE_BLE 3871 /** 3872 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_DISCONNECTED 3873 * @param event packet 3874 * @return handle 3875 * @note: btstack_type H 3876 */ 3877 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){ 3878 return little_endian_read_16(event, 3); 3879 } 3880 #endif 3881 3882 /** 3883 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3884 * @param event packet 3885 * @return con_handle 3886 * @note: btstack_type H 3887 */ 3888 static inline hci_con_handle_t avdtp_subevent_signaling_accept_get_con_handle(const uint8_t * event){ 3889 return little_endian_read_16(event, 3); 3890 } 3891 /** 3892 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3893 * @param event packet 3894 * @return signal_identifier 3895 * @note: btstack_type 1 3896 */ 3897 static inline uint8_t avdtp_subevent_signaling_accept_get_signal_identifier(const uint8_t * event){ 3898 return event[5]; 3899 } 3900 /** 3901 * @brief Get field status from event AVDTP_SUBEVENT_SIGNALING_ACCEPT 3902 * @param event packet 3903 * @return status 3904 * @note: btstack_type 1 3905 */ 3906 static inline uint8_t avdtp_subevent_signaling_accept_get_status(const uint8_t * event){ 3907 return event[6]; 3908 } 3909 3910 /** 3911 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_REJECT 3912 * @param event packet 3913 * @return con_handle 3914 * @note: btstack_type H 3915 */ 3916 static inline hci_con_handle_t avdtp_subevent_signaling_reject_get_con_handle(const uint8_t * event){ 3917 return little_endian_read_16(event, 3); 3918 } 3919 /** 3920 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_REJECT 3921 * @param event packet 3922 * @return signal_identifier 3923 * @note: btstack_type 1 3924 */ 3925 static inline uint8_t avdtp_subevent_signaling_reject_get_signal_identifier(const uint8_t * event){ 3926 return event[5]; 3927 } 3928 3929 /** 3930 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 3931 * @param event packet 3932 * @return con_handle 3933 * @note: btstack_type H 3934 */ 3935 static inline hci_con_handle_t avdtp_subevent_signaling_general_reject_get_con_handle(const uint8_t * event){ 3936 return little_endian_read_16(event, 3); 3937 } 3938 /** 3939 * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT 3940 * @param event packet 3941 * @return signal_identifier 3942 * @note: btstack_type 1 3943 */ 3944 static inline uint8_t avdtp_subevent_signaling_general_reject_get_signal_identifier(const uint8_t * event){ 3945 return event[5]; 3946 } 3947 3948 /** 3949 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3950 * @param event packet 3951 * @return con_handle 3952 * @note: btstack_type H 3953 */ 3954 static inline hci_con_handle_t avdtp_subevent_signaling_connection_established_get_con_handle(const uint8_t * event){ 3955 return little_endian_read_16(event, 3); 3956 } 3957 /** 3958 * @brief Get field bd_addr from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3959 * @param event packet 3960 * @param Pointer to storage for bd_addr 3961 * @note: btstack_type B 3962 */ 3963 static inline void avdtp_subevent_signaling_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 3964 reverse_bd_addr(&event[5], bd_addr); 3965 } 3966 /** 3967 * @brief Get field status from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED 3968 * @param event packet 3969 * @return status 3970 * @note: btstack_type 1 3971 */ 3972 static inline uint8_t avdtp_subevent_signaling_connection_established_get_status(const uint8_t * event){ 3973 return event[11]; 3974 } 3975 3976 /** 3977 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED 3978 * @param event packet 3979 * @return con_handle 3980 * @note: btstack_type H 3981 */ 3982 static inline hci_con_handle_t avdtp_subevent_signaling_connection_released_get_con_handle(const uint8_t * event){ 3983 return little_endian_read_16(event, 3); 3984 } 3985 3986 /** 3987 * @brief Get field handle from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 3988 * @param event packet 3989 * @return handle 3990 * @note: btstack_type H 3991 */ 3992 static inline hci_con_handle_t avdtp_subevent_signaling_sep_found_get_handle(const uint8_t * event){ 3993 return little_endian_read_16(event, 3); 3994 } 3995 /** 3996 * @brief Get field seid from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 3997 * @param event packet 3998 * @return seid 3999 * @note: btstack_type 1 4000 */ 4001 static inline uint8_t avdtp_subevent_signaling_sep_found_get_seid(const uint8_t * event){ 4002 return event[5]; 4003 } 4004 /** 4005 * @brief Get field in_use from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4006 * @param event packet 4007 * @return in_use 4008 * @note: btstack_type 1 4009 */ 4010 static inline uint8_t avdtp_subevent_signaling_sep_found_get_in_use(const uint8_t * event){ 4011 return event[6]; 4012 } 4013 /** 4014 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4015 * @param event packet 4016 * @return media_type 4017 * @note: btstack_type 1 4018 */ 4019 static inline uint8_t avdtp_subevent_signaling_sep_found_get_media_type(const uint8_t * event){ 4020 return event[7]; 4021 } 4022 /** 4023 * @brief Get field sep_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND 4024 * @param event packet 4025 * @return sep_type 4026 * @note: btstack_type 1 4027 */ 4028 static inline uint8_t avdtp_subevent_signaling_sep_found_get_sep_type(const uint8_t * event){ 4029 return event[8]; 4030 } 4031 4032 /** 4033 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4034 * @param event packet 4035 * @return con_handle 4036 * @note: btstack_type H 4037 */ 4038 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_sbc_capability_get_con_handle(const uint8_t * event){ 4039 return little_endian_read_16(event, 3); 4040 } 4041 /** 4042 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4043 * @param event packet 4044 * @return media_type 4045 * @note: btstack_type 1 4046 */ 4047 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_media_type(const uint8_t * event){ 4048 return event[5]; 4049 } 4050 /** 4051 * @brief Get field sampling_frequency_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4052 * @param event packet 4053 * @return sampling_frequency_bitmap 4054 * @note: btstack_type 1 4055 */ 4056 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_sampling_frequency_bitmap(const uint8_t * event){ 4057 return event[6]; 4058 } 4059 /** 4060 * @brief Get field channel_mode_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4061 * @param event packet 4062 * @return channel_mode_bitmap 4063 * @note: btstack_type 1 4064 */ 4065 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_channel_mode_bitmap(const uint8_t * event){ 4066 return event[7]; 4067 } 4068 /** 4069 * @brief Get field block_length_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4070 * @param event packet 4071 * @return block_length_bitmap 4072 * @note: btstack_type 1 4073 */ 4074 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_block_length_bitmap(const uint8_t * event){ 4075 return event[8]; 4076 } 4077 /** 4078 * @brief Get field subbands_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4079 * @param event packet 4080 * @return subbands_bitmap 4081 * @note: btstack_type 1 4082 */ 4083 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_subbands_bitmap(const uint8_t * event){ 4084 return event[9]; 4085 } 4086 /** 4087 * @brief Get field allocation_method_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4088 * @param event packet 4089 * @return allocation_method_bitmap 4090 * @note: btstack_type 1 4091 */ 4092 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_allocation_method_bitmap(const uint8_t * event){ 4093 return event[10]; 4094 } 4095 /** 4096 * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4097 * @param event packet 4098 * @return min_bitpool_value 4099 * @note: btstack_type 1 4100 */ 4101 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(const uint8_t * event){ 4102 return event[11]; 4103 } 4104 /** 4105 * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY 4106 * @param event packet 4107 * @return max_bitpool_value 4108 * @note: btstack_type 1 4109 */ 4110 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_max_bitpool_value(const uint8_t * event){ 4111 return event[12]; 4112 } 4113 4114 /** 4115 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4116 * @param event packet 4117 * @return con_handle 4118 * @note: btstack_type H 4119 */ 4120 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_other_capability_get_con_handle(const uint8_t * event){ 4121 return little_endian_read_16(event, 3); 4122 } 4123 /** 4124 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4125 * @param event packet 4126 * @return media_type 4127 * @note: btstack_type 1 4128 */ 4129 static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_media_type(const uint8_t * event){ 4130 return event[5]; 4131 } 4132 /** 4133 * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4134 * @param event packet 4135 * @return media_codec_type 4136 * @note: btstack_type 2 4137 */ 4138 static inline uint16_t avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_type(const uint8_t * event){ 4139 return little_endian_read_16(event, 6); 4140 } 4141 /** 4142 * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4143 * @param event packet 4144 * @return media_codec_information_len 4145 * @note: btstack_type L 4146 */ 4147 static inline int avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information_len(const uint8_t * event){ 4148 return little_endian_read_16(event, 8); 4149 } 4150 /** 4151 * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY 4152 * @param event packet 4153 * @return media_codec_information 4154 * @note: btstack_type V 4155 */ 4156 static inline const uint8_t * avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information(const uint8_t * event){ 4157 return &event[10]; 4158 } 4159 4160 /** 4161 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4162 * @param event packet 4163 * @return con_handle 4164 * @note: btstack_type H 4165 */ 4166 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_con_handle(const uint8_t * event){ 4167 return little_endian_read_16(event, 3); 4168 } 4169 /** 4170 * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4171 * @param event packet 4172 * @return reconfigure 4173 * @note: btstack_type 1 4174 */ 4175 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_reconfigure(const uint8_t * event){ 4176 return event[5]; 4177 } 4178 /** 4179 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4180 * @param event packet 4181 * @return media_type 4182 * @note: btstack_type 1 4183 */ 4184 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_media_type(const uint8_t * event){ 4185 return event[6]; 4186 } 4187 /** 4188 * @brief Get field sampling_frequency from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4189 * @param event packet 4190 * @return sampling_frequency 4191 * @note: btstack_type 2 4192 */ 4193 static inline uint16_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_sampling_frequency(const uint8_t * event){ 4194 return little_endian_read_16(event, 7); 4195 } 4196 /** 4197 * @brief Get field channel_mode from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4198 * @param event packet 4199 * @return channel_mode 4200 * @note: btstack_type 1 4201 */ 4202 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(const uint8_t * event){ 4203 return event[9]; 4204 } 4205 /** 4206 * @brief Get field num_channels from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4207 * @param event packet 4208 * @return num_channels 4209 * @note: btstack_type 1 4210 */ 4211 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_num_channels(const uint8_t * event){ 4212 return event[10]; 4213 } 4214 /** 4215 * @brief Get field block_length from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4216 * @param event packet 4217 * @return block_length 4218 * @note: btstack_type 1 4219 */ 4220 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_block_length(const uint8_t * event){ 4221 return event[11]; 4222 } 4223 /** 4224 * @brief Get field subbands from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4225 * @param event packet 4226 * @return subbands 4227 * @note: btstack_type 1 4228 */ 4229 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_subbands(const uint8_t * event){ 4230 return event[12]; 4231 } 4232 /** 4233 * @brief Get field allocation_method from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4234 * @param event packet 4235 * @return allocation_method 4236 * @note: btstack_type 1 4237 */ 4238 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(const uint8_t * event){ 4239 return event[13]; 4240 } 4241 /** 4242 * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4243 * @param event packet 4244 * @return min_bitpool_value 4245 * @note: btstack_type 1 4246 */ 4247 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(const uint8_t * event){ 4248 return event[14]; 4249 } 4250 /** 4251 * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION 4252 * @param event packet 4253 * @return max_bitpool_value 4254 * @note: btstack_type 1 4255 */ 4256 static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(const uint8_t * event){ 4257 return event[15]; 4258 } 4259 4260 /** 4261 * @brief Get field con_handle from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4262 * @param event packet 4263 * @return con_handle 4264 * @note: btstack_type H 4265 */ 4266 static inline hci_con_handle_t avdtp_subevent_signaling_media_codec_other_configuration_get_con_handle(const uint8_t * event){ 4267 return little_endian_read_16(event, 3); 4268 } 4269 /** 4270 * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4271 * @param event packet 4272 * @return reconfigure 4273 * @note: btstack_type 1 4274 */ 4275 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_reconfigure(const uint8_t * event){ 4276 return event[5]; 4277 } 4278 /** 4279 * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4280 * @param event packet 4281 * @return media_type 4282 * @note: btstack_type 1 4283 */ 4284 static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_type(const uint8_t * event){ 4285 return event[6]; 4286 } 4287 /** 4288 * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4289 * @param event packet 4290 * @return media_codec_type 4291 * @note: btstack_type 2 4292 */ 4293 static inline uint16_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_type(const uint8_t * event){ 4294 return little_endian_read_16(event, 7); 4295 } 4296 /** 4297 * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4298 * @param event packet 4299 * @return media_codec_information_len 4300 * @note: btstack_type L 4301 */ 4302 static inline int avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information_len(const uint8_t * event){ 4303 return little_endian_read_16(event, 9); 4304 } 4305 /** 4306 * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION 4307 * @param event packet 4308 * @return media_codec_information 4309 * @note: btstack_type V 4310 */ 4311 static inline const uint8_t * avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information(const uint8_t * event){ 4312 return &event[11]; 4313 } 4314 4315 /** 4316 * @brief Get field con_handle from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4317 * @param event packet 4318 * @return con_handle 4319 * @note: btstack_type H 4320 */ 4321 static inline hci_con_handle_t avdtp_subevent_streaming_connection_established_get_con_handle(const uint8_t * event){ 4322 return little_endian_read_16(event, 3); 4323 } 4324 /** 4325 * @brief Get field status from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED 4326 * @param event packet 4327 * @return status 4328 * @note: btstack_type 1 4329 */ 4330 static inline uint8_t avdtp_subevent_streaming_connection_established_get_status(const uint8_t * event){ 4331 return event[5]; 4332 } 4333 4334 /** 4335 * @brief Get field con_handle from event AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED 4336 * @param event packet 4337 * @return con_handle 4338 * @note: btstack_type H 4339 */ 4340 static inline hci_con_handle_t avdtp_subevent_streaming_connection_released_get_con_handle(const uint8_t * event){ 4341 return little_endian_read_16(event, 3); 4342 } 4343 4344 /** 4345 * @brief Get field con_handle from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4346 * @param event packet 4347 * @return con_handle 4348 * @note: btstack_type H 4349 */ 4350 static inline hci_con_handle_t avrcp_subevent_connection_established_get_con_handle(const uint8_t * event){ 4351 return little_endian_read_16(event, 3); 4352 } 4353 /** 4354 * @brief Get field status from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4355 * @param event packet 4356 * @return status 4357 * @note: btstack_type 1 4358 */ 4359 static inline uint8_t avrcp_subevent_connection_established_get_status(const uint8_t * event){ 4360 return event[5]; 4361 } 4362 /** 4363 * @brief Get field local_cid from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4364 * @param event packet 4365 * @return local_cid 4366 * @note: btstack_type 2 4367 */ 4368 static inline uint16_t avrcp_subevent_connection_established_get_local_cid(const uint8_t * event){ 4369 return little_endian_read_16(event, 6); 4370 } 4371 /** 4372 * @brief Get field bd_addr from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED 4373 * @param event packet 4374 * @param Pointer to storage for bd_addr 4375 * @note: btstack_type B 4376 */ 4377 static inline void avrcp_subevent_connection_established_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 4378 reverse_bd_addr(&event[8], bd_addr); 4379 } 4380 4381 /** 4382 * @brief Get field con_handle from event AVRCP_SUBEVENT_CONNECTION_RELEASED 4383 * @param event packet 4384 * @return con_handle 4385 * @note: btstack_type H 4386 */ 4387 static inline hci_con_handle_t avrcp_subevent_connection_released_get_con_handle(const uint8_t * event){ 4388 return little_endian_read_16(event, 3); 4389 } 4390 4391 /** 4392 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4393 * @param event packet 4394 * @return con_handle 4395 * @note: btstack_type H 4396 */ 4397 static inline hci_con_handle_t avrcp_subevent_now_playing_info_get_con_handle(const uint8_t * event){ 4398 return little_endian_read_16(event, 3); 4399 } 4400 /** 4401 * @brief Get field status from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4402 * @param event packet 4403 * @return status 4404 * @note: btstack_type 1 4405 */ 4406 static inline uint8_t avrcp_subevent_now_playing_info_get_status(const uint8_t * event){ 4407 return event[5]; 4408 } 4409 /** 4410 * @brief Get field track from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4411 * @param event packet 4412 * @return track 4413 * @note: btstack_type 1 4414 */ 4415 static inline uint8_t avrcp_subevent_now_playing_info_get_track(const uint8_t * event){ 4416 return event[6]; 4417 } 4418 /** 4419 * @brief Get field total_tracks from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4420 * @param event packet 4421 * @return total_tracks 4422 * @note: btstack_type 1 4423 */ 4424 static inline uint8_t avrcp_subevent_now_playing_info_get_total_tracks(const uint8_t * event){ 4425 return event[7]; 4426 } 4427 /** 4428 * @brief Get field song_length from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4429 * @param event packet 4430 * @return song_length 4431 * @note: btstack_type 4 4432 */ 4433 static inline uint32_t avrcp_subevent_now_playing_info_get_song_length(const uint8_t * event){ 4434 return little_endian_read_32(event, 8); 4435 } 4436 /** 4437 * @brief Get field title_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4438 * @param event packet 4439 * @return title_len 4440 * @note: btstack_type J 4441 */ 4442 static inline int avrcp_subevent_now_playing_info_get_title_len(const uint8_t * event){ 4443 return event[12]; 4444 } 4445 /** 4446 * @brief Get field title from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4447 * @param event packet 4448 * @return title 4449 * @note: btstack_type V 4450 */ 4451 static inline const uint8_t * avrcp_subevent_now_playing_info_get_title(const uint8_t * event){ 4452 return &event[13]; 4453 } 4454 /** 4455 * @brief Get field artist_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4456 * @param event packet 4457 * @return artist_len 4458 * @note: btstack_type J 4459 */ 4460 static inline int avrcp_subevent_now_playing_info_get_artist_len(const uint8_t * event){ 4461 return event[13 + event[12]]; 4462 } 4463 /** 4464 * @brief Get field artist from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4465 * @param event packet 4466 * @return artist 4467 * @note: btstack_type V 4468 */ 4469 static inline const uint8_t * avrcp_subevent_now_playing_info_get_artist(const uint8_t * event){ 4470 return &event[13 + event[12] + 1]; 4471 } 4472 /** 4473 * @brief Get field album_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4474 * @param event packet 4475 * @return album_len 4476 * @note: btstack_type J 4477 */ 4478 static inline int avrcp_subevent_now_playing_info_get_album_len(const uint8_t * event){ 4479 return event[13 + event[12] + 1 + event[13 + event[12]]]; 4480 } 4481 /** 4482 * @brief Get field album from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4483 * @param event packet 4484 * @return album 4485 * @note: btstack_type V 4486 */ 4487 static inline const uint8_t * avrcp_subevent_now_playing_info_get_album(const uint8_t * event){ 4488 return &event[13 + event[12] + 1 + event[13 + event[12]] + 1]; 4489 } 4490 /** 4491 * @brief Get field genre_len from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4492 * @param event packet 4493 * @return genre_len 4494 * @note: btstack_type J 4495 */ 4496 static inline int avrcp_subevent_now_playing_info_get_genre_len(const uint8_t * event){ 4497 return event[13 + event[12] + 1 + event[13 + event[12]] + 1 + event[13 + event[12] + 1 + event[13 + event[12]]]]; 4498 } 4499 /** 4500 * @brief Get field genre from event AVRCP_SUBEVENT_NOW_PLAYING_INFO 4501 * @param event packet 4502 * @return genre 4503 * @note: btstack_type V 4504 */ 4505 static inline const uint8_t * avrcp_subevent_now_playing_info_get_genre(const uint8_t * event){ 4506 return &event[13 + event[12] + 1 + event[13 + event[12]] + 1 + event[13 + event[12] + 1 + event[13 + event[12]]] + 1]; 4507 } 4508 4509 /** 4510 * @brief Get field con_handle from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4511 * @param event packet 4512 * @return con_handle 4513 * @note: btstack_type H 4514 */ 4515 static inline hci_con_handle_t avrcp_subevent_shuffle_and_repeat_mode_get_con_handle(const uint8_t * event){ 4516 return little_endian_read_16(event, 3); 4517 } 4518 /** 4519 * @brief Get field status from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4520 * @param event packet 4521 * @return status 4522 * @note: btstack_type 1 4523 */ 4524 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_status(const uint8_t * event){ 4525 return event[5]; 4526 } 4527 /** 4528 * @brief Get field repeat_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4529 * @param event packet 4530 * @return repeat_mode 4531 * @note: btstack_type 1 4532 */ 4533 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_repeat_mode(const uint8_t * event){ 4534 return event[6]; 4535 } 4536 /** 4537 * @brief Get field shuffle_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE 4538 * @param event packet 4539 * @return shuffle_mode 4540 * @note: btstack_type 1 4541 */ 4542 static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_shuffle_mode(const uint8_t * event){ 4543 return event[7]; 4544 } 4545 4546 /** 4547 * @brief Get field con_handle from event AVRCP_SUBEVENT_PLAY_STATUS 4548 * @param event packet 4549 * @return con_handle 4550 * @note: btstack_type H 4551 */ 4552 static inline hci_con_handle_t avrcp_subevent_play_status_get_con_handle(const uint8_t * event){ 4553 return little_endian_read_16(event, 3); 4554 } 4555 /** 4556 * @brief Get field status from event AVRCP_SUBEVENT_PLAY_STATUS 4557 * @param event packet 4558 * @return status 4559 * @note: btstack_type 1 4560 */ 4561 static inline uint8_t avrcp_subevent_play_status_get_status(const uint8_t * event){ 4562 return event[5]; 4563 } 4564 /** 4565 * @brief Get field song_length from event AVRCP_SUBEVENT_PLAY_STATUS 4566 * @param event packet 4567 * @return song_length 4568 * @note: btstack_type 4 4569 */ 4570 static inline uint32_t avrcp_subevent_play_status_get_song_length(const uint8_t * event){ 4571 return little_endian_read_32(event, 6); 4572 } 4573 /** 4574 * @brief Get field song_position from event AVRCP_SUBEVENT_PLAY_STATUS 4575 * @param event packet 4576 * @return song_position 4577 * @note: btstack_type 4 4578 */ 4579 static inline uint32_t avrcp_subevent_play_status_get_song_position(const uint8_t * event){ 4580 return little_endian_read_32(event, 10); 4581 } 4582 /** 4583 * @brief Get field play_status from event AVRCP_SUBEVENT_PLAY_STATUS 4584 * @param event packet 4585 * @return play_status 4586 * @note: btstack_type 1 4587 */ 4588 static inline uint8_t avrcp_subevent_play_status_get_play_status(const uint8_t * event){ 4589 return event[14]; 4590 } 4591 4592 /** 4593 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4594 * @param event packet 4595 * @return con_handle 4596 * @note: btstack_type H 4597 */ 4598 static inline hci_con_handle_t avrcp_subevent_notification_playback_status_changed_get_con_handle(const uint8_t * event){ 4599 return little_endian_read_16(event, 3); 4600 } 4601 /** 4602 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4603 * @param event packet 4604 * @return status 4605 * @note: btstack_type 1 4606 */ 4607 static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_status(const uint8_t * event){ 4608 return event[5]; 4609 } 4610 /** 4611 * @brief Get field playback_status from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED 4612 * @param event packet 4613 * @return playback_status 4614 * @note: btstack_type 1 4615 */ 4616 static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_playback_status(const uint8_t * event){ 4617 return event[6]; 4618 } 4619 4620 /** 4621 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4622 * @param event packet 4623 * @return con_handle 4624 * @note: btstack_type H 4625 */ 4626 static inline hci_con_handle_t avrcp_subevent_notification_track_changed_get_con_handle(const uint8_t * event){ 4627 return little_endian_read_16(event, 3); 4628 } 4629 /** 4630 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4631 * @param event packet 4632 * @return status 4633 * @note: btstack_type 1 4634 */ 4635 static inline uint8_t avrcp_subevent_notification_track_changed_get_status(const uint8_t * event){ 4636 return event[5]; 4637 } 4638 /** 4639 * @brief Get field track_status from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED 4640 * @param event packet 4641 * @return track_status 4642 * @note: btstack_type 1 4643 */ 4644 static inline uint8_t avrcp_subevent_notification_track_changed_get_track_status(const uint8_t * event){ 4645 return event[6]; 4646 } 4647 4648 /** 4649 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 4650 * @param event packet 4651 * @return con_handle 4652 * @note: btstack_type H 4653 */ 4654 static inline hci_con_handle_t avrcp_subevent_notification_now_playing_content_changed_get_con_handle(const uint8_t * event){ 4655 return little_endian_read_16(event, 3); 4656 } 4657 /** 4658 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED 4659 * @param event packet 4660 * @return status 4661 * @note: btstack_type 1 4662 */ 4663 static inline uint8_t avrcp_subevent_notification_now_playing_content_changed_get_status(const uint8_t * event){ 4664 return event[5]; 4665 } 4666 4667 /** 4668 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 4669 * @param event packet 4670 * @return con_handle 4671 * @note: btstack_type H 4672 */ 4673 static inline hci_con_handle_t avrcp_subevent_notification_available_players_changed_get_con_handle(const uint8_t * event){ 4674 return little_endian_read_16(event, 3); 4675 } 4676 /** 4677 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED 4678 * @param event packet 4679 * @return status 4680 * @note: btstack_type 1 4681 */ 4682 static inline uint8_t avrcp_subevent_notification_available_players_changed_get_status(const uint8_t * event){ 4683 return event[5]; 4684 } 4685 4686 /** 4687 * @brief Get field con_handle from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4688 * @param event packet 4689 * @return con_handle 4690 * @note: btstack_type H 4691 */ 4692 static inline hci_con_handle_t avrcp_subevent_notification_volume_changed_get_con_handle(const uint8_t * event){ 4693 return little_endian_read_16(event, 3); 4694 } 4695 /** 4696 * @brief Get field status from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4697 * @param event packet 4698 * @return status 4699 * @note: btstack_type 1 4700 */ 4701 static inline uint8_t avrcp_subevent_notification_volume_changed_get_status(const uint8_t * event){ 4702 return event[5]; 4703 } 4704 /** 4705 * @brief Get field absolute_volume from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED 4706 * @param event packet 4707 * @return absolute_volume 4708 * @note: btstack_type 1 4709 */ 4710 static inline uint8_t avrcp_subevent_notification_volume_changed_get_absolute_volume(const uint8_t * event){ 4711 return event[6]; 4712 } 4713 4714 /** 4715 * @brief Get field con_handle from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4716 * @param event packet 4717 * @return con_handle 4718 * @note: btstack_type H 4719 */ 4720 static inline hci_con_handle_t avrcp_subevent_set_absolute_volume_response_get_con_handle(const uint8_t * event){ 4721 return little_endian_read_16(event, 3); 4722 } 4723 /** 4724 * @brief Get field status from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4725 * @param event packet 4726 * @return status 4727 * @note: btstack_type 1 4728 */ 4729 static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_status(const uint8_t * event){ 4730 return event[5]; 4731 } 4732 /** 4733 * @brief Get field absolute_volume from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE 4734 * @param event packet 4735 * @return absolute_volume 4736 * @note: btstack_type 1 4737 */ 4738 static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_absolute_volume(const uint8_t * event){ 4739 return event[6]; 4740 } 4741 4742 /** 4743 * @brief Get field con_handle from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 4744 * @param event packet 4745 * @return con_handle 4746 * @note: btstack_type H 4747 */ 4748 static inline hci_con_handle_t avrcp_subevent_enable_notification_complete_get_con_handle(const uint8_t * event){ 4749 return little_endian_read_16(event, 3); 4750 } 4751 /** 4752 * @brief Get field status from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 4753 * @param event packet 4754 * @return status 4755 * @note: btstack_type 1 4756 */ 4757 static inline uint8_t avrcp_subevent_enable_notification_complete_get_status(const uint8_t * event){ 4758 return event[5]; 4759 } 4760 /** 4761 * @brief Get field notification_id from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE 4762 * @param event packet 4763 * @return notification_id 4764 * @note: btstack_type 1 4765 */ 4766 static inline uint8_t avrcp_subevent_enable_notification_complete_get_notification_id(const uint8_t * event){ 4767 return event[6]; 4768 } 4769 4770 /** 4771 * @brief Get field con_handle from event AVRCP_SUBEVENT_OPERATION_START 4772 * @param event packet 4773 * @return con_handle 4774 * @note: btstack_type H 4775 */ 4776 static inline hci_con_handle_t avrcp_subevent_operation_start_get_con_handle(const uint8_t * event){ 4777 return little_endian_read_16(event, 3); 4778 } 4779 /** 4780 * @brief Get field status from event AVRCP_SUBEVENT_OPERATION_START 4781 * @param event packet 4782 * @return status 4783 * @note: btstack_type 1 4784 */ 4785 static inline uint8_t avrcp_subevent_operation_start_get_status(const uint8_t * event){ 4786 return event[5]; 4787 } 4788 /** 4789 * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_START 4790 * @param event packet 4791 * @return operation_id 4792 * @note: btstack_type 1 4793 */ 4794 static inline uint8_t avrcp_subevent_operation_start_get_operation_id(const uint8_t * event){ 4795 return event[6]; 4796 } 4797 4798 /** 4799 * @brief Get field con_handle from event AVRCP_SUBEVENT_OPERATION_COMPLETE 4800 * @param event packet 4801 * @return con_handle 4802 * @note: btstack_type H 4803 */ 4804 static inline hci_con_handle_t avrcp_subevent_operation_complete_get_con_handle(const uint8_t * event){ 4805 return little_endian_read_16(event, 3); 4806 } 4807 /** 4808 * @brief Get field status from event AVRCP_SUBEVENT_OPERATION_COMPLETE 4809 * @param event packet 4810 * @return status 4811 * @note: btstack_type 1 4812 */ 4813 static inline uint8_t avrcp_subevent_operation_complete_get_status(const uint8_t * event){ 4814 return event[5]; 4815 } 4816 /** 4817 * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_COMPLETE 4818 * @param event packet 4819 * @return operation_id 4820 * @note: btstack_type 1 4821 */ 4822 static inline uint8_t avrcp_subevent_operation_complete_get_operation_id(const uint8_t * event){ 4823 return event[6]; 4824 } 4825 4826 /** 4827 * @brief Get field con_handle from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 4828 * @param event packet 4829 * @return con_handle 4830 * @note: btstack_type H 4831 */ 4832 static inline hci_con_handle_t avrcp_subevent_player_application_value_response_get_con_handle(const uint8_t * event){ 4833 return little_endian_read_16(event, 3); 4834 } 4835 /** 4836 * @brief Get field status from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE 4837 * @param event packet 4838 * @return status 4839 * @note: btstack_type 1 4840 */ 4841 static inline uint8_t avrcp_subevent_player_application_value_response_get_status(const uint8_t * event){ 4842 return event[5]; 4843 } 4844 4845 /** 4846 * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_OPENED 4847 * @param event packet 4848 * @return goep_cid 4849 * @note: btstack_type 2 4850 */ 4851 static inline uint16_t goep_subevent_connection_opened_get_goep_cid(const uint8_t * event){ 4852 return little_endian_read_16(event, 3); 4853 } 4854 /** 4855 * @brief Get field status from event GOEP_SUBEVENT_CONNECTION_OPENED 4856 * @param event packet 4857 * @return status 4858 * @note: btstack_type 1 4859 */ 4860 static inline uint8_t goep_subevent_connection_opened_get_status(const uint8_t * event){ 4861 return event[5]; 4862 } 4863 /** 4864 * @brief Get field bd_addr from event GOEP_SUBEVENT_CONNECTION_OPENED 4865 * @param event packet 4866 * @param Pointer to storage for bd_addr 4867 * @note: btstack_type B 4868 */ 4869 static inline void goep_subevent_connection_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 4870 reverse_bd_addr(&event[6], bd_addr); 4871 } 4872 /** 4873 * @brief Get field con_handle from event GOEP_SUBEVENT_CONNECTION_OPENED 4874 * @param event packet 4875 * @return con_handle 4876 * @note: btstack_type H 4877 */ 4878 static inline hci_con_handle_t goep_subevent_connection_opened_get_con_handle(const uint8_t * event){ 4879 return little_endian_read_16(event, 12); 4880 } 4881 /** 4882 * @brief Get field incoming from event GOEP_SUBEVENT_CONNECTION_OPENED 4883 * @param event packet 4884 * @return incoming 4885 * @note: btstack_type 1 4886 */ 4887 static inline uint8_t goep_subevent_connection_opened_get_incoming(const uint8_t * event){ 4888 return event[14]; 4889 } 4890 4891 /** 4892 * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_CLOSED 4893 * @param event packet 4894 * @return goep_cid 4895 * @note: btstack_type 2 4896 */ 4897 static inline uint16_t goep_subevent_connection_closed_get_goep_cid(const uint8_t * event){ 4898 return little_endian_read_16(event, 3); 4899 } 4900 4901 /** 4902 * @brief Get field goep_cid from event GOEP_SUBEVENT_CAN_SEND_NOW 4903 * @param event packet 4904 * @return goep_cid 4905 * @note: btstack_type 2 4906 */ 4907 static inline uint16_t goep_subevent_can_send_now_get_goep_cid(const uint8_t * event){ 4908 return little_endian_read_16(event, 3); 4909 } 4910 4911 /** 4912 * @brief Get field pbap_cid from event PBAP_SUBEVENT_CONNECTION_OPENED 4913 * @param event packet 4914 * @return pbap_cid 4915 * @note: btstack_type 2 4916 */ 4917 static inline uint16_t pbap_subevent_connection_opened_get_pbap_cid(const uint8_t * event){ 4918 return little_endian_read_16(event, 3); 4919 } 4920 /** 4921 * @brief Get field status from event PBAP_SUBEVENT_CONNECTION_OPENED 4922 * @param event packet 4923 * @return status 4924 * @note: btstack_type 1 4925 */ 4926 static inline uint8_t pbap_subevent_connection_opened_get_status(const uint8_t * event){ 4927 return event[5]; 4928 } 4929 /** 4930 * @brief Get field bd_addr from event PBAP_SUBEVENT_CONNECTION_OPENED 4931 * @param event packet 4932 * @param Pointer to storage for bd_addr 4933 * @note: btstack_type B 4934 */ 4935 static inline void pbap_subevent_connection_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 4936 reverse_bd_addr(&event[6], bd_addr); 4937 } 4938 /** 4939 * @brief Get field con_handle from event PBAP_SUBEVENT_CONNECTION_OPENED 4940 * @param event packet 4941 * @return con_handle 4942 * @note: btstack_type H 4943 */ 4944 static inline hci_con_handle_t pbap_subevent_connection_opened_get_con_handle(const uint8_t * event){ 4945 return little_endian_read_16(event, 12); 4946 } 4947 /** 4948 * @brief Get field incoming from event PBAP_SUBEVENT_CONNECTION_OPENED 4949 * @param event packet 4950 * @return incoming 4951 * @note: btstack_type 1 4952 */ 4953 static inline uint8_t pbap_subevent_connection_opened_get_incoming(const uint8_t * event){ 4954 return event[14]; 4955 } 4956 4957 /** 4958 * @brief Get field goep_cid from event PBAP_SUBEVENT_CONNECTION_CLOSED 4959 * @param event packet 4960 * @return goep_cid 4961 * @note: btstack_type 2 4962 */ 4963 static inline uint16_t pbap_subevent_connection_closed_get_goep_cid(const uint8_t * event){ 4964 return little_endian_read_16(event, 3); 4965 } 4966 4967 /** 4968 * @brief Get field goep_cid from event PBAP_SUBEVENT_OPERATION_COMPLETED 4969 * @param event packet 4970 * @return goep_cid 4971 * @note: btstack_type 2 4972 */ 4973 static inline uint16_t pbap_subevent_operation_completed_get_goep_cid(const uint8_t * event){ 4974 return little_endian_read_16(event, 3); 4975 } 4976 /** 4977 * @brief Get field status from event PBAP_SUBEVENT_OPERATION_COMPLETED 4978 * @param event packet 4979 * @return status 4980 * @note: btstack_type 1 4981 */ 4982 static inline uint8_t pbap_subevent_operation_completed_get_status(const uint8_t * event){ 4983 return event[5]; 4984 } 4985 4986 /** 4987 * @brief Get field hid_cid from event HID_SUBEVENT_CONNECTION_OPENED 4988 * @param event packet 4989 * @return hid_cid 4990 * @note: btstack_type 2 4991 */ 4992 static inline uint16_t hid_subevent_connection_opened_get_hid_cid(const uint8_t * event){ 4993 return little_endian_read_16(event, 3); 4994 } 4995 /** 4996 * @brief Get field status from event HID_SUBEVENT_CONNECTION_OPENED 4997 * @param event packet 4998 * @return status 4999 * @note: btstack_type 1 5000 */ 5001 static inline uint8_t hid_subevent_connection_opened_get_status(const uint8_t * event){ 5002 return event[5]; 5003 } 5004 /** 5005 * @brief Get field bd_addr from event HID_SUBEVENT_CONNECTION_OPENED 5006 * @param event packet 5007 * @param Pointer to storage for bd_addr 5008 * @note: btstack_type B 5009 */ 5010 static inline void hid_subevent_connection_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 5011 reverse_bd_addr(&event[6], bd_addr); 5012 } 5013 /** 5014 * @brief Get field con_handle from event HID_SUBEVENT_CONNECTION_OPENED 5015 * @param event packet 5016 * @return con_handle 5017 * @note: btstack_type H 5018 */ 5019 static inline hci_con_handle_t hid_subevent_connection_opened_get_con_handle(const uint8_t * event){ 5020 return little_endian_read_16(event, 12); 5021 } 5022 /** 5023 * @brief Get field incoming from event HID_SUBEVENT_CONNECTION_OPENED 5024 * @param event packet 5025 * @return incoming 5026 * @note: btstack_type 1 5027 */ 5028 static inline uint8_t hid_subevent_connection_opened_get_incoming(const uint8_t * event){ 5029 return event[14]; 5030 } 5031 5032 /** 5033 * @brief Get field hid_cid from event HID_SUBEVENT_CONNECTION_CLOSED 5034 * @param event packet 5035 * @return hid_cid 5036 * @note: btstack_type 2 5037 */ 5038 static inline uint16_t hid_subevent_connection_closed_get_hid_cid(const uint8_t * event){ 5039 return little_endian_read_16(event, 3); 5040 } 5041 5042 /** 5043 * @brief Get field hid_cid from event HID_SUBEVENT_CAN_SEND_NOW 5044 * @param event packet 5045 * @return hid_cid 5046 * @note: btstack_type 2 5047 */ 5048 static inline uint16_t hid_subevent_can_send_now_get_hid_cid(const uint8_t * event){ 5049 return little_endian_read_16(event, 3); 5050 } 5051 5052 5053 5054 /* API_END */ 5055 5056 #if defined __cplusplus 5057 } 5058 #endif 5059 5060 #endif // __BTSTACK_EVENT_H 5061