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 hsp event 74 * @param event packet 75 * @return subevent_code 76 */ 77 static inline uint8_t hci_event_hsp_meta_get_subevent_code(const uint8_t * event){ 78 return event[2]; 79 } 80 /*** 81 * @brief Get subevent code for hfp event 82 * @param event packet 83 * @return subevent_code 84 */ 85 static inline uint8_t hci_event_hfp_meta_get_subevent_code(const uint8_t * event){ 86 return event[2]; 87 } 88 /*** 89 * @brief Get subevent code for ancs event 90 * @param event packet 91 * @return subevent_code 92 */ 93 static inline uint8_t hci_event_ancs_meta_get_subevent_code(const uint8_t * event){ 94 return event[2]; 95 } 96 /*** 97 * @brief Get subevent code for le event 98 * @param event packet 99 * @return subevent_code 100 */ 101 static inline uint8_t hci_event_le_meta_get_subevent_code(const uint8_t * event){ 102 return event[2]; 103 } 104 /** 105 * @brief Get field status from event hci_event_inquiry_complete 106 * @param event packet 107 * @return status 108 * @note: btstack_type 1 109 */ 110 static inline uint8_t hci_event_inquiry_complete_get_status(const uint8_t * event){ 111 return event[2]; 112 } 113 114 /** 115 * @brief Get field num_responses from event hci_event_inquiry_result 116 * @param event packet 117 * @return num_responses 118 * @note: btstack_type 1 119 */ 120 static inline uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t * event){ 121 return event[2]; 122 } 123 /** 124 * @brief Get field bd_addr from event hci_event_inquiry_result 125 * @param event packet 126 * @param Pointer to storage for bd_addr 127 * @note: btstack_type B 128 */ 129 static inline void hci_event_inquiry_result_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 130 reverse_bd_addr(&event[3], bd_addr); 131 } 132 /** 133 * @brief Get field page_scan_repetition_mode from event hci_event_inquiry_result 134 * @param event packet 135 * @return page_scan_repetition_mode 136 * @note: btstack_type 1 137 */ 138 static inline uint8_t hci_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t * event){ 139 return event[9]; 140 } 141 /** 142 * @brief Get field reserved1 from event hci_event_inquiry_result 143 * @param event packet 144 * @return reserved1 145 * @note: btstack_type 1 146 */ 147 static inline uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t * event){ 148 return event[10]; 149 } 150 /** 151 * @brief Get field reserved2 from event hci_event_inquiry_result 152 * @param event packet 153 * @return reserved2 154 * @note: btstack_type 1 155 */ 156 static inline uint8_t hci_event_inquiry_result_get_reserved2(const uint8_t * event){ 157 return event[11]; 158 } 159 /** 160 * @brief Get field class_of_device from event hci_event_inquiry_result 161 * @param event packet 162 * @return class_of_device 163 * @note: btstack_type 3 164 */ 165 static inline uint32_t hci_event_inquiry_result_get_class_of_device(const uint8_t * event){ 166 return little_endian_read_24(event, 12); 167 } 168 /** 169 * @brief Get field clock_offset from event hci_event_inquiry_result 170 * @param event packet 171 * @return clock_offset 172 * @note: btstack_type 2 173 */ 174 static inline uint16_t hci_event_inquiry_result_get_clock_offset(const uint8_t * event){ 175 return little_endian_read_16(event, 15); 176 } 177 178 /** 179 * @brief Get field status from event hci_event_connection_complete 180 * @param event packet 181 * @return status 182 * @note: btstack_type 1 183 */ 184 static inline uint8_t hci_event_connection_complete_get_status(const uint8_t * event){ 185 return event[2]; 186 } 187 /** 188 * @brief Get field connection_handle from event hci_event_connection_complete 189 * @param event packet 190 * @return connection_handle 191 * @note: btstack_type 2 192 */ 193 static inline uint16_t hci_event_connection_complete_get_connection_handle(const uint8_t * event){ 194 return little_endian_read_16(event, 3); 195 } 196 /** 197 * @brief Get field bd_addr from event hci_event_connection_complete 198 * @param event packet 199 * @param Pointer to storage for bd_addr 200 * @note: btstack_type B 201 */ 202 static inline void hci_event_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 203 reverse_bd_addr(&event[5], bd_addr); 204 } 205 /** 206 * @brief Get field link_type from event hci_event_connection_complete 207 * @param event packet 208 * @return link_type 209 * @note: btstack_type 1 210 */ 211 static inline uint8_t hci_event_connection_complete_get_link_type(const uint8_t * event){ 212 return event[11]; 213 } 214 /** 215 * @brief Get field encryption_enabled from event hci_event_connection_complete 216 * @param event packet 217 * @return encryption_enabled 218 * @note: btstack_type 1 219 */ 220 static inline uint8_t hci_event_connection_complete_get_encryption_enabled(const uint8_t * event){ 221 return event[12]; 222 } 223 224 /** 225 * @brief Get field bd_addr from event hci_event_connection_request 226 * @param event packet 227 * @param Pointer to storage for bd_addr 228 * @note: btstack_type B 229 */ 230 static inline void hci_event_connection_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 231 reverse_bd_addr(&event[2], bd_addr); 232 } 233 /** 234 * @brief Get field class_of_device from event hci_event_connection_request 235 * @param event packet 236 * @return class_of_device 237 * @note: btstack_type 3 238 */ 239 static inline uint32_t hci_event_connection_request_get_class_of_device(const uint8_t * event){ 240 return little_endian_read_24(event, 8); 241 } 242 /** 243 * @brief Get field link_type from event hci_event_connection_request 244 * @param event packet 245 * @return link_type 246 * @note: btstack_type 1 247 */ 248 static inline uint8_t hci_event_connection_request_get_link_type(const uint8_t * event){ 249 return event[11]; 250 } 251 252 /** 253 * @brief Get field status from event hci_event_disconnection_complete 254 * @param event packet 255 * @return status 256 * @note: btstack_type 1 257 */ 258 static inline uint8_t hci_event_disconnection_complete_get_status(const uint8_t * event){ 259 return event[2]; 260 } 261 /** 262 * @brief Get field connection_handle from event hci_event_disconnection_complete 263 * @param event packet 264 * @return connection_handle 265 * @note: btstack_type 2 266 */ 267 static inline uint16_t hci_event_disconnection_complete_get_connection_handle(const uint8_t * event){ 268 return little_endian_read_16(event, 3); 269 } 270 /** 271 * @brief Get field reason from event hci_event_disconnection_complete 272 * @param event packet 273 * @return reason 274 * @note: btstack_type 1 275 */ 276 static inline uint8_t hci_event_disconnection_complete_get_reason(const uint8_t * event){ 277 return event[5]; 278 } 279 280 /** 281 * @brief Get field status from event hci_event_authentication_complete_event 282 * @param event packet 283 * @return status 284 * @note: btstack_type 1 285 */ 286 static inline uint8_t hci_event_authentication_complete_event_get_status(const uint8_t * event){ 287 return event[2]; 288 } 289 /** 290 * @brief Get field connection_handle from event hci_event_authentication_complete_event 291 * @param event packet 292 * @return connection_handle 293 * @note: btstack_type 2 294 */ 295 static inline uint16_t hci_event_authentication_complete_event_get_connection_handle(const uint8_t * event){ 296 return little_endian_read_16(event, 3); 297 } 298 299 /** 300 * @brief Get field status from event hci_event_remote_name_request_complete 301 * @param event packet 302 * @return status 303 * @note: btstack_type 1 304 */ 305 // static inline uint8_t hci_event_remote_name_request_complete_get_status(const uint8_t * event){ 306 // not implemented yet 307 // } 308 /** 309 * @brief Get field bd_addr from event hci_event_remote_name_request_complete 310 * @param event packet 311 * @return bd_addr 312 * @note: btstack_type B 313 */ 314 // static inline bd_addr_t hci_event_remote_name_request_complete_get_bd_addr(const uint8_t * event){ 315 // not implemented yet 316 // } 317 /** 318 * @brief Get field remote_name from event hci_event_remote_name_request_complete 319 * @param event packet 320 * @return remote_name 321 * @note: btstack_type N 322 */ 323 // static inline String hci_event_remote_name_request_complete_get_remote_name(const uint8_t * event){ 324 // not implemented yet 325 // } 326 327 /** 328 * @brief Get field status from event hci_event_encryption_change 329 * @param event packet 330 * @return status 331 * @note: btstack_type 1 332 */ 333 static inline uint8_t hci_event_encryption_change_get_status(const uint8_t * event){ 334 return event[2]; 335 } 336 /** 337 * @brief Get field connection_handle from event hci_event_encryption_change 338 * @param event packet 339 * @return connection_handle 340 * @note: btstack_type 2 341 */ 342 static inline uint16_t hci_event_encryption_change_get_connection_handle(const uint8_t * event){ 343 return little_endian_read_16(event, 3); 344 } 345 /** 346 * @brief Get field encryption_enabled from event hci_event_encryption_change 347 * @param event packet 348 * @return encryption_enabled 349 * @note: btstack_type 1 350 */ 351 static inline uint8_t hci_event_encryption_change_get_encryption_enabled(const uint8_t * event){ 352 return event[5]; 353 } 354 355 /** 356 * @brief Get field status from event hci_event_change_connection_link_key_complete 357 * @param event packet 358 * @return status 359 * @note: btstack_type 1 360 */ 361 static inline uint8_t hci_event_change_connection_link_key_complete_get_status(const uint8_t * event){ 362 return event[2]; 363 } 364 /** 365 * @brief Get field connection_handle from event hci_event_change_connection_link_key_complete 366 * @param event packet 367 * @return connection_handle 368 * @note: btstack_type 2 369 */ 370 static inline uint16_t hci_event_change_connection_link_key_complete_get_connection_handle(const uint8_t * event){ 371 return little_endian_read_16(event, 3); 372 } 373 374 /** 375 * @brief Get field status from event hci_event_master_link_key_complete 376 * @param event packet 377 * @return status 378 * @note: btstack_type 1 379 */ 380 static inline uint8_t hci_event_master_link_key_complete_get_status(const uint8_t * event){ 381 return event[2]; 382 } 383 /** 384 * @brief Get field connection_handle from event hci_event_master_link_key_complete 385 * @param event packet 386 * @return connection_handle 387 * @note: btstack_type 2 388 */ 389 static inline uint16_t hci_event_master_link_key_complete_get_connection_handle(const uint8_t * event){ 390 return little_endian_read_16(event, 3); 391 } 392 /** 393 * @brief Get field key_flag from event hci_event_master_link_key_complete 394 * @param event packet 395 * @return key_flag 396 * @note: btstack_type 1 397 */ 398 static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint8_t * event){ 399 return event[5]; 400 } 401 402 /** 403 * @brief Get field num_hci_command_packets from event hci_event_command_complete 404 * @param event packet 405 * @return num_hci_command_packets 406 * @note: btstack_type 1 407 */ 408 static inline uint8_t hci_event_command_complete_get_num_hci_command_packets(const uint8_t * event){ 409 return event[2]; 410 } 411 /** 412 * @brief Get field command_opcode from event hci_event_command_complete 413 * @param event packet 414 * @return command_opcode 415 * @note: btstack_type 2 416 */ 417 static inline uint16_t hci_event_command_complete_get_command_opcode(const uint8_t * event){ 418 return little_endian_read_16(event, 3); 419 } 420 /** 421 * @brief Get field return_parameters from event hci_event_command_complete 422 * @param event packet 423 * @return return_parameters 424 * @note: btstack_type R 425 */ 426 static inline const uint8_t * hci_event_command_complete_get_return_parameters(const uint8_t * event){ 427 return &event[5]; 428 } 429 430 /** 431 * @brief Get field status from event hci_event_command_status 432 * @param event packet 433 * @return status 434 * @note: btstack_type 1 435 */ 436 static inline uint8_t hci_event_command_status_get_status(const uint8_t * event){ 437 return event[2]; 438 } 439 /** 440 * @brief Get field num_hci_command_packets from event hci_event_command_status 441 * @param event packet 442 * @return num_hci_command_packets 443 * @note: btstack_type 1 444 */ 445 static inline uint8_t hci_event_command_status_get_num_hci_command_packets(const uint8_t * event){ 446 return event[3]; 447 } 448 /** 449 * @brief Get field command_opcode from event hci_event_command_status 450 * @param event packet 451 * @return command_opcode 452 * @note: btstack_type 2 453 */ 454 static inline uint16_t hci_event_command_status_get_command_opcode(const uint8_t * event){ 455 return little_endian_read_16(event, 4); 456 } 457 458 /** 459 * @brief Get field hardware_code from event hci_event_hardware_error 460 * @param event packet 461 * @return hardware_code 462 * @note: btstack_type 1 463 */ 464 static inline uint8_t hci_event_hardware_error_get_hardware_code(const uint8_t * event){ 465 return event[2]; 466 } 467 468 /** 469 * @brief Get field status from event hci_event_role_change 470 * @param event packet 471 * @return status 472 * @note: btstack_type 1 473 */ 474 static inline uint8_t hci_event_role_change_get_status(const uint8_t * event){ 475 return event[2]; 476 } 477 /** 478 * @brief Get field bd_addr from event hci_event_role_change 479 * @param event packet 480 * @param Pointer to storage for bd_addr 481 * @note: btstack_type B 482 */ 483 static inline void hci_event_role_change_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 484 reverse_bd_addr(&event[3], bd_addr); 485 } 486 /** 487 * @brief Get field role from event hci_event_role_change 488 * @param event packet 489 * @return role 490 * @note: btstack_type 1 491 */ 492 static inline uint8_t hci_event_role_change_get_role(const uint8_t * event){ 493 return event[9]; 494 } 495 496 /** 497 * @brief Get field status from event hci_event_mode_change_event 498 * @param event packet 499 * @return status 500 * @note: btstack_type 1 501 */ 502 static inline uint8_t hci_event_mode_change_event_get_status(const uint8_t * event){ 503 return event[2]; 504 } 505 /** 506 * @brief Get field handle from event hci_event_mode_change_event 507 * @param event packet 508 * @return handle 509 * @note: btstack_type H 510 */ 511 static inline hci_con_handle_t hci_event_mode_change_event_get_handle(const uint8_t * event){ 512 return little_endian_read_16(event, 3); 513 } 514 /** 515 * @brief Get field mode from event hci_event_mode_change_event 516 * @param event packet 517 * @return mode 518 * @note: btstack_type 1 519 */ 520 static inline uint8_t hci_event_mode_change_event_get_mode(const uint8_t * event){ 521 return event[5]; 522 } 523 /** 524 * @brief Get field interval from event hci_event_mode_change_event 525 * @param event packet 526 * @return interval 527 * @note: btstack_type 2 528 */ 529 static inline uint16_t hci_event_mode_change_event_get_interval(const uint8_t * event){ 530 return little_endian_read_16(event, 6); 531 } 532 533 /** 534 * @brief Get field bd_addr from event hci_event_pin_code_request 535 * @param event packet 536 * @param Pointer to storage for bd_addr 537 * @note: btstack_type B 538 */ 539 static inline void hci_event_pin_code_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 540 reverse_bd_addr(&event[2], bd_addr); 541 } 542 543 /** 544 * @brief Get field bd_addr from event hci_event_link_key_request 545 * @param event packet 546 * @param Pointer to storage for bd_addr 547 * @note: btstack_type B 548 */ 549 static inline void hci_event_link_key_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 550 reverse_bd_addr(&event[2], bd_addr); 551 } 552 553 /** 554 * @brief Get field link_type from event hci_event_data_buffer_overflow 555 * @param event packet 556 * @return link_type 557 * @note: btstack_type 1 558 */ 559 static inline uint8_t hci_event_data_buffer_overflow_get_link_type(const uint8_t * event){ 560 return event[2]; 561 } 562 563 /** 564 * @brief Get field handle from event hci_event_max_slots_changed 565 * @param event packet 566 * @return handle 567 * @note: btstack_type H 568 */ 569 static inline hci_con_handle_t hci_event_max_slots_changed_get_handle(const uint8_t * event){ 570 return little_endian_read_16(event, 2); 571 } 572 /** 573 * @brief Get field lmp_max_slots from event hci_event_max_slots_changed 574 * @param event packet 575 * @return lmp_max_slots 576 * @note: btstack_type 1 577 */ 578 static inline uint8_t hci_event_max_slots_changed_get_lmp_max_slots(const uint8_t * event){ 579 return event[4]; 580 } 581 582 /** 583 * @brief Get field status from event hci_event_read_clock_offset_complete 584 * @param event packet 585 * @return status 586 * @note: btstack_type 1 587 */ 588 static inline uint8_t hci_event_read_clock_offset_complete_get_status(const uint8_t * event){ 589 return event[2]; 590 } 591 /** 592 * @brief Get field handle from event hci_event_read_clock_offset_complete 593 * @param event packet 594 * @return handle 595 * @note: btstack_type H 596 */ 597 static inline hci_con_handle_t hci_event_read_clock_offset_complete_get_handle(const uint8_t * event){ 598 return little_endian_read_16(event, 3); 599 } 600 /** 601 * @brief Get field clock_offset from event hci_event_read_clock_offset_complete 602 * @param event packet 603 * @return clock_offset 604 * @note: btstack_type 2 605 */ 606 static inline uint16_t hci_event_read_clock_offset_complete_get_clock_offset(const uint8_t * event){ 607 return little_endian_read_16(event, 5); 608 } 609 610 /** 611 * @brief Get field status from event hci_event_connection_packet_type_changed 612 * @param event packet 613 * @return status 614 * @note: btstack_type 1 615 */ 616 static inline uint8_t hci_event_connection_packet_type_changed_get_status(const uint8_t * event){ 617 return event[2]; 618 } 619 /** 620 * @brief Get field handle from event hci_event_connection_packet_type_changed 621 * @param event packet 622 * @return handle 623 * @note: btstack_type H 624 */ 625 static inline hci_con_handle_t hci_event_connection_packet_type_changed_get_handle(const uint8_t * event){ 626 return little_endian_read_16(event, 3); 627 } 628 /** 629 * @brief Get field packet_types from event hci_event_connection_packet_type_changed 630 * @param event packet 631 * @return packet_types 632 * @note: btstack_type 2 633 */ 634 static inline uint16_t hci_event_connection_packet_type_changed_get_packet_types(const uint8_t * event){ 635 return little_endian_read_16(event, 5); 636 } 637 638 /** 639 * @brief Get field num_responses from event hci_event_inquiry_result_with_rssi 640 * @param event packet 641 * @return num_responses 642 * @note: btstack_type 1 643 */ 644 static inline uint8_t hci_event_inquiry_result_with_rssi_get_num_responses(const uint8_t * event){ 645 return event[2]; 646 } 647 /** 648 * @brief Get field bd_addr from event hci_event_inquiry_result_with_rssi 649 * @param event packet 650 * @param Pointer to storage for bd_addr 651 * @note: btstack_type B 652 */ 653 static inline void hci_event_inquiry_result_with_rssi_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 654 reverse_bd_addr(&event[3], bd_addr); 655 } 656 /** 657 * @brief Get field page_scan_repetition_mode from event hci_event_inquiry_result_with_rssi 658 * @param event packet 659 * @return page_scan_repetition_mode 660 * @note: btstack_type 1 661 */ 662 static inline uint8_t hci_event_inquiry_result_with_rssi_get_page_scan_repetition_mode(const uint8_t * event){ 663 return event[9]; 664 } 665 /** 666 * @brief Get field reserved from event hci_event_inquiry_result_with_rssi 667 * @param event packet 668 * @return reserved 669 * @note: btstack_type 1 670 */ 671 static inline uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t * event){ 672 return event[10]; 673 } 674 /** 675 * @brief Get field class_of_device from event hci_event_inquiry_result_with_rssi 676 * @param event packet 677 * @return class_of_device 678 * @note: btstack_type 3 679 */ 680 static inline uint32_t hci_event_inquiry_result_with_rssi_get_class_of_device(const uint8_t * event){ 681 return little_endian_read_24(event, 11); 682 } 683 /** 684 * @brief Get field clock_offset from event hci_event_inquiry_result_with_rssi 685 * @param event packet 686 * @return clock_offset 687 * @note: btstack_type 2 688 */ 689 static inline uint16_t hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t * event){ 690 return little_endian_read_16(event, 14); 691 } 692 /** 693 * @brief Get field rssi from event hci_event_inquiry_result_with_rssi 694 * @param event packet 695 * @return rssi 696 * @note: btstack_type 1 697 */ 698 static inline uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t * event){ 699 return event[16]; 700 } 701 702 /** 703 * @brief Get field status from event hci_event_synchronous_connection_complete 704 * @param event packet 705 * @return status 706 * @note: btstack_type 1 707 */ 708 static inline uint8_t hci_event_synchronous_connection_complete_get_status(const uint8_t * event){ 709 return event[2]; 710 } 711 /** 712 * @brief Get field handle from event hci_event_synchronous_connection_complete 713 * @param event packet 714 * @return handle 715 * @note: btstack_type H 716 */ 717 static inline hci_con_handle_t hci_event_synchronous_connection_complete_get_handle(const uint8_t * event){ 718 return little_endian_read_16(event, 3); 719 } 720 /** 721 * @brief Get field bd_addr from event hci_event_synchronous_connection_complete 722 * @param event packet 723 * @param Pointer to storage for bd_addr 724 * @note: btstack_type B 725 */ 726 static inline void hci_event_synchronous_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 727 reverse_bd_addr(&event[5], bd_addr); 728 } 729 /** 730 * @brief Get field link_type from event hci_event_synchronous_connection_complete 731 * @param event packet 732 * @return link_type 733 * @note: btstack_type 1 734 */ 735 static inline uint8_t hci_event_synchronous_connection_complete_get_link_type(const uint8_t * event){ 736 return event[11]; 737 } 738 /** 739 * @brief Get field transmission_interval from event hci_event_synchronous_connection_complete 740 * @param event packet 741 * @return transmission_interval 742 * @note: btstack_type 1 743 */ 744 static inline uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(const uint8_t * event){ 745 return event[12]; 746 } 747 /** 748 * @brief Get field retransmission_interval from event hci_event_synchronous_connection_complete 749 * @param event packet 750 * @return retransmission_interval 751 * @note: btstack_type 1 752 */ 753 static inline uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(const uint8_t * event){ 754 return event[13]; 755 } 756 /** 757 * @brief Get field rx_packet_length from event hci_event_synchronous_connection_complete 758 * @param event packet 759 * @return rx_packet_length 760 * @note: btstack_type 2 761 */ 762 static inline uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(const uint8_t * event){ 763 return little_endian_read_16(event, 14); 764 } 765 /** 766 * @brief Get field tx_packet_length from event hci_event_synchronous_connection_complete 767 * @param event packet 768 * @return tx_packet_length 769 * @note: btstack_type 2 770 */ 771 static inline uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(const uint8_t * event){ 772 return little_endian_read_16(event, 16); 773 } 774 /** 775 * @brief Get field air_mode from event hci_event_synchronous_connection_complete 776 * @param event packet 777 * @return air_mode 778 * @note: btstack_type 1 779 */ 780 static inline uint8_t hci_event_synchronous_connection_complete_get_air_mode(const uint8_t * event){ 781 return event[18]; 782 } 783 784 /** 785 * @brief Get field num_responses from event hci_event_extended_inquiry_response 786 * @param event packet 787 * @return num_responses 788 * @note: btstack_type 1 789 */ 790 static inline uint8_t hci_event_extended_inquiry_response_get_num_responses(const uint8_t * event){ 791 return event[2]; 792 } 793 /** 794 * @brief Get field bd_addr from event hci_event_extended_inquiry_response 795 * @param event packet 796 * @param Pointer to storage for bd_addr 797 * @note: btstack_type B 798 */ 799 static inline void hci_event_extended_inquiry_response_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 800 reverse_bd_addr(&event[3], bd_addr); 801 } 802 /** 803 * @brief Get field page_scan_repetition_mode from event hci_event_extended_inquiry_response 804 * @param event packet 805 * @return page_scan_repetition_mode 806 * @note: btstack_type 1 807 */ 808 static inline uint8_t hci_event_extended_inquiry_response_get_page_scan_repetition_mode(const uint8_t * event){ 809 return event[9]; 810 } 811 /** 812 * @brief Get field reserved from event hci_event_extended_inquiry_response 813 * @param event packet 814 * @return reserved 815 * @note: btstack_type 1 816 */ 817 static inline uint8_t hci_event_extended_inquiry_response_get_reserved(const uint8_t * event){ 818 return event[10]; 819 } 820 /** 821 * @brief Get field class_of_device from event hci_event_extended_inquiry_response 822 * @param event packet 823 * @return class_of_device 824 * @note: btstack_type 3 825 */ 826 static inline uint32_t hci_event_extended_inquiry_response_get_class_of_device(const uint8_t * event){ 827 return little_endian_read_24(event, 11); 828 } 829 /** 830 * @brief Get field clock_offset from event hci_event_extended_inquiry_response 831 * @param event packet 832 * @return clock_offset 833 * @note: btstack_type 2 834 */ 835 static inline uint16_t hci_event_extended_inquiry_response_get_clock_offset(const uint8_t * event){ 836 return little_endian_read_16(event, 14); 837 } 838 /** 839 * @brief Get field rssi from event hci_event_extended_inquiry_response 840 * @param event packet 841 * @return rssi 842 * @note: btstack_type 1 843 */ 844 static inline uint8_t hci_event_extended_inquiry_response_get_rssi(const uint8_t * event){ 845 return event[16]; 846 } 847 848 /** 849 * @brief Get field status from event hci_event_encryption_key_refresh_complete 850 * @param event packet 851 * @return status 852 * @note: btstack_type 1 853 */ 854 static inline uint8_t hci_event_encryption_key_refresh_complete_get_status(const uint8_t * event){ 855 return event[2]; 856 } 857 /** 858 * @brief Get field handle from event hci_event_encryption_key_refresh_complete 859 * @param event packet 860 * @return handle 861 * @note: btstack_type H 862 */ 863 static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_handle(const uint8_t * event){ 864 return little_endian_read_16(event, 3); 865 } 866 867 868 /** 869 * @brief Get field state from event btstack_event_state 870 * @param event packet 871 * @return state 872 * @note: btstack_type 1 873 */ 874 static inline uint8_t btstack_event_state_get_state(const uint8_t * event){ 875 return event[2]; 876 } 877 878 879 /** 880 * @brief Get field discoverable from event btstack_event_discoverable_enabled 881 * @param event packet 882 * @return discoverable 883 * @note: btstack_type 1 884 */ 885 static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t * event){ 886 return event[2]; 887 } 888 889 /** 890 * @brief Get field handle from event hci_event_sco_can_send_now 891 * @param event packet 892 * @param Pointer to storage for handle 893 * @note: btstack_type B 894 */ 895 static inline void hci_event_sco_can_send_now_get_handle(const uint8_t * event, bd_addr_t handle){ 896 reverse_bd_addr(&event[2], handle); 897 } 898 899 /** 900 * @brief Get field status from event l2cap_event_channel_opened 901 * @param event packet 902 * @return status 903 * @note: btstack_type 1 904 */ 905 static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t * event){ 906 return event[2]; 907 } 908 /** 909 * @brief Get field address from event l2cap_event_channel_opened 910 * @param event packet 911 * @param Pointer to storage for address 912 * @note: btstack_type B 913 */ 914 static inline void l2cap_event_channel_opened_get_address(const uint8_t * event, bd_addr_t address){ 915 reverse_bd_addr(&event[3], address); 916 } 917 /** 918 * @brief Get field handle from event l2cap_event_channel_opened 919 * @param event packet 920 * @return handle 921 * @note: btstack_type H 922 */ 923 static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t * event){ 924 return little_endian_read_16(event, 9); 925 } 926 /** 927 * @brief Get field psm from event l2cap_event_channel_opened 928 * @param event packet 929 * @return psm 930 * @note: btstack_type 2 931 */ 932 static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t * event){ 933 return little_endian_read_16(event, 11); 934 } 935 /** 936 * @brief Get field local_cid from event l2cap_event_channel_opened 937 * @param event packet 938 * @return local_cid 939 * @note: btstack_type 2 940 */ 941 static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t * event){ 942 return little_endian_read_16(event, 13); 943 } 944 /** 945 * @brief Get field remote_cid from event l2cap_event_channel_opened 946 * @param event packet 947 * @return remote_cid 948 * @note: btstack_type 2 949 */ 950 static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t * event){ 951 return little_endian_read_16(event, 15); 952 } 953 /** 954 * @brief Get field local_mtu from event l2cap_event_channel_opened 955 * @param event packet 956 * @return local_mtu 957 * @note: btstack_type 2 958 */ 959 static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t * event){ 960 return little_endian_read_16(event, 17); 961 } 962 /** 963 * @brief Get field remote_mtu from event l2cap_event_channel_opened 964 * @param event packet 965 * @return remote_mtu 966 * @note: btstack_type 2 967 */ 968 static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t * event){ 969 return little_endian_read_16(event, 19); 970 } 971 /** 972 * @brief Get field flush_timeout from event l2cap_event_channel_opened 973 * @param event packet 974 * @return flush_timeout 975 * @note: btstack_type 2 976 */ 977 static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t * event){ 978 return little_endian_read_16(event, 21); 979 } 980 981 /** 982 * @brief Get field local_cid from event l2cap_event_channel_closed 983 * @param event packet 984 * @return local_cid 985 * @note: btstack_type 2 986 */ 987 static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t * event){ 988 return little_endian_read_16(event, 2); 989 } 990 991 /** 992 * @brief Get field status from event l2cap_event_incoming_connection 993 * @param event packet 994 * @return status 995 * @note: btstack_type 1 996 */ 997 static inline uint8_t l2cap_event_incoming_connection_get_status(const uint8_t * event){ 998 return event[2]; 999 } 1000 /** 1001 * @brief Get field address from event l2cap_event_incoming_connection 1002 * @param event packet 1003 * @param Pointer to storage for address 1004 * @note: btstack_type B 1005 */ 1006 static inline void l2cap_event_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ 1007 reverse_bd_addr(&event[3], address); 1008 } 1009 /** 1010 * @brief Get field handle from event l2cap_event_incoming_connection 1011 * @param event packet 1012 * @return handle 1013 * @note: btstack_type H 1014 */ 1015 static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t * event){ 1016 return little_endian_read_16(event, 9); 1017 } 1018 /** 1019 * @brief Get field psm from event l2cap_event_incoming_connection 1020 * @param event packet 1021 * @return psm 1022 * @note: btstack_type 2 1023 */ 1024 static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t * event){ 1025 return little_endian_read_16(event, 11); 1026 } 1027 /** 1028 * @brief Get field local_cid from event l2cap_event_incoming_connection 1029 * @param event packet 1030 * @return local_cid 1031 * @note: btstack_type 2 1032 */ 1033 static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t * event){ 1034 return little_endian_read_16(event, 13); 1035 } 1036 /** 1037 * @brief Get field remote_cid from event l2cap_event_incoming_connection 1038 * @param event packet 1039 * @return remote_cid 1040 * @note: btstack_type 2 1041 */ 1042 static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t * event){ 1043 return little_endian_read_16(event, 15); 1044 } 1045 1046 /** 1047 * @brief Get field handle from event l2cap_event_connection_parameter_update_request 1048 * @param event packet 1049 * @return handle 1050 * @note: btstack_type H 1051 */ 1052 static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t * event){ 1053 return little_endian_read_16(event, 2); 1054 } 1055 /** 1056 * @brief Get field interval_min from event l2cap_event_connection_parameter_update_request 1057 * @param event packet 1058 * @return interval_min 1059 * @note: btstack_type 2 1060 */ 1061 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t * event){ 1062 return little_endian_read_16(event, 4); 1063 } 1064 /** 1065 * @brief Get field interval_max from event l2cap_event_connection_parameter_update_request 1066 * @param event packet 1067 * @return interval_max 1068 * @note: btstack_type 2 1069 */ 1070 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t * event){ 1071 return little_endian_read_16(event, 6); 1072 } 1073 /** 1074 * @brief Get field latencey from event l2cap_event_connection_parameter_update_request 1075 * @param event packet 1076 * @return latencey 1077 * @note: btstack_type 2 1078 */ 1079 static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t * event){ 1080 return little_endian_read_16(event, 8); 1081 } 1082 /** 1083 * @brief Get field timeout_multiplier from event l2cap_event_connection_parameter_update_request 1084 * @param event packet 1085 * @return timeout_multiplier 1086 * @note: btstack_type 2 1087 */ 1088 static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t * event){ 1089 return little_endian_read_16(event, 10); 1090 } 1091 1092 /** 1093 * @brief Get field handle from event l2cap_event_connection_parameter_update_response 1094 * @param event packet 1095 * @return handle 1096 * @note: btstack_type H 1097 */ 1098 static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t * event){ 1099 return little_endian_read_16(event, 2); 1100 } 1101 1102 /** 1103 * @brief Get field local_cid from event l2cap_event_can_send_now 1104 * @param event packet 1105 * @return local_cid 1106 * @note: btstack_type 2 1107 */ 1108 static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * event){ 1109 return little_endian_read_16(event, 2); 1110 } 1111 1112 /** 1113 * @brief Get field status from event rfcomm_event_channel_opened 1114 * @param event packet 1115 * @return status 1116 * @note: btstack_type 1 1117 */ 1118 static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t * event){ 1119 return event[2]; 1120 } 1121 /** 1122 * @brief Get field bd_addr from event rfcomm_event_channel_opened 1123 * @param event packet 1124 * @param Pointer to storage for bd_addr 1125 * @note: btstack_type B 1126 */ 1127 static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1128 reverse_bd_addr(&event[3], bd_addr); 1129 } 1130 /** 1131 * @brief Get field con_handle from event rfcomm_event_channel_opened 1132 * @param event packet 1133 * @return con_handle 1134 * @note: btstack_type 2 1135 */ 1136 static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t * event){ 1137 return little_endian_read_16(event, 9); 1138 } 1139 /** 1140 * @brief Get field server_channel from event rfcomm_event_channel_opened 1141 * @param event packet 1142 * @return server_channel 1143 * @note: btstack_type 1 1144 */ 1145 static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t * event){ 1146 return event[11]; 1147 } 1148 /** 1149 * @brief Get field rfcomm_cid from event rfcomm_event_channel_opened 1150 * @param event packet 1151 * @return rfcomm_cid 1152 * @note: btstack_type 2 1153 */ 1154 static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t * event){ 1155 return little_endian_read_16(event, 12); 1156 } 1157 /** 1158 * @brief Get field max_frame_size from event rfcomm_event_channel_opened 1159 * @param event packet 1160 * @return max_frame_size 1161 * @note: btstack_type 2 1162 */ 1163 static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t * event){ 1164 return little_endian_read_16(event, 14); 1165 } 1166 1167 /** 1168 * @brief Get field rfcomm_cid from event rfcomm_event_channel_closed 1169 * @param event packet 1170 * @return rfcomm_cid 1171 * @note: btstack_type 2 1172 */ 1173 static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t * event){ 1174 return little_endian_read_16(event, 2); 1175 } 1176 1177 /** 1178 * @brief Get field bd_addr from event rfcomm_event_incoming_connection 1179 * @param event packet 1180 * @param Pointer to storage for bd_addr 1181 * @note: btstack_type B 1182 */ 1183 static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1184 reverse_bd_addr(&event[2], bd_addr); 1185 } 1186 /** 1187 * @brief Get field server_channel from event rfcomm_event_incoming_connection 1188 * @param event packet 1189 * @return server_channel 1190 * @note: btstack_type 1 1191 */ 1192 static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t * event){ 1193 return event[8]; 1194 } 1195 /** 1196 * @brief Get field rfcomm_cid from event rfcomm_event_incoming_connection 1197 * @param event packet 1198 * @return rfcomm_cid 1199 * @note: btstack_type 2 1200 */ 1201 static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t * event){ 1202 return little_endian_read_16(event, 9); 1203 } 1204 1205 /** 1206 * @brief Get field rfcomm_cid from event rfcomm_event_remote_line_status 1207 * @param event packet 1208 * @return rfcomm_cid 1209 * @note: btstack_type 2 1210 */ 1211 static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t * event){ 1212 return little_endian_read_16(event, 2); 1213 } 1214 /** 1215 * @brief Get field line_status from event rfcomm_event_remote_line_status 1216 * @param event packet 1217 * @return line_status 1218 * @note: btstack_type 1 1219 */ 1220 static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t * event){ 1221 return event[4]; 1222 } 1223 1224 /** 1225 * @brief Get field rfcomm_cid from event rfcomm_event_remote_modem_status 1226 * @param event packet 1227 * @return rfcomm_cid 1228 * @note: btstack_type 2 1229 */ 1230 static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t * event){ 1231 return little_endian_read_16(event, 2); 1232 } 1233 /** 1234 * @brief Get field modem_status from event rfcomm_event_remote_modem_status 1235 * @param event packet 1236 * @return modem_status 1237 * @note: btstack_type 1 1238 */ 1239 static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t * event){ 1240 return event[4]; 1241 } 1242 1243 /** 1244 * @brief Get field rfcomm_cid from event rfcomm_event_can_send_now 1245 * @param event packet 1246 * @return rfcomm_cid 1247 * @note: btstack_type 2 1248 */ 1249 static inline uint16_t rfcomm_event_can_send_now_get_rfcomm_cid(const uint8_t * event){ 1250 return little_endian_read_16(event, 2); 1251 } 1252 1253 /** 1254 * @brief Get field status from event sdp_event_query_complete 1255 * @param event packet 1256 * @return status 1257 * @note: btstack_type 1 1258 */ 1259 static inline uint8_t sdp_event_query_complete_get_status(const uint8_t * event){ 1260 return event[2]; 1261 } 1262 1263 /** 1264 * @brief Get field rfcomm_channel from event sdp_event_query_rfcomm_service 1265 * @param event packet 1266 * @return rfcomm_channel 1267 * @note: btstack_type 1 1268 */ 1269 static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t * event){ 1270 return event[2]; 1271 } 1272 /** 1273 * @brief Get field name from event sdp_event_query_rfcomm_service 1274 * @param event packet 1275 * @return name 1276 * @note: btstack_type T 1277 */ 1278 static inline const char * sdp_event_query_rfcomm_service_get_name(const uint8_t * event){ 1279 return (const char *) &event[3]; 1280 } 1281 1282 /** 1283 * @brief Get field record_id from event sdp_event_query_attribute_byte 1284 * @param event packet 1285 * @return record_id 1286 * @note: btstack_type 2 1287 */ 1288 static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t * event){ 1289 return little_endian_read_16(event, 2); 1290 } 1291 /** 1292 * @brief Get field attribute_id from event sdp_event_query_attribute_byte 1293 * @param event packet 1294 * @return attribute_id 1295 * @note: btstack_type 2 1296 */ 1297 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t * event){ 1298 return little_endian_read_16(event, 4); 1299 } 1300 /** 1301 * @brief Get field attribute_length from event sdp_event_query_attribute_byte 1302 * @param event packet 1303 * @return attribute_length 1304 * @note: btstack_type 2 1305 */ 1306 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t * event){ 1307 return little_endian_read_16(event, 6); 1308 } 1309 /** 1310 * @brief Get field data_offset from event sdp_event_query_attribute_byte 1311 * @param event packet 1312 * @return data_offset 1313 * @note: btstack_type 2 1314 */ 1315 static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t * event){ 1316 return little_endian_read_16(event, 8); 1317 } 1318 /** 1319 * @brief Get field data from event sdp_event_query_attribute_byte 1320 * @param event packet 1321 * @return data 1322 * @note: btstack_type 1 1323 */ 1324 static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t * event){ 1325 return event[10]; 1326 } 1327 1328 /** 1329 * @brief Get field record_id from event sdp_event_query_attribute_value 1330 * @param event packet 1331 * @return record_id 1332 * @note: btstack_type 2 1333 */ 1334 static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t * event){ 1335 return little_endian_read_16(event, 2); 1336 } 1337 /** 1338 * @brief Get field attribute_id from event sdp_event_query_attribute_value 1339 * @param event packet 1340 * @return attribute_id 1341 * @note: btstack_type 2 1342 */ 1343 static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t * event){ 1344 return little_endian_read_16(event, 4); 1345 } 1346 /** 1347 * @brief Get field attribute_length from event sdp_event_query_attribute_value 1348 * @param event packet 1349 * @return attribute_length 1350 * @note: btstack_type L 1351 */ 1352 static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t * event){ 1353 return little_endian_read_16(event, 6); 1354 } 1355 /** 1356 * @brief Get field attribute_value from event sdp_event_query_attribute_value 1357 * @param event packet 1358 * @return attribute_value 1359 * @note: btstack_type V 1360 */ 1361 static inline const uint8_t * sdp_event_query_attribute_value_get_attribute_value(const uint8_t * event){ 1362 return &event[8]; 1363 } 1364 1365 /** 1366 * @brief Get field total_count from event sdp_event_query_service_record_handle 1367 * @param event packet 1368 * @return total_count 1369 * @note: btstack_type 2 1370 */ 1371 static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t * event){ 1372 return little_endian_read_16(event, 2); 1373 } 1374 /** 1375 * @brief Get field record_index from event sdp_event_query_service_record_handle 1376 * @param event packet 1377 * @return record_index 1378 * @note: btstack_type 2 1379 */ 1380 static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t * event){ 1381 return little_endian_read_16(event, 4); 1382 } 1383 /** 1384 * @brief Get field record_handle from event sdp_event_query_service_record_handle 1385 * @param event packet 1386 * @return record_handle 1387 * @note: btstack_type 4 1388 */ 1389 static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t * event){ 1390 return little_endian_read_32(event, 6); 1391 } 1392 1393 #ifdef ENABLE_BLE 1394 /** 1395 * @brief Get field handle from event gatt_event_query_complete 1396 * @param event packet 1397 * @return handle 1398 * @note: btstack_type H 1399 */ 1400 static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t * event){ 1401 return little_endian_read_16(event, 2); 1402 } 1403 /** 1404 * @brief Get field status from event gatt_event_query_complete 1405 * @param event packet 1406 * @return status 1407 * @note: btstack_type 1 1408 */ 1409 static inline uint8_t gatt_event_query_complete_get_status(const uint8_t * event){ 1410 return event[4]; 1411 } 1412 #endif 1413 1414 #ifdef ENABLE_BLE 1415 /** 1416 * @brief Get field handle from event gatt_event_service_query_result 1417 * @param event packet 1418 * @return handle 1419 * @note: btstack_type H 1420 */ 1421 static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t * event){ 1422 return little_endian_read_16(event, 2); 1423 } 1424 /** 1425 * @brief Get field service from event gatt_event_service_query_result 1426 * @param event packet 1427 * @param Pointer to storage for service 1428 * @note: btstack_type X 1429 */ 1430 static inline void gatt_event_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1431 gatt_client_deserialize_service(event, 4, service); 1432 } 1433 #endif 1434 1435 #ifdef ENABLE_BLE 1436 /** 1437 * @brief Get field handle from event gatt_event_characteristic_query_result 1438 * @param event packet 1439 * @return handle 1440 * @note: btstack_type H 1441 */ 1442 static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t * event){ 1443 return little_endian_read_16(event, 2); 1444 } 1445 /** 1446 * @brief Get field characteristic from event gatt_event_characteristic_query_result 1447 * @param event packet 1448 * @param Pointer to storage for characteristic 1449 * @note: btstack_type Y 1450 */ 1451 static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t * event, gatt_client_characteristic_t * characteristic){ 1452 gatt_client_deserialize_characteristic(event, 4, characteristic); 1453 } 1454 #endif 1455 1456 #ifdef ENABLE_BLE 1457 /** 1458 * @brief Get field handle from event gatt_event_included_service_query_result 1459 * @param event packet 1460 * @return handle 1461 * @note: btstack_type H 1462 */ 1463 static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){ 1464 return little_endian_read_16(event, 2); 1465 } 1466 /** 1467 * @brief Get field include_handle from event gatt_event_included_service_query_result 1468 * @param event packet 1469 * @return include_handle 1470 * @note: btstack_type 2 1471 */ 1472 static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){ 1473 return little_endian_read_16(event, 4); 1474 } 1475 /** 1476 * @brief Get field service from event gatt_event_included_service_query_result 1477 * @param event packet 1478 * @param Pointer to storage for service 1479 * @note: btstack_type X 1480 */ 1481 static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1482 gatt_client_deserialize_service(event, 6, service); 1483 } 1484 #endif 1485 1486 #ifdef ENABLE_BLE 1487 /** 1488 * @brief Get field handle from event gatt_event_all_characteristic_descriptors_query_result 1489 * @param event packet 1490 * @return handle 1491 * @note: btstack_type H 1492 */ 1493 static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t * event){ 1494 return little_endian_read_16(event, 2); 1495 } 1496 /** 1497 * @brief Get field characteristic_descriptor from event gatt_event_all_characteristic_descriptors_query_result 1498 * @param event packet 1499 * @param Pointer to storage for characteristic_descriptor 1500 * @note: btstack_type Z 1501 */ 1502 static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t * event, gatt_client_characteristic_descriptor_t * characteristic_descriptor){ 1503 gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor); 1504 } 1505 #endif 1506 1507 #ifdef ENABLE_BLE 1508 /** 1509 * @brief Get field handle from event gatt_event_characteristic_value_query_result 1510 * @param event packet 1511 * @return handle 1512 * @note: btstack_type H 1513 */ 1514 static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t * event){ 1515 return little_endian_read_16(event, 2); 1516 } 1517 /** 1518 * @brief Get field value_handle from event gatt_event_characteristic_value_query_result 1519 * @param event packet 1520 * @return value_handle 1521 * @note: btstack_type 2 1522 */ 1523 static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1524 return little_endian_read_16(event, 4); 1525 } 1526 /** 1527 * @brief Get field value_length from event gatt_event_characteristic_value_query_result 1528 * @param event packet 1529 * @return value_length 1530 * @note: btstack_type L 1531 */ 1532 static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1533 return little_endian_read_16(event, 6); 1534 } 1535 /** 1536 * @brief Get field value from event gatt_event_characteristic_value_query_result 1537 * @param event packet 1538 * @return value 1539 * @note: btstack_type V 1540 */ 1541 static inline const uint8_t * gatt_event_characteristic_value_query_result_get_value(const uint8_t * event){ 1542 return &event[8]; 1543 } 1544 #endif 1545 1546 #ifdef ENABLE_BLE 1547 /** 1548 * @brief Get field handle from event gatt_event_long_characteristic_value_query_result 1549 * @param event packet 1550 * @return handle 1551 * @note: btstack_type H 1552 */ 1553 static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t * event){ 1554 return little_endian_read_16(event, 2); 1555 } 1556 /** 1557 * @brief Get field value_handle from event gatt_event_long_characteristic_value_query_result 1558 * @param event packet 1559 * @return value_handle 1560 * @note: btstack_type 2 1561 */ 1562 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1563 return little_endian_read_16(event, 4); 1564 } 1565 /** 1566 * @brief Get field value_offset from event gatt_event_long_characteristic_value_query_result 1567 * @param event packet 1568 * @return value_offset 1569 * @note: btstack_type 2 1570 */ 1571 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t * event){ 1572 return little_endian_read_16(event, 6); 1573 } 1574 /** 1575 * @brief Get field value_length from event gatt_event_long_characteristic_value_query_result 1576 * @param event packet 1577 * @return value_length 1578 * @note: btstack_type L 1579 */ 1580 static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1581 return little_endian_read_16(event, 8); 1582 } 1583 /** 1584 * @brief Get field value from event gatt_event_long_characteristic_value_query_result 1585 * @param event packet 1586 * @return value 1587 * @note: btstack_type V 1588 */ 1589 static inline const uint8_t * gatt_event_long_characteristic_value_query_result_get_value(const uint8_t * event){ 1590 return &event[10]; 1591 } 1592 #endif 1593 1594 #ifdef ENABLE_BLE 1595 /** 1596 * @brief Get field handle from event gatt_event_notification 1597 * @param event packet 1598 * @return handle 1599 * @note: btstack_type H 1600 */ 1601 static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t * event){ 1602 return little_endian_read_16(event, 2); 1603 } 1604 /** 1605 * @brief Get field value_handle from event gatt_event_notification 1606 * @param event packet 1607 * @return value_handle 1608 * @note: btstack_type 2 1609 */ 1610 static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t * event){ 1611 return little_endian_read_16(event, 4); 1612 } 1613 /** 1614 * @brief Get field value_length from event gatt_event_notification 1615 * @param event packet 1616 * @return value_length 1617 * @note: btstack_type L 1618 */ 1619 static inline int gatt_event_notification_get_value_length(const uint8_t * event){ 1620 return little_endian_read_16(event, 6); 1621 } 1622 /** 1623 * @brief Get field value from event gatt_event_notification 1624 * @param event packet 1625 * @return value 1626 * @note: btstack_type V 1627 */ 1628 static inline const uint8_t * gatt_event_notification_get_value(const uint8_t * event){ 1629 return &event[8]; 1630 } 1631 #endif 1632 1633 #ifdef ENABLE_BLE 1634 /** 1635 * @brief Get field handle from event gatt_event_indication 1636 * @param event packet 1637 * @return handle 1638 * @note: btstack_type H 1639 */ 1640 static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t * event){ 1641 return little_endian_read_16(event, 2); 1642 } 1643 /** 1644 * @brief Get field value_handle from event gatt_event_indication 1645 * @param event packet 1646 * @return value_handle 1647 * @note: btstack_type 2 1648 */ 1649 static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t * event){ 1650 return little_endian_read_16(event, 4); 1651 } 1652 /** 1653 * @brief Get field value_length from event gatt_event_indication 1654 * @param event packet 1655 * @return value_length 1656 * @note: btstack_type L 1657 */ 1658 static inline int gatt_event_indication_get_value_length(const uint8_t * event){ 1659 return little_endian_read_16(event, 6); 1660 } 1661 /** 1662 * @brief Get field value from event gatt_event_indication 1663 * @param event packet 1664 * @return value 1665 * @note: btstack_type V 1666 */ 1667 static inline const uint8_t * gatt_event_indication_get_value(const uint8_t * event){ 1668 return &event[8]; 1669 } 1670 #endif 1671 1672 #ifdef ENABLE_BLE 1673 /** 1674 * @brief Get field descriptor_handle from event gatt_event_characteristic_descriptor_query_result 1675 * @param event packet 1676 * @return descriptor_handle 1677 * @note: btstack_type H 1678 */ 1679 static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t * event){ 1680 return little_endian_read_16(event, 2); 1681 } 1682 /** 1683 * @brief Get field descriptor_length from event gatt_event_characteristic_descriptor_query_result 1684 * @param event packet 1685 * @return descriptor_length 1686 * @note: btstack_type 2 1687 */ 1688 static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1689 return little_endian_read_16(event, 4); 1690 } 1691 /** 1692 * @brief Get field descriptor from event gatt_event_characteristic_descriptor_query_result 1693 * @param event packet 1694 * @return descriptor 1695 * @note: btstack_type L 1696 */ 1697 static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1698 return little_endian_read_16(event, 6); 1699 } 1700 #endif 1701 1702 #ifdef ENABLE_BLE 1703 /** 1704 * @brief Get field handle from event gatt_event_long_characteristic_descriptor_query_result 1705 * @param event packet 1706 * @return handle 1707 * @note: btstack_type H 1708 */ 1709 static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t * event){ 1710 return little_endian_read_16(event, 2); 1711 } 1712 /** 1713 * @brief Get field descriptor_offset from event gatt_event_long_characteristic_descriptor_query_result 1714 * @param event packet 1715 * @return descriptor_offset 1716 * @note: btstack_type 2 1717 */ 1718 static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t * event){ 1719 return little_endian_read_16(event, 4); 1720 } 1721 /** 1722 * @brief Get field descriptor_length from event gatt_event_long_characteristic_descriptor_query_result 1723 * @param event packet 1724 * @return descriptor_length 1725 * @note: btstack_type L 1726 */ 1727 static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1728 return little_endian_read_16(event, 6); 1729 } 1730 /** 1731 * @brief Get field descriptor from event gatt_event_long_characteristic_descriptor_query_result 1732 * @param event packet 1733 * @return descriptor 1734 * @note: btstack_type V 1735 */ 1736 static inline const uint8_t * gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1737 return &event[8]; 1738 } 1739 #endif 1740 1741 #ifdef ENABLE_BLE 1742 /** 1743 * @brief Get field handle from event gatt_event_mtu 1744 * @param event packet 1745 * @return handle 1746 * @note: btstack_type H 1747 */ 1748 static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t * event){ 1749 return little_endian_read_16(event, 2); 1750 } 1751 /** 1752 * @brief Get field MTU from event gatt_event_mtu 1753 * @param event packet 1754 * @return MTU 1755 * @note: btstack_type 2 1756 */ 1757 static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t * event){ 1758 return little_endian_read_16(event, 4); 1759 } 1760 #endif 1761 1762 /** 1763 * @brief Get field status from event bnep_event_service_registered 1764 * @param event packet 1765 * @return status 1766 * @note: btstack_type 1 1767 */ 1768 static inline uint8_t bnep_event_service_registered_get_status(const uint8_t * event){ 1769 return event[2]; 1770 } 1771 /** 1772 * @brief Get field service_uuid from event bnep_event_service_registered 1773 * @param event packet 1774 * @return service_uuid 1775 * @note: btstack_type 2 1776 */ 1777 static inline uint16_t bnep_event_service_registered_get_service_uuid(const uint8_t * event){ 1778 return little_endian_read_16(event, 3); 1779 } 1780 1781 /** 1782 * @brief Get field status from event bnep_event_channel_opened 1783 * @param event packet 1784 * @return status 1785 * @note: btstack_type 1 1786 */ 1787 static inline uint8_t bnep_event_channel_opened_get_status(const uint8_t * event){ 1788 return event[2]; 1789 } 1790 /** 1791 * @brief Get field bnep_cid from event bnep_event_channel_opened 1792 * @param event packet 1793 * @return bnep_cid 1794 * @note: btstack_type 2 1795 */ 1796 static inline uint16_t bnep_event_channel_opened_get_bnep_cid(const uint8_t * event){ 1797 return little_endian_read_16(event, 3); 1798 } 1799 /** 1800 * @brief Get field source_uuid from event bnep_event_channel_opened 1801 * @param event packet 1802 * @return source_uuid 1803 * @note: btstack_type 2 1804 */ 1805 static inline uint16_t bnep_event_channel_opened_get_source_uuid(const uint8_t * event){ 1806 return little_endian_read_16(event, 5); 1807 } 1808 /** 1809 * @brief Get field destination_uuid from event bnep_event_channel_opened 1810 * @param event packet 1811 * @return destination_uuid 1812 * @note: btstack_type 2 1813 */ 1814 static inline uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t * event){ 1815 return little_endian_read_16(event, 7); 1816 } 1817 /** 1818 * @brief Get field mtu from event bnep_event_channel_opened 1819 * @param event packet 1820 * @return mtu 1821 * @note: btstack_type 2 1822 */ 1823 static inline uint16_t bnep_event_channel_opened_get_mtu(const uint8_t * event){ 1824 return little_endian_read_16(event, 9); 1825 } 1826 /** 1827 * @brief Get field remote_address from event bnep_event_channel_opened 1828 * @param event packet 1829 * @param Pointer to storage for remote_address 1830 * @note: btstack_type B 1831 */ 1832 static inline void bnep_event_channel_opened_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1833 reverse_bd_addr(&event[11], remote_address); 1834 } 1835 1836 /** 1837 * @brief Get field bnep_cid from event bnep_event_channel_closed 1838 * @param event packet 1839 * @return bnep_cid 1840 * @note: btstack_type 2 1841 */ 1842 static inline uint16_t bnep_event_channel_closed_get_bnep_cid(const uint8_t * event){ 1843 return little_endian_read_16(event, 2); 1844 } 1845 /** 1846 * @brief Get field source_uuid from event bnep_event_channel_closed 1847 * @param event packet 1848 * @return source_uuid 1849 * @note: btstack_type 2 1850 */ 1851 static inline uint16_t bnep_event_channel_closed_get_source_uuid(const uint8_t * event){ 1852 return little_endian_read_16(event, 4); 1853 } 1854 /** 1855 * @brief Get field destination_uuid from event bnep_event_channel_closed 1856 * @param event packet 1857 * @return destination_uuid 1858 * @note: btstack_type 2 1859 */ 1860 static inline uint16_t bnep_event_channel_closed_get_destination_uuid(const uint8_t * event){ 1861 return little_endian_read_16(event, 6); 1862 } 1863 /** 1864 * @brief Get field remote_address from event bnep_event_channel_closed 1865 * @param event packet 1866 * @param Pointer to storage for remote_address 1867 * @note: btstack_type B 1868 */ 1869 static inline void bnep_event_channel_closed_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1870 reverse_bd_addr(&event[8], remote_address); 1871 } 1872 1873 /** 1874 * @brief Get field bnep_cid from event bnep_event_channel_timeout 1875 * @param event packet 1876 * @return bnep_cid 1877 * @note: btstack_type 2 1878 */ 1879 static inline uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t * event){ 1880 return little_endian_read_16(event, 2); 1881 } 1882 /** 1883 * @brief Get field source_uuid from event bnep_event_channel_timeout 1884 * @param event packet 1885 * @return source_uuid 1886 * @note: btstack_type 2 1887 */ 1888 static inline uint16_t bnep_event_channel_timeout_get_source_uuid(const uint8_t * event){ 1889 return little_endian_read_16(event, 4); 1890 } 1891 /** 1892 * @brief Get field destination_uuid from event bnep_event_channel_timeout 1893 * @param event packet 1894 * @return destination_uuid 1895 * @note: btstack_type 2 1896 */ 1897 static inline uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t * event){ 1898 return little_endian_read_16(event, 6); 1899 } 1900 /** 1901 * @brief Get field remote_address from event bnep_event_channel_timeout 1902 * @param event packet 1903 * @param Pointer to storage for remote_address 1904 * @note: btstack_type B 1905 */ 1906 static inline void bnep_event_channel_timeout_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1907 reverse_bd_addr(&event[8], remote_address); 1908 } 1909 /** 1910 * @brief Get field channel_state from event bnep_event_channel_timeout 1911 * @param event packet 1912 * @return channel_state 1913 * @note: btstack_type 1 1914 */ 1915 static inline uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t * event){ 1916 return event[14]; 1917 } 1918 1919 /** 1920 * @brief Get field bnep_cid from event bnep_event_can_send_now 1921 * @param event packet 1922 * @return bnep_cid 1923 * @note: btstack_type 2 1924 */ 1925 static inline uint16_t bnep_event_can_send_now_get_bnep_cid(const uint8_t * event){ 1926 return little_endian_read_16(event, 2); 1927 } 1928 /** 1929 * @brief Get field source_uuid from event bnep_event_can_send_now 1930 * @param event packet 1931 * @return source_uuid 1932 * @note: btstack_type 2 1933 */ 1934 static inline uint16_t bnep_event_can_send_now_get_source_uuid(const uint8_t * event){ 1935 return little_endian_read_16(event, 4); 1936 } 1937 /** 1938 * @brief Get field destination_uuid from event bnep_event_can_send_now 1939 * @param event packet 1940 * @return destination_uuid 1941 * @note: btstack_type 2 1942 */ 1943 static inline uint16_t bnep_event_can_send_now_get_destination_uuid(const uint8_t * event){ 1944 return little_endian_read_16(event, 6); 1945 } 1946 /** 1947 * @brief Get field remote_address from event bnep_event_can_send_now 1948 * @param event packet 1949 * @param Pointer to storage for remote_address 1950 * @note: btstack_type B 1951 */ 1952 static inline void bnep_event_can_send_now_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1953 reverse_bd_addr(&event[8], remote_address); 1954 } 1955 1956 #ifdef ENABLE_BLE 1957 /** 1958 * @brief Get field handle from event sm_event_just_works_request 1959 * @param event packet 1960 * @return handle 1961 * @note: btstack_type H 1962 */ 1963 static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t * event){ 1964 return little_endian_read_16(event, 2); 1965 } 1966 /** 1967 * @brief Get field addr_type from event sm_event_just_works_request 1968 * @param event packet 1969 * @return addr_type 1970 * @note: btstack_type 1 1971 */ 1972 static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t * event){ 1973 return event[4]; 1974 } 1975 /** 1976 * @brief Get field address from event sm_event_just_works_request 1977 * @param event packet 1978 * @param Pointer to storage for address 1979 * @note: btstack_type B 1980 */ 1981 static inline void sm_event_just_works_request_get_address(const uint8_t * event, bd_addr_t address){ 1982 reverse_bd_addr(&event[5], address); 1983 } 1984 #endif 1985 1986 #ifdef ENABLE_BLE 1987 /** 1988 * @brief Get field handle from event sm_event_just_works_cancel 1989 * @param event packet 1990 * @return handle 1991 * @note: btstack_type H 1992 */ 1993 static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t * event){ 1994 return little_endian_read_16(event, 2); 1995 } 1996 /** 1997 * @brief Get field addr_type from event sm_event_just_works_cancel 1998 * @param event packet 1999 * @return addr_type 2000 * @note: btstack_type 1 2001 */ 2002 static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t * event){ 2003 return event[4]; 2004 } 2005 /** 2006 * @brief Get field address from event sm_event_just_works_cancel 2007 * @param event packet 2008 * @param Pointer to storage for address 2009 * @note: btstack_type B 2010 */ 2011 static inline void sm_event_just_works_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2012 reverse_bd_addr(&event[5], address); 2013 } 2014 #endif 2015 2016 #ifdef ENABLE_BLE 2017 /** 2018 * @brief Get field handle from event sm_event_passkey_display_number 2019 * @param event packet 2020 * @return handle 2021 * @note: btstack_type H 2022 */ 2023 static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t * event){ 2024 return little_endian_read_16(event, 2); 2025 } 2026 /** 2027 * @brief Get field addr_type from event sm_event_passkey_display_number 2028 * @param event packet 2029 * @return addr_type 2030 * @note: btstack_type 1 2031 */ 2032 static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t * event){ 2033 return event[4]; 2034 } 2035 /** 2036 * @brief Get field address from event sm_event_passkey_display_number 2037 * @param event packet 2038 * @param Pointer to storage for address 2039 * @note: btstack_type B 2040 */ 2041 static inline void sm_event_passkey_display_number_get_address(const uint8_t * event, bd_addr_t address){ 2042 reverse_bd_addr(&event[5], address); 2043 } 2044 /** 2045 * @brief Get field passkey from event sm_event_passkey_display_number 2046 * @param event packet 2047 * @return passkey 2048 * @note: btstack_type 4 2049 */ 2050 static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t * event){ 2051 return little_endian_read_32(event, 11); 2052 } 2053 #endif 2054 2055 #ifdef ENABLE_BLE 2056 /** 2057 * @brief Get field handle from event sm_event_passkey_display_cancel 2058 * @param event packet 2059 * @return handle 2060 * @note: btstack_type H 2061 */ 2062 static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t * event){ 2063 return little_endian_read_16(event, 2); 2064 } 2065 /** 2066 * @brief Get field addr_type from event sm_event_passkey_display_cancel 2067 * @param event packet 2068 * @return addr_type 2069 * @note: btstack_type 1 2070 */ 2071 static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t * event){ 2072 return event[4]; 2073 } 2074 /** 2075 * @brief Get field address from event sm_event_passkey_display_cancel 2076 * @param event packet 2077 * @param Pointer to storage for address 2078 * @note: btstack_type B 2079 */ 2080 static inline void sm_event_passkey_display_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2081 reverse_bd_addr(&event[5], address); 2082 } 2083 #endif 2084 2085 #ifdef ENABLE_BLE 2086 /** 2087 * @brief Get field handle from event sm_event_passkey_input_number 2088 * @param event packet 2089 * @return handle 2090 * @note: btstack_type H 2091 */ 2092 static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t * event){ 2093 return little_endian_read_16(event, 2); 2094 } 2095 /** 2096 * @brief Get field addr_type from event sm_event_passkey_input_number 2097 * @param event packet 2098 * @return addr_type 2099 * @note: btstack_type 1 2100 */ 2101 static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t * event){ 2102 return event[4]; 2103 } 2104 /** 2105 * @brief Get field address from event sm_event_passkey_input_number 2106 * @param event packet 2107 * @param Pointer to storage for address 2108 * @note: btstack_type B 2109 */ 2110 static inline void sm_event_passkey_input_number_get_address(const uint8_t * event, bd_addr_t address){ 2111 reverse_bd_addr(&event[5], address); 2112 } 2113 #endif 2114 2115 #ifdef ENABLE_BLE 2116 /** 2117 * @brief Get field handle from event sm_event_passkey_input_cancel 2118 * @param event packet 2119 * @return handle 2120 * @note: btstack_type H 2121 */ 2122 static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t * event){ 2123 return little_endian_read_16(event, 2); 2124 } 2125 /** 2126 * @brief Get field addr_type from event sm_event_passkey_input_cancel 2127 * @param event packet 2128 * @return addr_type 2129 * @note: btstack_type 1 2130 */ 2131 static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t * event){ 2132 return event[4]; 2133 } 2134 /** 2135 * @brief Get field address from event sm_event_passkey_input_cancel 2136 * @param event packet 2137 * @param Pointer to storage for address 2138 * @note: btstack_type B 2139 */ 2140 static inline void sm_event_passkey_input_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2141 reverse_bd_addr(&event[5], address); 2142 } 2143 #endif 2144 2145 #ifdef ENABLE_BLE 2146 /** 2147 * @brief Get field handle from event sm_event_identity_resolving_started 2148 * @param event packet 2149 * @return handle 2150 * @note: btstack_type H 2151 */ 2152 static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t * event){ 2153 return little_endian_read_16(event, 2); 2154 } 2155 /** 2156 * @brief Get field addr_type from event sm_event_identity_resolving_started 2157 * @param event packet 2158 * @return addr_type 2159 * @note: btstack_type 1 2160 */ 2161 static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t * event){ 2162 return event[4]; 2163 } 2164 /** 2165 * @brief Get field address from event sm_event_identity_resolving_started 2166 * @param event packet 2167 * @param Pointer to storage for address 2168 * @note: btstack_type B 2169 */ 2170 static inline void sm_event_identity_resolving_started_get_address(const uint8_t * event, bd_addr_t address){ 2171 reverse_bd_addr(&event[5], address); 2172 } 2173 #endif 2174 2175 #ifdef ENABLE_BLE 2176 /** 2177 * @brief Get field handle from event sm_event_identity_resolving_failed 2178 * @param event packet 2179 * @return handle 2180 * @note: btstack_type H 2181 */ 2182 static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t * event){ 2183 return little_endian_read_16(event, 2); 2184 } 2185 /** 2186 * @brief Get field addr_type from event sm_event_identity_resolving_failed 2187 * @param event packet 2188 * @return addr_type 2189 * @note: btstack_type 1 2190 */ 2191 static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t * event){ 2192 return event[4]; 2193 } 2194 /** 2195 * @brief Get field address from event sm_event_identity_resolving_failed 2196 * @param event packet 2197 * @param Pointer to storage for address 2198 * @note: btstack_type B 2199 */ 2200 static inline void sm_event_identity_resolving_failed_get_address(const uint8_t * event, bd_addr_t address){ 2201 reverse_bd_addr(&event[5], address); 2202 } 2203 #endif 2204 2205 #ifdef ENABLE_BLE 2206 /** 2207 * @brief Get field handle from event sm_event_identity_resolving_succeeded 2208 * @param event packet 2209 * @return handle 2210 * @note: btstack_type H 2211 */ 2212 static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t * event){ 2213 return little_endian_read_16(event, 2); 2214 } 2215 /** 2216 * @brief Get field addr_type from event sm_event_identity_resolving_succeeded 2217 * @param event packet 2218 * @return addr_type 2219 * @note: btstack_type 1 2220 */ 2221 static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t * event){ 2222 return event[4]; 2223 } 2224 /** 2225 * @brief Get field address from event sm_event_identity_resolving_succeeded 2226 * @param event packet 2227 * @param Pointer to storage for address 2228 * @note: btstack_type B 2229 */ 2230 static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t * event, bd_addr_t address){ 2231 reverse_bd_addr(&event[5], address); 2232 } 2233 /** 2234 * @brief Get field le_device_db_index from event sm_event_identity_resolving_succeeded 2235 * @param event packet 2236 * @return le_device_db_index 2237 * @note: btstack_type 2 2238 */ 2239 static inline uint16_t sm_event_identity_resolving_succeeded_get_le_device_db_index(const uint8_t * event){ 2240 return little_endian_read_16(event, 11); 2241 } 2242 #endif 2243 2244 #ifdef ENABLE_BLE 2245 /** 2246 * @brief Get field handle from event sm_event_authorization_request 2247 * @param event packet 2248 * @return handle 2249 * @note: btstack_type H 2250 */ 2251 static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t * event){ 2252 return little_endian_read_16(event, 2); 2253 } 2254 /** 2255 * @brief Get field addr_type from event sm_event_authorization_request 2256 * @param event packet 2257 * @return addr_type 2258 * @note: btstack_type 1 2259 */ 2260 static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t * event){ 2261 return event[4]; 2262 } 2263 /** 2264 * @brief Get field address from event sm_event_authorization_request 2265 * @param event packet 2266 * @param Pointer to storage for address 2267 * @note: btstack_type B 2268 */ 2269 static inline void sm_event_authorization_request_get_address(const uint8_t * event, bd_addr_t address){ 2270 reverse_bd_addr(&event[5], address); 2271 } 2272 #endif 2273 2274 #ifdef ENABLE_BLE 2275 /** 2276 * @brief Get field handle from event sm_event_authorization_result 2277 * @param event packet 2278 * @return handle 2279 * @note: btstack_type H 2280 */ 2281 static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t * event){ 2282 return little_endian_read_16(event, 2); 2283 } 2284 /** 2285 * @brief Get field addr_type from event sm_event_authorization_result 2286 * @param event packet 2287 * @return addr_type 2288 * @note: btstack_type 1 2289 */ 2290 static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t * event){ 2291 return event[4]; 2292 } 2293 /** 2294 * @brief Get field address from event sm_event_authorization_result 2295 * @param event packet 2296 * @param Pointer to storage for address 2297 * @note: btstack_type B 2298 */ 2299 static inline void sm_event_authorization_result_get_address(const uint8_t * event, bd_addr_t address){ 2300 reverse_bd_addr(&event[5], address); 2301 } 2302 /** 2303 * @brief Get field authorization_result from event sm_event_authorization_result 2304 * @param event packet 2305 * @return authorization_result 2306 * @note: btstack_type 1 2307 */ 2308 static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t * event){ 2309 return event[11]; 2310 } 2311 #endif 2312 2313 /** 2314 * @brief Get field advertising_event_type from event gap_event_advertising_report 2315 * @param event packet 2316 * @return advertising_event_type 2317 * @note: btstack_type 1 2318 */ 2319 static inline uint8_t gap_event_advertising_report_get_advertising_event_type(const uint8_t * event){ 2320 return event[2]; 2321 } 2322 /** 2323 * @brief Get field address_type from event gap_event_advertising_report 2324 * @param event packet 2325 * @return address_type 2326 * @note: btstack_type 1 2327 */ 2328 static inline uint8_t gap_event_advertising_report_get_address_type(const uint8_t * event){ 2329 return event[3]; 2330 } 2331 /** 2332 * @brief Get field address from event gap_event_advertising_report 2333 * @param event packet 2334 * @param Pointer to storage for address 2335 * @note: btstack_type B 2336 */ 2337 static inline void gap_event_advertising_report_get_address(const uint8_t * event, bd_addr_t address){ 2338 reverse_bd_addr(&event[4], address); 2339 } 2340 /** 2341 * @brief Get field rssi from event gap_event_advertising_report 2342 * @param event packet 2343 * @return rssi 2344 * @note: btstack_type 1 2345 */ 2346 static inline uint8_t gap_event_advertising_report_get_rssi(const uint8_t * event){ 2347 return event[10]; 2348 } 2349 /** 2350 * @brief Get field data_length from event gap_event_advertising_report 2351 * @param event packet 2352 * @return data_length 2353 * @note: btstack_type J 2354 */ 2355 static inline int gap_event_advertising_report_get_data_length(const uint8_t * event){ 2356 return event[11]; 2357 } 2358 /** 2359 * @brief Get field data from event gap_event_advertising_report 2360 * @param event packet 2361 * @return data 2362 * @note: btstack_type V 2363 */ 2364 static inline const uint8_t * gap_event_advertising_report_get_data(const uint8_t * event){ 2365 return &event[12]; 2366 } 2367 2368 /** 2369 * @brief Get field status from event hci_subevent_le_connection_complete 2370 * @param event packet 2371 * @return status 2372 * @note: btstack_type 1 2373 */ 2374 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){ 2375 return event[3]; 2376 } 2377 /** 2378 * @brief Get field connection_handle from event hci_subevent_le_connection_complete 2379 * @param event packet 2380 * @return connection_handle 2381 * @note: btstack_type H 2382 */ 2383 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){ 2384 return little_endian_read_16(event, 4); 2385 } 2386 /** 2387 * @brief Get field role from event hci_subevent_le_connection_complete 2388 * @param event packet 2389 * @return role 2390 * @note: btstack_type 1 2391 */ 2392 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){ 2393 return event[6]; 2394 } 2395 /** 2396 * @brief Get field peer_address_type from event hci_subevent_le_connection_complete 2397 * @param event packet 2398 * @return peer_address_type 2399 * @note: btstack_type 1 2400 */ 2401 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){ 2402 return event[7]; 2403 } 2404 /** 2405 * @brief Get field peer_address from event hci_subevent_le_connection_complete 2406 * @param event packet 2407 * @param Pointer to storage for peer_address 2408 * @note: btstack_type B 2409 */ 2410 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){ 2411 reverse_bd_addr(&event[8], peer_address); 2412 } 2413 /** 2414 * @brief Get field conn_interval from event hci_subevent_le_connection_complete 2415 * @param event packet 2416 * @return conn_interval 2417 * @note: btstack_type 2 2418 */ 2419 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){ 2420 return little_endian_read_16(event, 14); 2421 } 2422 /** 2423 * @brief Get field conn_latency from event hci_subevent_le_connection_complete 2424 * @param event packet 2425 * @return conn_latency 2426 * @note: btstack_type 2 2427 */ 2428 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){ 2429 return little_endian_read_16(event, 16); 2430 } 2431 /** 2432 * @brief Get field supervision_timeout from event hci_subevent_le_connection_complete 2433 * @param event packet 2434 * @return supervision_timeout 2435 * @note: btstack_type 2 2436 */ 2437 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){ 2438 return little_endian_read_16(event, 18); 2439 } 2440 /** 2441 * @brief Get field master_clock_accuracy from event hci_subevent_le_connection_complete 2442 * @param event packet 2443 * @return master_clock_accuracy 2444 * @note: btstack_type 1 2445 */ 2446 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 2447 return event[20]; 2448 } 2449 2450 /** 2451 * @brief Get field status from event hsp_subevent_rfcomm_connection_complete 2452 * @param event packet 2453 * @return status 2454 * @note: btstack_type 1 2455 */ 2456 static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t * event){ 2457 return event[3]; 2458 } 2459 2460 /** 2461 * @brief Get field status from event hsp_subevent_rfcomm_disconnection_complete 2462 * @param event packet 2463 * @return status 2464 * @note: btstack_type 1 2465 */ 2466 static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t * event){ 2467 return event[3]; 2468 } 2469 2470 /** 2471 * @brief Get field status from event hsp_subevent_audio_connection_complete 2472 * @param event packet 2473 * @return status 2474 * @note: btstack_type 1 2475 */ 2476 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){ 2477 return event[3]; 2478 } 2479 /** 2480 * @brief Get field handle from event hsp_subevent_audio_connection_complete 2481 * @param event packet 2482 * @return handle 2483 * @note: btstack_type H 2484 */ 2485 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){ 2486 return little_endian_read_16(event, 4); 2487 } 2488 2489 /** 2490 * @brief Get field status from event hsp_subevent_audio_disconnection_complete 2491 * @param event packet 2492 * @return status 2493 * @note: btstack_type 1 2494 */ 2495 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){ 2496 return event[3]; 2497 } 2498 2499 2500 /** 2501 * @brief Get field gain from event hsp_subevent_microphone_gain_changed 2502 * @param event packet 2503 * @return gain 2504 * @note: btstack_type 1 2505 */ 2506 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){ 2507 return event[3]; 2508 } 2509 2510 /** 2511 * @brief Get field gain from event hsp_subevent_speaker_gain_changed 2512 * @param event packet 2513 * @return gain 2514 * @note: btstack_type 1 2515 */ 2516 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){ 2517 return event[3]; 2518 } 2519 2520 /** 2521 * @brief Get field value_length from event hsp_subevent_hs_command 2522 * @param event packet 2523 * @return value_length 2524 * @note: btstack_type J 2525 */ 2526 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){ 2527 return event[3]; 2528 } 2529 /** 2530 * @brief Get field value from event hsp_subevent_hs_command 2531 * @param event packet 2532 * @return value 2533 * @note: btstack_type V 2534 */ 2535 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){ 2536 return &event[4]; 2537 } 2538 2539 /** 2540 * @brief Get field value_length from event hsp_subevent_ag_indication 2541 * @param event packet 2542 * @return value_length 2543 * @note: btstack_type J 2544 */ 2545 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){ 2546 return event[3]; 2547 } 2548 /** 2549 * @brief Get field value from event hsp_subevent_ag_indication 2550 * @param event packet 2551 * @return value 2552 * @note: btstack_type V 2553 */ 2554 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){ 2555 return &event[4]; 2556 } 2557 2558 /** 2559 * @brief Get field status from event hfp_subevent_service_level_connection_established 2560 * @param event packet 2561 * @return status 2562 * @note: btstack_type 1 2563 */ 2564 static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t * event){ 2565 return event[3]; 2566 } 2567 2568 2569 /** 2570 * @brief Get field status from event hfp_subevent_audio_connection_established 2571 * @param event packet 2572 * @return status 2573 * @note: btstack_type 1 2574 */ 2575 static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){ 2576 return event[3]; 2577 } 2578 2579 2580 /** 2581 * @brief Get field status from event hfp_subevent_complete 2582 * @param event packet 2583 * @return status 2584 * @note: btstack_type 1 2585 */ 2586 static inline uint8_t hfp_subevent_complete_get_status(const uint8_t * event){ 2587 return event[3]; 2588 } 2589 2590 /** 2591 * @brief Get field indicator_index from event hfp_subevent_ag_indicator_status_changed 2592 * @param event packet 2593 * @return indicator_index 2594 * @note: btstack_type 1 2595 */ 2596 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t * event){ 2597 return event[3]; 2598 } 2599 /** 2600 * @brief Get field indicator_status from event hfp_subevent_ag_indicator_status_changed 2601 * @param event packet 2602 * @return indicator_status 2603 * @note: btstack_type 1 2604 */ 2605 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t * event){ 2606 return event[4]; 2607 } 2608 /** 2609 * @brief Get field indicator_name from event hfp_subevent_ag_indicator_status_changed 2610 * @param event packet 2611 * @return indicator_name 2612 * @note: btstack_type T 2613 */ 2614 static inline const char * hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t * event){ 2615 return (const char *) &event[5]; 2616 } 2617 2618 /** 2619 * @brief Get field network_operator_mode from event hfp_subevent_network_operator_changed 2620 * @param event packet 2621 * @return network_operator_mode 2622 * @note: btstack_type 1 2623 */ 2624 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t * event){ 2625 return event[3]; 2626 } 2627 /** 2628 * @brief Get field network_operator_format from event hfp_subevent_network_operator_changed 2629 * @param event packet 2630 * @return network_operator_format 2631 * @note: btstack_type 1 2632 */ 2633 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t * event){ 2634 return event[4]; 2635 } 2636 /** 2637 * @brief Get field network_operator_name from event hfp_subevent_network_operator_changed 2638 * @param event packet 2639 * @return network_operator_name 2640 * @note: btstack_type 1 2641 */ 2642 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t * event){ 2643 return event[5]; 2644 } 2645 2646 /** 2647 * @brief Get field error from event hfp_subevent_extended_audio_gateway_error 2648 * @param event packet 2649 * @return error 2650 * @note: btstack_type 1 2651 */ 2652 static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t * event){ 2653 return event[3]; 2654 } 2655 2656 /** 2657 * @brief Get field status from event hfp_subevent_codecs_connection_complete 2658 * @param event packet 2659 * @return status 2660 * @note: btstack_type 1 2661 */ 2662 static inline uint8_t hfp_subevent_codecs_connection_complete_get_status(const uint8_t * event){ 2663 return event[3]; 2664 } 2665 2666 2667 2668 2669 /** 2670 * @brief Get field number from event hfp_subevent_place_call_with_number 2671 * @param event packet 2672 * @return number 2673 * @note: btstack_type T 2674 */ 2675 static inline const char * hfp_subevent_place_call_with_number_get_number(const uint8_t * event){ 2676 return (const char *) &event[3]; 2677 } 2678 2679 2680 /** 2681 * @brief Get field number from event hfp_subevent_number_for_voice_tag 2682 * @param event packet 2683 * @return number 2684 * @note: btstack_type T 2685 */ 2686 static inline const char * hfp_subevent_number_for_voice_tag_get_number(const uint8_t * event){ 2687 return (const char *) &event[3]; 2688 } 2689 2690 /** 2691 * @brief Get field dtmf from event hfp_subevent_transmit_dtmf_codes 2692 * @param event packet 2693 * @return dtmf 2694 * @note: btstack_type T 2695 */ 2696 static inline const char * hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t * event){ 2697 return (const char *) &event[3]; 2698 } 2699 2700 2701 2702 2703 /** 2704 * @brief Get field status from event hfp_subevent_speaker_volume 2705 * @param event packet 2706 * @return status 2707 * @note: btstack_type 1 2708 */ 2709 static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t * event){ 2710 return event[3]; 2711 } 2712 /** 2713 * @brief Get field gain from event hfp_subevent_speaker_volume 2714 * @param event packet 2715 * @return gain 2716 * @note: btstack_type 1 2717 */ 2718 static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t * event){ 2719 return event[4]; 2720 } 2721 2722 /** 2723 * @brief Get field status from event hfp_subevent_microphone_volume 2724 * @param event packet 2725 * @return status 2726 * @note: btstack_type 1 2727 */ 2728 static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t * event){ 2729 return event[3]; 2730 } 2731 /** 2732 * @brief Get field gain from event hfp_subevent_microphone_volume 2733 * @param event packet 2734 * @return gain 2735 * @note: btstack_type 1 2736 */ 2737 static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t * event){ 2738 return event[4]; 2739 } 2740 2741 /** 2742 * @brief Get field type from event hfp_subevent_call_waiting_notification 2743 * @param event packet 2744 * @return type 2745 * @note: btstack_type 1 2746 */ 2747 static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t * event){ 2748 return event[3]; 2749 } 2750 /** 2751 * @brief Get field number from event hfp_subevent_call_waiting_notification 2752 * @param event packet 2753 * @return number 2754 * @note: btstack_type T 2755 */ 2756 static inline const char * hfp_subevent_call_waiting_notification_get_number(const uint8_t * event){ 2757 return (const char *) &event[4]; 2758 } 2759 2760 /** 2761 * @brief Get field type from event hfp_subevent_calling_line_indetification_notification 2762 * @param event packet 2763 * @return type 2764 * @note: btstack_type 1 2765 */ 2766 static inline uint8_t hfp_subevent_calling_line_indetification_notification_get_type(const uint8_t * event){ 2767 return event[3]; 2768 } 2769 /** 2770 * @brief Get field number from event hfp_subevent_calling_line_indetification_notification 2771 * @param event packet 2772 * @return number 2773 * @note: btstack_type T 2774 */ 2775 static inline const char * hfp_subevent_calling_line_indetification_notification_get_number(const uint8_t * event){ 2776 return (const char *) &event[4]; 2777 } 2778 2779 /** 2780 * @brief Get field clcc_idx from event hfp_subevent_enhanced_call_status 2781 * @param event packet 2782 * @return clcc_idx 2783 * @note: btstack_type 1 2784 */ 2785 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t * event){ 2786 return event[3]; 2787 } 2788 /** 2789 * @brief Get field clcc_dir from event hfp_subevent_enhanced_call_status 2790 * @param event packet 2791 * @return clcc_dir 2792 * @note: btstack_type 1 2793 */ 2794 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t * event){ 2795 return event[4]; 2796 } 2797 /** 2798 * @brief Get field clcc_status from event hfp_subevent_enhanced_call_status 2799 * @param event packet 2800 * @return clcc_status 2801 * @note: btstack_type 1 2802 */ 2803 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t * event){ 2804 return event[5]; 2805 } 2806 /** 2807 * @brief Get field clcc_mpty from event hfp_subevent_enhanced_call_status 2808 * @param event packet 2809 * @return clcc_mpty 2810 * @note: btstack_type 1 2811 */ 2812 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t * event){ 2813 return event[6]; 2814 } 2815 /** 2816 * @brief Get field bnip_type from event hfp_subevent_enhanced_call_status 2817 * @param event packet 2818 * @return bnip_type 2819 * @note: btstack_type 1 2820 */ 2821 static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t * event){ 2822 return event[7]; 2823 } 2824 /** 2825 * @brief Get field bnip_number from event hfp_subevent_enhanced_call_status 2826 * @param event packet 2827 * @return bnip_number 2828 * @note: btstack_type T 2829 */ 2830 static inline const char * hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t * event){ 2831 return (const char *) &event[8]; 2832 } 2833 2834 /** 2835 * @brief Get field status from event hfp_subevent_subscriber_number_information 2836 * @param event packet 2837 * @return status 2838 * @note: btstack_type 1 2839 */ 2840 static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t * event){ 2841 return event[3]; 2842 } 2843 /** 2844 * @brief Get field bnip_type from event hfp_subevent_subscriber_number_information 2845 * @param event packet 2846 * @return bnip_type 2847 * @note: btstack_type 1 2848 */ 2849 static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t * event){ 2850 return event[4]; 2851 } 2852 /** 2853 * @brief Get field bnip_number from event hfp_subevent_subscriber_number_information 2854 * @param event packet 2855 * @return bnip_number 2856 * @note: btstack_type T 2857 */ 2858 static inline const char * hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t * event){ 2859 return (const char *) &event[5]; 2860 } 2861 2862 /** 2863 * @brief Get field value from event hfp_subevent_response_and_hold_status 2864 * @param event packet 2865 * @return value 2866 * @note: btstack_type T 2867 */ 2868 static inline const char * hfp_subevent_response_and_hold_status_get_value(const uint8_t * event){ 2869 return (const char *) &event[3]; 2870 } 2871 2872 #ifdef ENABLE_BLE 2873 /** 2874 * @brief Get field handle from event ancs_subevent_client_connected 2875 * @param event packet 2876 * @return handle 2877 * @note: btstack_type H 2878 */ 2879 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){ 2880 return little_endian_read_16(event, 3); 2881 } 2882 #endif 2883 2884 #ifdef ENABLE_BLE 2885 /** 2886 * @brief Get field handle from event ancs_subevent_client_notification 2887 * @param event packet 2888 * @return handle 2889 * @note: btstack_type H 2890 */ 2891 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){ 2892 return little_endian_read_16(event, 3); 2893 } 2894 /** 2895 * @brief Get field attribute_id from event ancs_subevent_client_notification 2896 * @param event packet 2897 * @return attribute_id 2898 * @note: btstack_type 2 2899 */ 2900 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){ 2901 return little_endian_read_16(event, 5); 2902 } 2903 /** 2904 * @brief Get field text from event ancs_subevent_client_notification 2905 * @param event packet 2906 * @return text 2907 * @note: btstack_type T 2908 */ 2909 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){ 2910 return (const char *) &event[7]; 2911 } 2912 #endif 2913 2914 #ifdef ENABLE_BLE 2915 /** 2916 * @brief Get field handle from event ancs_subevent_client_disconnected 2917 * @param event packet 2918 * @return handle 2919 * @note: btstack_type H 2920 */ 2921 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){ 2922 return little_endian_read_16(event, 3); 2923 } 2924 #endif 2925 2926 2927 2928 /* API_END */ 2929 2930 #if defined __cplusplus 2931 } 2932 #endif 2933 2934 #endif // __BTSTACK_EVENT_H 2935