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 field status from event hci_event_inquiry_complete 98 * @param event packet 99 * @return status 100 * @note: btstack_type 1 101 */ 102 static inline uint8_t hci_event_inquiry_complete_get_status(const uint8_t * event){ 103 return event[2]; 104 } 105 106 /** 107 * @brief Get field num_responses from event hci_event_inquiry_result 108 * @param event packet 109 * @return num_responses 110 * @note: btstack_type 1 111 */ 112 static inline uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t * event){ 113 return event[2]; 114 } 115 /** 116 * @brief Get field bd_addr from event hci_event_inquiry_result 117 * @param event packet 118 * @param Pointer to storage for bd_addr 119 * @note: btstack_type B 120 */ 121 static inline void hci_event_inquiry_result_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 122 reverse_bd_addr(&event[3], bd_addr); 123 } 124 /** 125 * @brief Get field page_scan_repetition_mode from event hci_event_inquiry_result 126 * @param event packet 127 * @return page_scan_repetition_mode 128 * @note: btstack_type 1 129 */ 130 static inline uint8_t hci_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t * event){ 131 return event[9]; 132 } 133 /** 134 * @brief Get field reserved1 from event hci_event_inquiry_result 135 * @param event packet 136 * @return reserved1 137 * @note: btstack_type 1 138 */ 139 static inline uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t * event){ 140 return event[10]; 141 } 142 /** 143 * @brief Get field reserved2 from event hci_event_inquiry_result 144 * @param event packet 145 * @return reserved2 146 * @note: btstack_type 1 147 */ 148 static inline uint8_t hci_event_inquiry_result_get_reserved2(const uint8_t * event){ 149 return event[11]; 150 } 151 /** 152 * @brief Get field class_of_device from event hci_event_inquiry_result 153 * @param event packet 154 * @return class_of_device 155 * @note: btstack_type 3 156 */ 157 static inline uint32_t hci_event_inquiry_result_get_class_of_device(const uint8_t * event){ 158 return little_endian_read_24(event, 12); 159 } 160 /** 161 * @brief Get field clock_offset from event hci_event_inquiry_result 162 * @param event packet 163 * @return clock_offset 164 * @note: btstack_type 2 165 */ 166 static inline uint16_t hci_event_inquiry_result_get_clock_offset(const uint8_t * event){ 167 return little_endian_read_16(event, 15); 168 } 169 170 /** 171 * @brief Get field status from event hci_event_connection_complete 172 * @param event packet 173 * @return status 174 * @note: btstack_type 1 175 */ 176 static inline uint8_t hci_event_connection_complete_get_status(const uint8_t * event){ 177 return event[2]; 178 } 179 /** 180 * @brief Get field connection_handle from event hci_event_connection_complete 181 * @param event packet 182 * @return connection_handle 183 * @note: btstack_type 2 184 */ 185 static inline uint16_t hci_event_connection_complete_get_connection_handle(const uint8_t * event){ 186 return little_endian_read_16(event, 3); 187 } 188 /** 189 * @brief Get field bd_addr from event hci_event_connection_complete 190 * @param event packet 191 * @param Pointer to storage for bd_addr 192 * @note: btstack_type B 193 */ 194 static inline void hci_event_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 195 reverse_bd_addr(&event[5], bd_addr); 196 } 197 /** 198 * @brief Get field link_type from event hci_event_connection_complete 199 * @param event packet 200 * @return link_type 201 * @note: btstack_type 1 202 */ 203 static inline uint8_t hci_event_connection_complete_get_link_type(const uint8_t * event){ 204 return event[11]; 205 } 206 /** 207 * @brief Get field encryption_enabled from event hci_event_connection_complete 208 * @param event packet 209 * @return encryption_enabled 210 * @note: btstack_type 1 211 */ 212 static inline uint8_t hci_event_connection_complete_get_encryption_enabled(const uint8_t * event){ 213 return event[12]; 214 } 215 216 /** 217 * @brief Get field bd_addr from event hci_event_connection_request 218 * @param event packet 219 * @param Pointer to storage for bd_addr 220 * @note: btstack_type B 221 */ 222 static inline void hci_event_connection_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 223 reverse_bd_addr(&event[2], bd_addr); 224 } 225 /** 226 * @brief Get field class_of_device from event hci_event_connection_request 227 * @param event packet 228 * @return class_of_device 229 * @note: btstack_type 3 230 */ 231 static inline uint32_t hci_event_connection_request_get_class_of_device(const uint8_t * event){ 232 return little_endian_read_24(event, 8); 233 } 234 /** 235 * @brief Get field link_type from event hci_event_connection_request 236 * @param event packet 237 * @return link_type 238 * @note: btstack_type 1 239 */ 240 static inline uint8_t hci_event_connection_request_get_link_type(const uint8_t * event){ 241 return event[11]; 242 } 243 244 /** 245 * @brief Get field status from event hci_event_disconnection_complete 246 * @param event packet 247 * @return status 248 * @note: btstack_type 1 249 */ 250 static inline uint8_t hci_event_disconnection_complete_get_status(const uint8_t * event){ 251 return event[2]; 252 } 253 /** 254 * @brief Get field connection_handle from event hci_event_disconnection_complete 255 * @param event packet 256 * @return connection_handle 257 * @note: btstack_type 2 258 */ 259 static inline uint16_t hci_event_disconnection_complete_get_connection_handle(const uint8_t * event){ 260 return little_endian_read_16(event, 3); 261 } 262 /** 263 * @brief Get field reason from event hci_event_disconnection_complete 264 * @param event packet 265 * @return reason 266 * @note: btstack_type 1 267 */ 268 static inline uint8_t hci_event_disconnection_complete_get_reason(const uint8_t * event){ 269 return event[5]; 270 } 271 272 /** 273 * @brief Get field status from event hci_event_authentication_complete_event 274 * @param event packet 275 * @return status 276 * @note: btstack_type 1 277 */ 278 static inline uint8_t hci_event_authentication_complete_event_get_status(const uint8_t * event){ 279 return event[2]; 280 } 281 /** 282 * @brief Get field connection_handle from event hci_event_authentication_complete_event 283 * @param event packet 284 * @return connection_handle 285 * @note: btstack_type 2 286 */ 287 static inline uint16_t hci_event_authentication_complete_event_get_connection_handle(const uint8_t * event){ 288 return little_endian_read_16(event, 3); 289 } 290 291 /** 292 * @brief Get field status from event hci_event_remote_name_request_complete 293 * @param event packet 294 * @return status 295 * @note: btstack_type 1 296 */ 297 // static inline uint8_t hci_event_remote_name_request_complete_get_status(const uint8_t * event){ 298 // not implemented yet 299 // } 300 /** 301 * @brief Get field bd_addr from event hci_event_remote_name_request_complete 302 * @param event packet 303 * @return bd_addr 304 * @note: btstack_type B 305 */ 306 // static inline bd_addr_t hci_event_remote_name_request_complete_get_bd_addr(const uint8_t * event){ 307 // not implemented yet 308 // } 309 /** 310 * @brief Get field remote_name from event hci_event_remote_name_request_complete 311 * @param event packet 312 * @return remote_name 313 * @note: btstack_type N 314 */ 315 // static inline String hci_event_remote_name_request_complete_get_remote_name(const uint8_t * event){ 316 // not implemented yet 317 // } 318 319 /** 320 * @brief Get field status from event hci_event_encryption_change 321 * @param event packet 322 * @return status 323 * @note: btstack_type 1 324 */ 325 static inline uint8_t hci_event_encryption_change_get_status(const uint8_t * event){ 326 return event[2]; 327 } 328 /** 329 * @brief Get field connection_handle from event hci_event_encryption_change 330 * @param event packet 331 * @return connection_handle 332 * @note: btstack_type 2 333 */ 334 static inline uint16_t hci_event_encryption_change_get_connection_handle(const uint8_t * event){ 335 return little_endian_read_16(event, 3); 336 } 337 /** 338 * @brief Get field encryption_enabled from event hci_event_encryption_change 339 * @param event packet 340 * @return encryption_enabled 341 * @note: btstack_type 1 342 */ 343 static inline uint8_t hci_event_encryption_change_get_encryption_enabled(const uint8_t * event){ 344 return event[5]; 345 } 346 347 /** 348 * @brief Get field status from event hci_event_change_connection_link_key_complete 349 * @param event packet 350 * @return status 351 * @note: btstack_type 1 352 */ 353 static inline uint8_t hci_event_change_connection_link_key_complete_get_status(const uint8_t * event){ 354 return event[2]; 355 } 356 /** 357 * @brief Get field connection_handle from event hci_event_change_connection_link_key_complete 358 * @param event packet 359 * @return connection_handle 360 * @note: btstack_type 2 361 */ 362 static inline uint16_t hci_event_change_connection_link_key_complete_get_connection_handle(const uint8_t * event){ 363 return little_endian_read_16(event, 3); 364 } 365 366 /** 367 * @brief Get field status from event hci_event_master_link_key_complete 368 * @param event packet 369 * @return status 370 * @note: btstack_type 1 371 */ 372 static inline uint8_t hci_event_master_link_key_complete_get_status(const uint8_t * event){ 373 return event[2]; 374 } 375 /** 376 * @brief Get field connection_handle from event hci_event_master_link_key_complete 377 * @param event packet 378 * @return connection_handle 379 * @note: btstack_type 2 380 */ 381 static inline uint16_t hci_event_master_link_key_complete_get_connection_handle(const uint8_t * event){ 382 return little_endian_read_16(event, 3); 383 } 384 /** 385 * @brief Get field key_flag from event hci_event_master_link_key_complete 386 * @param event packet 387 * @return key_flag 388 * @note: btstack_type 1 389 */ 390 static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint8_t * event){ 391 return event[5]; 392 } 393 394 /** 395 * @brief Get field num_hci_command_packets from event hci_event_command_complete 396 * @param event packet 397 * @return num_hci_command_packets 398 * @note: btstack_type 1 399 */ 400 static inline uint8_t hci_event_command_complete_get_num_hci_command_packets(const uint8_t * event){ 401 return event[2]; 402 } 403 /** 404 * @brief Get field command_opcode from event hci_event_command_complete 405 * @param event packet 406 * @return command_opcode 407 * @note: btstack_type 2 408 */ 409 static inline uint16_t hci_event_command_complete_get_command_opcode(const uint8_t * event){ 410 return little_endian_read_16(event, 3); 411 } 412 /** 413 * @brief Get field return_parameters from event hci_event_command_complete 414 * @param event packet 415 * @return return_parameters 416 * @note: btstack_type R 417 */ 418 static inline const uint8_t * hci_event_command_complete_get_return_parameters(const uint8_t * event){ 419 return &event[5]; 420 } 421 422 /** 423 * @brief Get field status from event hci_event_command_status 424 * @param event packet 425 * @return status 426 * @note: btstack_type 1 427 */ 428 static inline uint8_t hci_event_command_status_get_status(const uint8_t * event){ 429 return event[2]; 430 } 431 /** 432 * @brief Get field num_hci_command_packets from event hci_event_command_status 433 * @param event packet 434 * @return num_hci_command_packets 435 * @note: btstack_type 1 436 */ 437 static inline uint8_t hci_event_command_status_get_num_hci_command_packets(const uint8_t * event){ 438 return event[3]; 439 } 440 /** 441 * @brief Get field command_opcode from event hci_event_command_status 442 * @param event packet 443 * @return command_opcode 444 * @note: btstack_type 2 445 */ 446 static inline uint16_t hci_event_command_status_get_command_opcode(const uint8_t * event){ 447 return little_endian_read_16(event, 4); 448 } 449 450 /** 451 * @brief Get field hardware_code from event hci_event_hardware_error 452 * @param event packet 453 * @return hardware_code 454 * @note: btstack_type 1 455 */ 456 static inline uint8_t hci_event_hardware_error_get_hardware_code(const uint8_t * event){ 457 return event[2]; 458 } 459 460 /** 461 * @brief Get field status from event hci_event_role_change 462 * @param event packet 463 * @return status 464 * @note: btstack_type 1 465 */ 466 static inline uint8_t hci_event_role_change_get_status(const uint8_t * event){ 467 return event[2]; 468 } 469 /** 470 * @brief Get field bd_addr from event hci_event_role_change 471 * @param event packet 472 * @param Pointer to storage for bd_addr 473 * @note: btstack_type B 474 */ 475 static inline void hci_event_role_change_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 476 reverse_bd_addr(&event[3], bd_addr); 477 } 478 /** 479 * @brief Get field role from event hci_event_role_change 480 * @param event packet 481 * @return role 482 * @note: btstack_type 1 483 */ 484 static inline uint8_t hci_event_role_change_get_role(const uint8_t * event){ 485 return event[9]; 486 } 487 488 /** 489 * @brief Get field num_responses from event hci_event_inquiry_result_with_rssi 490 * @param event packet 491 * @return num_responses 492 * @note: btstack_type 1 493 */ 494 static inline uint8_t hci_event_inquiry_result_with_rssi_get_num_responses(const uint8_t * event){ 495 return event[2]; 496 } 497 /** 498 * @brief Get field bd_addr from event hci_event_inquiry_result_with_rssi 499 * @param event packet 500 * @param Pointer to storage for bd_addr 501 * @note: btstack_type B 502 */ 503 static inline void hci_event_inquiry_result_with_rssi_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 504 reverse_bd_addr(&event[3], bd_addr); 505 } 506 /** 507 * @brief Get field page_scan_repetition_mode from event hci_event_inquiry_result_with_rssi 508 * @param event packet 509 * @return page_scan_repetition_mode 510 * @note: btstack_type 1 511 */ 512 static inline uint8_t hci_event_inquiry_result_with_rssi_get_page_scan_repetition_mode(const uint8_t * event){ 513 return event[9]; 514 } 515 /** 516 * @brief Get field reserved from event hci_event_inquiry_result_with_rssi 517 * @param event packet 518 * @return reserved 519 * @note: btstack_type 1 520 */ 521 static inline uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t * event){ 522 return event[10]; 523 } 524 /** 525 * @brief Get field class_of_device from event hci_event_inquiry_result_with_rssi 526 * @param event packet 527 * @return class_of_device 528 * @note: btstack_type 3 529 */ 530 static inline uint32_t hci_event_inquiry_result_with_rssi_get_class_of_device(const uint8_t * event){ 531 return little_endian_read_24(event, 11); 532 } 533 /** 534 * @brief Get field clock_offset from event hci_event_inquiry_result_with_rssi 535 * @param event packet 536 * @return clock_offset 537 * @note: btstack_type 2 538 */ 539 static inline uint16_t hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t * event){ 540 return little_endian_read_16(event, 14); 541 } 542 /** 543 * @brief Get field rssi from event hci_event_inquiry_result_with_rssi 544 * @param event packet 545 * @return rssi 546 * @note: btstack_type 1 547 */ 548 static inline uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t * event){ 549 return event[16]; 550 } 551 552 /** 553 * @brief Get field status from event hci_event_synchronous_connection_complete 554 * @param event packet 555 * @return status 556 * @note: btstack_type 1 557 */ 558 static inline uint8_t hci_event_synchronous_connection_complete_get_status(const uint8_t * event){ 559 return event[2]; 560 } 561 /** 562 * @brief Get field handle from event hci_event_synchronous_connection_complete 563 * @param event packet 564 * @return handle 565 * @note: btstack_type H 566 */ 567 static inline hci_con_handle_t hci_event_synchronous_connection_complete_get_handle(const uint8_t * event){ 568 return little_endian_read_16(event, 3); 569 } 570 /** 571 * @brief Get field bd_addr from event hci_event_synchronous_connection_complete 572 * @param event packet 573 * @param Pointer to storage for bd_addr 574 * @note: btstack_type B 575 */ 576 static inline void hci_event_synchronous_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 577 reverse_bd_addr(&event[5], bd_addr); 578 } 579 /** 580 * @brief Get field link_type from event hci_event_synchronous_connection_complete 581 * @param event packet 582 * @return link_type 583 * @note: btstack_type 1 584 */ 585 static inline uint8_t hci_event_synchronous_connection_complete_get_link_type(const uint8_t * event){ 586 return event[11]; 587 } 588 /** 589 * @brief Get field transmission_interval from event hci_event_synchronous_connection_complete 590 * @param event packet 591 * @return transmission_interval 592 * @note: btstack_type 1 593 */ 594 static inline uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(const uint8_t * event){ 595 return event[12]; 596 } 597 /** 598 * @brief Get field retransmission_interval from event hci_event_synchronous_connection_complete 599 * @param event packet 600 * @return retransmission_interval 601 * @note: btstack_type 1 602 */ 603 static inline uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(const uint8_t * event){ 604 return event[13]; 605 } 606 /** 607 * @brief Get field rx_packet_length from event hci_event_synchronous_connection_complete 608 * @param event packet 609 * @return rx_packet_length 610 * @note: btstack_type 2 611 */ 612 static inline uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(const uint8_t * event){ 613 return little_endian_read_16(event, 14); 614 } 615 /** 616 * @brief Get field tx_packet_length from event hci_event_synchronous_connection_complete 617 * @param event packet 618 * @return tx_packet_length 619 * @note: btstack_type 2 620 */ 621 static inline uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(const uint8_t * event){ 622 return little_endian_read_16(event, 16); 623 } 624 /** 625 * @brief Get field air_mode from event hci_event_synchronous_connection_complete 626 * @param event packet 627 * @return air_mode 628 * @note: btstack_type 1 629 */ 630 static inline uint8_t hci_event_synchronous_connection_complete_get_air_mode(const uint8_t * event){ 631 return event[18]; 632 } 633 634 /** 635 * @brief Get field num_responses from event hci_event_extended_inquiry_response 636 * @param event packet 637 * @return num_responses 638 * @note: btstack_type 1 639 */ 640 static inline uint8_t hci_event_extended_inquiry_response_get_num_responses(const uint8_t * event){ 641 return event[2]; 642 } 643 /** 644 * @brief Get field bd_addr from event hci_event_extended_inquiry_response 645 * @param event packet 646 * @param Pointer to storage for bd_addr 647 * @note: btstack_type B 648 */ 649 static inline void hci_event_extended_inquiry_response_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 650 reverse_bd_addr(&event[3], bd_addr); 651 } 652 /** 653 * @brief Get field page_scan_repetition_mode from event hci_event_extended_inquiry_response 654 * @param event packet 655 * @return page_scan_repetition_mode 656 * @note: btstack_type 1 657 */ 658 static inline uint8_t hci_event_extended_inquiry_response_get_page_scan_repetition_mode(const uint8_t * event){ 659 return event[9]; 660 } 661 /** 662 * @brief Get field reserved from event hci_event_extended_inquiry_response 663 * @param event packet 664 * @return reserved 665 * @note: btstack_type 1 666 */ 667 static inline uint8_t hci_event_extended_inquiry_response_get_reserved(const uint8_t * event){ 668 return event[10]; 669 } 670 /** 671 * @brief Get field class_of_device from event hci_event_extended_inquiry_response 672 * @param event packet 673 * @return class_of_device 674 * @note: btstack_type 3 675 */ 676 static inline uint32_t hci_event_extended_inquiry_response_get_class_of_device(const uint8_t * event){ 677 return little_endian_read_24(event, 11); 678 } 679 /** 680 * @brief Get field clock_offset from event hci_event_extended_inquiry_response 681 * @param event packet 682 * @return clock_offset 683 * @note: btstack_type 2 684 */ 685 static inline uint16_t hci_event_extended_inquiry_response_get_clock_offset(const uint8_t * event){ 686 return little_endian_read_16(event, 14); 687 } 688 /** 689 * @brief Get field rssi from event hci_event_extended_inquiry_response 690 * @param event packet 691 * @return rssi 692 * @note: btstack_type 1 693 */ 694 static inline uint8_t hci_event_extended_inquiry_response_get_rssi(const uint8_t * event){ 695 return event[16]; 696 } 697 698 /** 699 * @brief Get field status from event hci_event_encryption_key_refresh_complete 700 * @param event packet 701 * @return status 702 * @note: btstack_type 1 703 */ 704 static inline uint8_t hci_event_encryption_key_refresh_complete_get_status(const uint8_t * event){ 705 return event[2]; 706 } 707 /** 708 * @brief Get field handle from event hci_event_encryption_key_refresh_complete 709 * @param event packet 710 * @return handle 711 * @note: btstack_type H 712 */ 713 static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_handle(const uint8_t * event){ 714 return little_endian_read_16(event, 3); 715 } 716 717 /** 718 * @brief Get field status from event hci_subevent_le_connection_complete 719 * @param event packet 720 * @return status 721 * @note: btstack_type 1 722 */ 723 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){ 724 return event[3]; 725 } 726 /** 727 * @brief Get field connection_handle from event hci_subevent_le_connection_complete 728 * @param event packet 729 * @return connection_handle 730 * @note: btstack_type H 731 */ 732 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){ 733 return little_endian_read_16(event, 4); 734 } 735 /** 736 * @brief Get field role from event hci_subevent_le_connection_complete 737 * @param event packet 738 * @return role 739 * @note: btstack_type 1 740 */ 741 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){ 742 return event[6]; 743 } 744 /** 745 * @brief Get field peer_address_type from event hci_subevent_le_connection_complete 746 * @param event packet 747 * @return peer_address_type 748 * @note: btstack_type 1 749 */ 750 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){ 751 return event[7]; 752 } 753 /** 754 * @brief Get field peer_address from event hci_subevent_le_connection_complete 755 * @param event packet 756 * @param Pointer to storage for peer_address 757 * @note: btstack_type B 758 */ 759 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){ 760 reverse_bd_addr(&event[8], peer_address); 761 } 762 /** 763 * @brief Get field conn_interval from event hci_subevent_le_connection_complete 764 * @param event packet 765 * @return conn_interval 766 * @note: btstack_type 2 767 */ 768 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){ 769 return little_endian_read_16(event, 14); 770 } 771 /** 772 * @brief Get field conn_latency from event hci_subevent_le_connection_complete 773 * @param event packet 774 * @return conn_latency 775 * @note: btstack_type 2 776 */ 777 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){ 778 return little_endian_read_16(event, 16); 779 } 780 /** 781 * @brief Get field supervision_timeout from event hci_subevent_le_connection_complete 782 * @param event packet 783 * @return supervision_timeout 784 * @note: btstack_type 2 785 */ 786 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){ 787 return little_endian_read_16(event, 18); 788 } 789 /** 790 * @brief Get field master_clock_accuracy from event hci_subevent_le_connection_complete 791 * @param event packet 792 * @return master_clock_accuracy 793 * @note: btstack_type 1 794 */ 795 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 796 return event[20]; 797 } 798 799 /** 800 * @brief Get field state from event btstack_event_state 801 * @param event packet 802 * @return state 803 * @note: btstack_type 1 804 */ 805 static inline uint8_t btstack_event_state_get_state(const uint8_t * event){ 806 return event[2]; 807 } 808 809 810 /** 811 * @brief Get field discoverable from event btstack_event_discoverable_enabled 812 * @param event packet 813 * @return discoverable 814 * @note: btstack_type 1 815 */ 816 static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t * event){ 817 return event[2]; 818 } 819 820 /** 821 * @brief Get field handle from event hci_event_sco_can_send_now 822 * @param event packet 823 * @param Pointer to storage for handle 824 * @note: btstack_type B 825 */ 826 static inline void hci_event_sco_can_send_now_get_handle(const uint8_t * event, bd_addr_t handle){ 827 reverse_bd_addr(&event[2], handle); 828 } 829 830 /** 831 * @brief Get field status from event l2cap_event_channel_opened 832 * @param event packet 833 * @return status 834 * @note: btstack_type 1 835 */ 836 static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t * event){ 837 return event[2]; 838 } 839 /** 840 * @brief Get field address from event l2cap_event_channel_opened 841 * @param event packet 842 * @param Pointer to storage for address 843 * @note: btstack_type B 844 */ 845 static inline void l2cap_event_channel_opened_get_address(const uint8_t * event, bd_addr_t address){ 846 reverse_bd_addr(&event[3], address); 847 } 848 /** 849 * @brief Get field handle from event l2cap_event_channel_opened 850 * @param event packet 851 * @return handle 852 * @note: btstack_type H 853 */ 854 static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t * event){ 855 return little_endian_read_16(event, 9); 856 } 857 /** 858 * @brief Get field psm from event l2cap_event_channel_opened 859 * @param event packet 860 * @return psm 861 * @note: btstack_type 2 862 */ 863 static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t * event){ 864 return little_endian_read_16(event, 11); 865 } 866 /** 867 * @brief Get field local_cid from event l2cap_event_channel_opened 868 * @param event packet 869 * @return local_cid 870 * @note: btstack_type 2 871 */ 872 static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t * event){ 873 return little_endian_read_16(event, 13); 874 } 875 /** 876 * @brief Get field remote_cid from event l2cap_event_channel_opened 877 * @param event packet 878 * @return remote_cid 879 * @note: btstack_type 2 880 */ 881 static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t * event){ 882 return little_endian_read_16(event, 15); 883 } 884 /** 885 * @brief Get field local_mtu from event l2cap_event_channel_opened 886 * @param event packet 887 * @return local_mtu 888 * @note: btstack_type 2 889 */ 890 static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t * event){ 891 return little_endian_read_16(event, 17); 892 } 893 /** 894 * @brief Get field remote_mtu from event l2cap_event_channel_opened 895 * @param event packet 896 * @return remote_mtu 897 * @note: btstack_type 2 898 */ 899 static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t * event){ 900 return little_endian_read_16(event, 19); 901 } 902 /** 903 * @brief Get field flush_timeout from event l2cap_event_channel_opened 904 * @param event packet 905 * @return flush_timeout 906 * @note: btstack_type 2 907 */ 908 static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t * event){ 909 return little_endian_read_16(event, 21); 910 } 911 912 /** 913 * @brief Get field local_cid from event l2cap_event_channel_closed 914 * @param event packet 915 * @return local_cid 916 * @note: btstack_type 2 917 */ 918 static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t * event){ 919 return little_endian_read_16(event, 2); 920 } 921 922 /** 923 * @brief Get field status from event l2cap_event_incoming_connection 924 * @param event packet 925 * @return status 926 * @note: btstack_type 1 927 */ 928 static inline uint8_t l2cap_event_incoming_connection_get_status(const uint8_t * event){ 929 return event[2]; 930 } 931 /** 932 * @brief Get field address from event l2cap_event_incoming_connection 933 * @param event packet 934 * @param Pointer to storage for address 935 * @note: btstack_type B 936 */ 937 static inline void l2cap_event_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ 938 reverse_bd_addr(&event[3], address); 939 } 940 /** 941 * @brief Get field handle from event l2cap_event_incoming_connection 942 * @param event packet 943 * @return handle 944 * @note: btstack_type H 945 */ 946 static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t * event){ 947 return little_endian_read_16(event, 9); 948 } 949 /** 950 * @brief Get field psm from event l2cap_event_incoming_connection 951 * @param event packet 952 * @return psm 953 * @note: btstack_type 2 954 */ 955 static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t * event){ 956 return little_endian_read_16(event, 11); 957 } 958 /** 959 * @brief Get field local_cid from event l2cap_event_incoming_connection 960 * @param event packet 961 * @return local_cid 962 * @note: btstack_type 2 963 */ 964 static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t * event){ 965 return little_endian_read_16(event, 13); 966 } 967 /** 968 * @brief Get field remote_cid from event l2cap_event_incoming_connection 969 * @param event packet 970 * @return remote_cid 971 * @note: btstack_type 2 972 */ 973 static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t * event){ 974 return little_endian_read_16(event, 15); 975 } 976 977 /** 978 * @brief Get field status from event l2cap_event_service_registered 979 * @param event packet 980 * @return status 981 * @note: btstack_type 1 982 */ 983 static inline uint8_t l2cap_event_service_registered_get_status(const uint8_t * event){ 984 return event[2]; 985 } 986 /** 987 * @brief Get field psm from event l2cap_event_service_registered 988 * @param event packet 989 * @return psm 990 * @note: btstack_type 2 991 */ 992 static inline uint16_t l2cap_event_service_registered_get_psm(const uint8_t * event){ 993 return little_endian_read_16(event, 3); 994 } 995 996 /** 997 * @brief Get field handle from event l2cap_event_connection_parameter_update_request 998 * @param event packet 999 * @return handle 1000 * @note: btstack_type H 1001 */ 1002 static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t * event){ 1003 return little_endian_read_16(event, 2); 1004 } 1005 /** 1006 * @brief Get field interval_min from event l2cap_event_connection_parameter_update_request 1007 * @param event packet 1008 * @return interval_min 1009 * @note: btstack_type 2 1010 */ 1011 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t * event){ 1012 return little_endian_read_16(event, 4); 1013 } 1014 /** 1015 * @brief Get field interval_max from event l2cap_event_connection_parameter_update_request 1016 * @param event packet 1017 * @return interval_max 1018 * @note: btstack_type 2 1019 */ 1020 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t * event){ 1021 return little_endian_read_16(event, 6); 1022 } 1023 /** 1024 * @brief Get field latencey from event l2cap_event_connection_parameter_update_request 1025 * @param event packet 1026 * @return latencey 1027 * @note: btstack_type 2 1028 */ 1029 static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t * event){ 1030 return little_endian_read_16(event, 8); 1031 } 1032 /** 1033 * @brief Get field timeout_multiplier from event l2cap_event_connection_parameter_update_request 1034 * @param event packet 1035 * @return timeout_multiplier 1036 * @note: btstack_type 2 1037 */ 1038 static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t * event){ 1039 return little_endian_read_16(event, 10); 1040 } 1041 1042 /** 1043 * @brief Get field handle from event l2cap_event_connection_parameter_update_response 1044 * @param event packet 1045 * @return handle 1046 * @note: btstack_type H 1047 */ 1048 static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t * event){ 1049 return little_endian_read_16(event, 2); 1050 } 1051 1052 /** 1053 * @brief Get field local_cid from event l2cap_event_can_send_now 1054 * @param event packet 1055 * @return local_cid 1056 * @note: btstack_type 2 1057 */ 1058 static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * event){ 1059 return little_endian_read_16(event, 2); 1060 } 1061 1062 /** 1063 * @brief Get field status from event rfcomm_event_open_channel_complete 1064 * @param event packet 1065 * @return status 1066 * @note: btstack_type 1 1067 */ 1068 static inline uint8_t rfcomm_event_open_channel_complete_get_status(const uint8_t * event){ 1069 return event[2]; 1070 } 1071 /** 1072 * @brief Get field bd_addr from event rfcomm_event_open_channel_complete 1073 * @param event packet 1074 * @param Pointer to storage for bd_addr 1075 * @note: btstack_type B 1076 */ 1077 static inline void rfcomm_event_open_channel_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1078 reverse_bd_addr(&event[3], bd_addr); 1079 } 1080 /** 1081 * @brief Get field con_handle from event rfcomm_event_open_channel_complete 1082 * @param event packet 1083 * @return con_handle 1084 * @note: btstack_type 2 1085 */ 1086 static inline uint16_t rfcomm_event_open_channel_complete_get_con_handle(const uint8_t * event){ 1087 return little_endian_read_16(event, 9); 1088 } 1089 /** 1090 * @brief Get field server_channel from event rfcomm_event_open_channel_complete 1091 * @param event packet 1092 * @return server_channel 1093 * @note: btstack_type 1 1094 */ 1095 static inline uint8_t rfcomm_event_open_channel_complete_get_server_channel(const uint8_t * event){ 1096 return event[11]; 1097 } 1098 /** 1099 * @brief Get field rfcomm_cid from event rfcomm_event_open_channel_complete 1100 * @param event packet 1101 * @return rfcomm_cid 1102 * @note: btstack_type 2 1103 */ 1104 static inline uint16_t rfcomm_event_open_channel_complete_get_rfcomm_cid(const uint8_t * event){ 1105 return little_endian_read_16(event, 12); 1106 } 1107 /** 1108 * @brief Get field max_frame_size from event rfcomm_event_open_channel_complete 1109 * @param event packet 1110 * @return max_frame_size 1111 * @note: btstack_type 2 1112 */ 1113 static inline uint16_t rfcomm_event_open_channel_complete_get_max_frame_size(const uint8_t * event){ 1114 return little_endian_read_16(event, 14); 1115 } 1116 1117 /** 1118 * @brief Get field rfcomm_cid from event rfcomm_event_channel_closed 1119 * @param event packet 1120 * @return rfcomm_cid 1121 * @note: btstack_type 2 1122 */ 1123 static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t * event){ 1124 return little_endian_read_16(event, 2); 1125 } 1126 1127 /** 1128 * @brief Get field bd_addr from event rfcomm_event_incoming_connection 1129 * @param event packet 1130 * @param Pointer to storage for bd_addr 1131 * @note: btstack_type B 1132 */ 1133 static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1134 reverse_bd_addr(&event[2], bd_addr); 1135 } 1136 /** 1137 * @brief Get field server_channel from event rfcomm_event_incoming_connection 1138 * @param event packet 1139 * @return server_channel 1140 * @note: btstack_type 1 1141 */ 1142 static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t * event){ 1143 return event[8]; 1144 } 1145 /** 1146 * @brief Get field rfcomm_cid from event rfcomm_event_incoming_connection 1147 * @param event packet 1148 * @return rfcomm_cid 1149 * @note: btstack_type 2 1150 */ 1151 static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t * event){ 1152 return little_endian_read_16(event, 9); 1153 } 1154 1155 /** 1156 * @brief Get field rfcomm_cid from event rfcomm_event_remote_line_status 1157 * @param event packet 1158 * @return rfcomm_cid 1159 * @note: btstack_type 2 1160 */ 1161 static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t * event){ 1162 return little_endian_read_16(event, 2); 1163 } 1164 /** 1165 * @brief Get field line_status from event rfcomm_event_remote_line_status 1166 * @param event packet 1167 * @return line_status 1168 * @note: btstack_type 1 1169 */ 1170 static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t * event){ 1171 return event[4]; 1172 } 1173 1174 /** 1175 * @brief Get field rfcomm_cid from event rfcomm_event_credits 1176 * @param event packet 1177 * @return rfcomm_cid 1178 * @note: btstack_type 2 1179 */ 1180 static inline uint16_t rfcomm_event_credits_get_rfcomm_cid(const uint8_t * event){ 1181 return little_endian_read_16(event, 2); 1182 } 1183 /** 1184 * @brief Get field credits from event rfcomm_event_credits 1185 * @param event packet 1186 * @return credits 1187 * @note: btstack_type 1 1188 */ 1189 static inline uint8_t rfcomm_event_credits_get_credits(const uint8_t * event){ 1190 return event[4]; 1191 } 1192 1193 /** 1194 * @brief Get field status from event rfcomm_event_service_registered 1195 * @param event packet 1196 * @return status 1197 * @note: btstack_type 1 1198 */ 1199 static inline uint8_t rfcomm_event_service_registered_get_status(const uint8_t * event){ 1200 return event[2]; 1201 } 1202 /** 1203 * @brief Get field channel_id from event rfcomm_event_service_registered 1204 * @param event packet 1205 * @return channel_id 1206 * @note: btstack_type 1 1207 */ 1208 static inline uint8_t rfcomm_event_service_registered_get_channel_id(const uint8_t * event){ 1209 return event[3]; 1210 } 1211 1212 /** 1213 * @brief Get field status from event rfcomm_event_persistent_channel 1214 * @param event packet 1215 * @return status 1216 * @note: btstack_type 1 1217 */ 1218 static inline uint8_t rfcomm_event_persistent_channel_get_status(const uint8_t * event){ 1219 return event[2]; 1220 } 1221 /** 1222 * @brief Get field server_channel_id from event rfcomm_event_persistent_channel 1223 * @param event packet 1224 * @return server_channel_id 1225 * @note: btstack_type 1 1226 */ 1227 static inline uint8_t rfcomm_event_persistent_channel_get_server_channel_id(const uint8_t * event){ 1228 return event[3]; 1229 } 1230 1231 /** 1232 * @brief Get field rfcomm_cid from event rfcomm_event_remote_modem_status 1233 * @param event packet 1234 * @return rfcomm_cid 1235 * @note: btstack_type 2 1236 */ 1237 static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t * event){ 1238 return little_endian_read_16(event, 2); 1239 } 1240 /** 1241 * @brief Get field modem_status from event rfcomm_event_remote_modem_status 1242 * @param event packet 1243 * @return modem_status 1244 * @note: btstack_type 1 1245 */ 1246 static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t * event){ 1247 return event[4]; 1248 } 1249 1250 /** 1251 * @brief Get field local_cid from event rfcomm_event_can_send_now 1252 * @param event packet 1253 * @return local_cid 1254 * @note: btstack_type 2 1255 */ 1256 static inline uint16_t rfcomm_event_can_send_now_get_local_cid(const uint8_t * event){ 1257 return little_endian_read_16(event, 2); 1258 } 1259 1260 /** 1261 * @brief Get field status from event sdp_event_service_registered 1262 * @param event packet 1263 * @return status 1264 * @note: btstack_type 1 1265 */ 1266 static inline uint8_t sdp_event_service_registered_get_status(const uint8_t * event){ 1267 return event[2]; 1268 } 1269 /** 1270 * @brief Get field service_record_handle from event sdp_event_service_registered 1271 * @param event packet 1272 * @return service_record_handle 1273 * @note: btstack_type 4 1274 */ 1275 static inline uint32_t sdp_event_service_registered_get_service_record_handle(const uint8_t * event){ 1276 return little_endian_read_32(event, 3); 1277 } 1278 1279 /** 1280 * @brief Get field status from event sdp_event_query_complete 1281 * @param event packet 1282 * @return status 1283 * @note: btstack_type 1 1284 */ 1285 static inline uint8_t sdp_event_query_complete_get_status(const uint8_t * event){ 1286 return event[2]; 1287 } 1288 1289 /** 1290 * @brief Get field rfcomm_channel from event sdp_event_query_rfcomm_service 1291 * @param event packet 1292 * @return rfcomm_channel 1293 * @note: btstack_type 1 1294 */ 1295 static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t * event){ 1296 return event[2]; 1297 } 1298 /** 1299 * @brief Get field name from event sdp_event_query_rfcomm_service 1300 * @param event packet 1301 * @return name 1302 * @note: btstack_type T 1303 */ 1304 static inline const char * sdp_event_query_rfcomm_service_get_name(const uint8_t * event){ 1305 return (const char *) &event[3]; 1306 } 1307 1308 /** 1309 * @brief Get field record_id from event sdp_event_query_attribute_byte 1310 * @param event packet 1311 * @return record_id 1312 * @note: btstack_type 2 1313 */ 1314 static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t * event){ 1315 return little_endian_read_16(event, 2); 1316 } 1317 /** 1318 * @brief Get field attribute_id from event sdp_event_query_attribute_byte 1319 * @param event packet 1320 * @return attribute_id 1321 * @note: btstack_type 2 1322 */ 1323 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t * event){ 1324 return little_endian_read_16(event, 4); 1325 } 1326 /** 1327 * @brief Get field attribute_length from event sdp_event_query_attribute_byte 1328 * @param event packet 1329 * @return attribute_length 1330 * @note: btstack_type 2 1331 */ 1332 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t * event){ 1333 return little_endian_read_16(event, 6); 1334 } 1335 /** 1336 * @brief Get field data_offset from event sdp_event_query_attribute_byte 1337 * @param event packet 1338 * @return data_offset 1339 * @note: btstack_type 2 1340 */ 1341 static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t * event){ 1342 return little_endian_read_16(event, 8); 1343 } 1344 /** 1345 * @brief Get field data from event sdp_event_query_attribute_byte 1346 * @param event packet 1347 * @return data 1348 * @note: btstack_type 1 1349 */ 1350 static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t * event){ 1351 return event[10]; 1352 } 1353 1354 /** 1355 * @brief Get field record_id from event sdp_event_query_attribute_value 1356 * @param event packet 1357 * @return record_id 1358 * @note: btstack_type 2 1359 */ 1360 static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t * event){ 1361 return little_endian_read_16(event, 2); 1362 } 1363 /** 1364 * @brief Get field attribute_id from event sdp_event_query_attribute_value 1365 * @param event packet 1366 * @return attribute_id 1367 * @note: btstack_type 2 1368 */ 1369 static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t * event){ 1370 return little_endian_read_16(event, 4); 1371 } 1372 /** 1373 * @brief Get field attribute_length from event sdp_event_query_attribute_value 1374 * @param event packet 1375 * @return attribute_length 1376 * @note: btstack_type L 1377 */ 1378 static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t * event){ 1379 return little_endian_read_16(event, 6); 1380 } 1381 /** 1382 * @brief Get field attribute_value from event sdp_event_query_attribute_value 1383 * @param event packet 1384 * @return attribute_value 1385 * @note: btstack_type V 1386 */ 1387 static inline const uint8_t * sdp_event_query_attribute_value_get_attribute_value(const uint8_t * event){ 1388 return &event[8]; 1389 } 1390 1391 /** 1392 * @brief Get field total_count from event sdp_event_query_service_record_handle 1393 * @param event packet 1394 * @return total_count 1395 * @note: btstack_type 2 1396 */ 1397 static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t * event){ 1398 return little_endian_read_16(event, 2); 1399 } 1400 /** 1401 * @brief Get field record_index from event sdp_event_query_service_record_handle 1402 * @param event packet 1403 * @return record_index 1404 * @note: btstack_type 2 1405 */ 1406 static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t * event){ 1407 return little_endian_read_16(event, 4); 1408 } 1409 /** 1410 * @brief Get field record_handle from event sdp_event_query_service_record_handle 1411 * @param event packet 1412 * @return record_handle 1413 * @note: btstack_type 4 1414 */ 1415 static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t * event){ 1416 return little_endian_read_32(event, 6); 1417 } 1418 1419 #ifdef ENABLE_BLE 1420 /** 1421 * @brief Get field handle from event gatt_event_query_complete 1422 * @param event packet 1423 * @return handle 1424 * @note: btstack_type H 1425 */ 1426 static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t * event){ 1427 return little_endian_read_16(event, 2); 1428 } 1429 /** 1430 * @brief Get field status from event gatt_event_query_complete 1431 * @param event packet 1432 * @return status 1433 * @note: btstack_type 1 1434 */ 1435 static inline uint8_t gatt_event_query_complete_get_status(const uint8_t * event){ 1436 return event[4]; 1437 } 1438 #endif 1439 1440 #ifdef ENABLE_BLE 1441 /** 1442 * @brief Get field handle from event gatt_event_service_query_result 1443 * @param event packet 1444 * @return handle 1445 * @note: btstack_type H 1446 */ 1447 static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t * event){ 1448 return little_endian_read_16(event, 2); 1449 } 1450 /** 1451 * @brief Get field service from event gatt_event_service_query_result 1452 * @param event packet 1453 * @param Pointer to storage for service 1454 * @note: btstack_type X 1455 */ 1456 static inline void gatt_event_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1457 gatt_client_deserialize_service(event, 4, service); 1458 } 1459 #endif 1460 1461 #ifdef ENABLE_BLE 1462 /** 1463 * @brief Get field handle from event gatt_event_characteristic_query_result 1464 * @param event packet 1465 * @return handle 1466 * @note: btstack_type H 1467 */ 1468 static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t * event){ 1469 return little_endian_read_16(event, 2); 1470 } 1471 /** 1472 * @brief Get field characteristic from event gatt_event_characteristic_query_result 1473 * @param event packet 1474 * @param Pointer to storage for characteristic 1475 * @note: btstack_type Y 1476 */ 1477 static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t * event, gatt_client_characteristic_t * characteristic){ 1478 gatt_client_deserialize_characteristic(event, 4, characteristic); 1479 } 1480 #endif 1481 1482 #ifdef ENABLE_BLE 1483 /** 1484 * @brief Get field handle from event gatt_event_included_service_query_result 1485 * @param event packet 1486 * @return handle 1487 * @note: btstack_type H 1488 */ 1489 static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){ 1490 return little_endian_read_16(event, 2); 1491 } 1492 /** 1493 * @brief Get field include_handle from event gatt_event_included_service_query_result 1494 * @param event packet 1495 * @return include_handle 1496 * @note: btstack_type 2 1497 */ 1498 static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){ 1499 return little_endian_read_16(event, 4); 1500 } 1501 /** 1502 * @brief Get field service from event gatt_event_included_service_query_result 1503 * @param event packet 1504 * @param Pointer to storage for service 1505 * @note: btstack_type X 1506 */ 1507 static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1508 gatt_client_deserialize_service(event, 6, service); 1509 } 1510 #endif 1511 1512 #ifdef ENABLE_BLE 1513 /** 1514 * @brief Get field handle from event gatt_event_all_characteristic_descriptors_query_result 1515 * @param event packet 1516 * @return handle 1517 * @note: btstack_type H 1518 */ 1519 static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t * event){ 1520 return little_endian_read_16(event, 2); 1521 } 1522 /** 1523 * @brief Get field characteristic_descriptor from event gatt_event_all_characteristic_descriptors_query_result 1524 * @param event packet 1525 * @param Pointer to storage for characteristic_descriptor 1526 * @note: btstack_type Z 1527 */ 1528 static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t * event, gatt_client_characteristic_descriptor_t * characteristic_descriptor){ 1529 gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor); 1530 } 1531 #endif 1532 1533 #ifdef ENABLE_BLE 1534 /** 1535 * @brief Get field handle from event gatt_event_characteristic_value_query_result 1536 * @param event packet 1537 * @return handle 1538 * @note: btstack_type H 1539 */ 1540 static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t * event){ 1541 return little_endian_read_16(event, 2); 1542 } 1543 /** 1544 * @brief Get field value_handle from event gatt_event_characteristic_value_query_result 1545 * @param event packet 1546 * @return value_handle 1547 * @note: btstack_type 2 1548 */ 1549 static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1550 return little_endian_read_16(event, 4); 1551 } 1552 /** 1553 * @brief Get field value_length from event gatt_event_characteristic_value_query_result 1554 * @param event packet 1555 * @return value_length 1556 * @note: btstack_type L 1557 */ 1558 static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1559 return little_endian_read_16(event, 6); 1560 } 1561 /** 1562 * @brief Get field value from event gatt_event_characteristic_value_query_result 1563 * @param event packet 1564 * @return value 1565 * @note: btstack_type V 1566 */ 1567 static inline const uint8_t * gatt_event_characteristic_value_query_result_get_value(const uint8_t * event){ 1568 return &event[8]; 1569 } 1570 #endif 1571 1572 #ifdef ENABLE_BLE 1573 /** 1574 * @brief Get field handle from event gatt_event_long_characteristic_value_query_result 1575 * @param event packet 1576 * @return handle 1577 * @note: btstack_type H 1578 */ 1579 static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t * event){ 1580 return little_endian_read_16(event, 2); 1581 } 1582 /** 1583 * @brief Get field value_handle from event gatt_event_long_characteristic_value_query_result 1584 * @param event packet 1585 * @return value_handle 1586 * @note: btstack_type 2 1587 */ 1588 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1589 return little_endian_read_16(event, 4); 1590 } 1591 /** 1592 * @brief Get field value_offset from event gatt_event_long_characteristic_value_query_result 1593 * @param event packet 1594 * @return value_offset 1595 * @note: btstack_type 2 1596 */ 1597 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t * event){ 1598 return little_endian_read_16(event, 6); 1599 } 1600 /** 1601 * @brief Get field value_length from event gatt_event_long_characteristic_value_query_result 1602 * @param event packet 1603 * @return value_length 1604 * @note: btstack_type L 1605 */ 1606 static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1607 return little_endian_read_16(event, 8); 1608 } 1609 /** 1610 * @brief Get field value from event gatt_event_long_characteristic_value_query_result 1611 * @param event packet 1612 * @return value 1613 * @note: btstack_type V 1614 */ 1615 static inline const uint8_t * gatt_event_long_characteristic_value_query_result_get_value(const uint8_t * event){ 1616 return &event[10]; 1617 } 1618 #endif 1619 1620 #ifdef ENABLE_BLE 1621 /** 1622 * @brief Get field handle from event gatt_event_notification 1623 * @param event packet 1624 * @return handle 1625 * @note: btstack_type H 1626 */ 1627 static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t * event){ 1628 return little_endian_read_16(event, 2); 1629 } 1630 /** 1631 * @brief Get field value_handle from event gatt_event_notification 1632 * @param event packet 1633 * @return value_handle 1634 * @note: btstack_type 2 1635 */ 1636 static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t * event){ 1637 return little_endian_read_16(event, 4); 1638 } 1639 /** 1640 * @brief Get field value_length from event gatt_event_notification 1641 * @param event packet 1642 * @return value_length 1643 * @note: btstack_type L 1644 */ 1645 static inline int gatt_event_notification_get_value_length(const uint8_t * event){ 1646 return little_endian_read_16(event, 6); 1647 } 1648 /** 1649 * @brief Get field value from event gatt_event_notification 1650 * @param event packet 1651 * @return value 1652 * @note: btstack_type V 1653 */ 1654 static inline const uint8_t * gatt_event_notification_get_value(const uint8_t * event){ 1655 return &event[8]; 1656 } 1657 #endif 1658 1659 #ifdef ENABLE_BLE 1660 /** 1661 * @brief Get field handle from event gatt_event_indication 1662 * @param event packet 1663 * @return handle 1664 * @note: btstack_type H 1665 */ 1666 static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t * event){ 1667 return little_endian_read_16(event, 2); 1668 } 1669 /** 1670 * @brief Get field value_handle from event gatt_event_indication 1671 * @param event packet 1672 * @return value_handle 1673 * @note: btstack_type 2 1674 */ 1675 static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t * event){ 1676 return little_endian_read_16(event, 4); 1677 } 1678 /** 1679 * @brief Get field value_length from event gatt_event_indication 1680 * @param event packet 1681 * @return value_length 1682 * @note: btstack_type L 1683 */ 1684 static inline int gatt_event_indication_get_value_length(const uint8_t * event){ 1685 return little_endian_read_16(event, 6); 1686 } 1687 /** 1688 * @brief Get field value from event gatt_event_indication 1689 * @param event packet 1690 * @return value 1691 * @note: btstack_type V 1692 */ 1693 static inline const uint8_t * gatt_event_indication_get_value(const uint8_t * event){ 1694 return &event[8]; 1695 } 1696 #endif 1697 1698 #ifdef ENABLE_BLE 1699 /** 1700 * @brief Get field descriptor_handle from event gatt_event_characteristic_descriptor_query_result 1701 * @param event packet 1702 * @return descriptor_handle 1703 * @note: btstack_type H 1704 */ 1705 static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t * event){ 1706 return little_endian_read_16(event, 2); 1707 } 1708 /** 1709 * @brief Get field descriptor_length from event gatt_event_characteristic_descriptor_query_result 1710 * @param event packet 1711 * @return descriptor_length 1712 * @note: btstack_type 2 1713 */ 1714 static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1715 return little_endian_read_16(event, 4); 1716 } 1717 /** 1718 * @brief Get field descriptor from event gatt_event_characteristic_descriptor_query_result 1719 * @param event packet 1720 * @return descriptor 1721 * @note: btstack_type L 1722 */ 1723 static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1724 return little_endian_read_16(event, 6); 1725 } 1726 #endif 1727 1728 #ifdef ENABLE_BLE 1729 /** 1730 * @brief Get field handle from event gatt_event_long_characteristic_descriptor_query_result 1731 * @param event packet 1732 * @return handle 1733 * @note: btstack_type H 1734 */ 1735 static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t * event){ 1736 return little_endian_read_16(event, 2); 1737 } 1738 /** 1739 * @brief Get field descriptor_offset from event gatt_event_long_characteristic_descriptor_query_result 1740 * @param event packet 1741 * @return descriptor_offset 1742 * @note: btstack_type 2 1743 */ 1744 static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t * event){ 1745 return little_endian_read_16(event, 4); 1746 } 1747 /** 1748 * @brief Get field descriptor_length from event gatt_event_long_characteristic_descriptor_query_result 1749 * @param event packet 1750 * @return descriptor_length 1751 * @note: btstack_type L 1752 */ 1753 static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1754 return little_endian_read_16(event, 6); 1755 } 1756 /** 1757 * @brief Get field descriptor from event gatt_event_long_characteristic_descriptor_query_result 1758 * @param event packet 1759 * @return descriptor 1760 * @note: btstack_type V 1761 */ 1762 static inline const uint8_t * gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1763 return &event[8]; 1764 } 1765 #endif 1766 1767 #ifdef ENABLE_BLE 1768 /** 1769 * @brief Get field handle from event gatt_event_mtu 1770 * @param event packet 1771 * @return handle 1772 * @note: btstack_type H 1773 */ 1774 static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t * event){ 1775 return little_endian_read_16(event, 2); 1776 } 1777 /** 1778 * @brief Get field MTU from event gatt_event_mtu 1779 * @param event packet 1780 * @return MTU 1781 * @note: btstack_type 2 1782 */ 1783 static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t * event){ 1784 return little_endian_read_16(event, 4); 1785 } 1786 #endif 1787 1788 #ifdef ENABLE_BLE 1789 /** 1790 * @brief Get field handle from event sm_event_just_works_request 1791 * @param event packet 1792 * @return handle 1793 * @note: btstack_type H 1794 */ 1795 static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t * event){ 1796 return little_endian_read_16(event, 2); 1797 } 1798 /** 1799 * @brief Get field addr_type from event sm_event_just_works_request 1800 * @param event packet 1801 * @return addr_type 1802 * @note: btstack_type 1 1803 */ 1804 static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t * event){ 1805 return event[4]; 1806 } 1807 /** 1808 * @brief Get field address from event sm_event_just_works_request 1809 * @param event packet 1810 * @param Pointer to storage for address 1811 * @note: btstack_type B 1812 */ 1813 static inline void sm_event_just_works_request_get_address(const uint8_t * event, bd_addr_t address){ 1814 reverse_bd_addr(&event[5], address); 1815 } 1816 #endif 1817 1818 #ifdef ENABLE_BLE 1819 /** 1820 * @brief Get field handle from event sm_event_just_works_cancel 1821 * @param event packet 1822 * @return handle 1823 * @note: btstack_type H 1824 */ 1825 static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t * event){ 1826 return little_endian_read_16(event, 2); 1827 } 1828 /** 1829 * @brief Get field addr_type from event sm_event_just_works_cancel 1830 * @param event packet 1831 * @return addr_type 1832 * @note: btstack_type 1 1833 */ 1834 static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t * event){ 1835 return event[4]; 1836 } 1837 /** 1838 * @brief Get field address from event sm_event_just_works_cancel 1839 * @param event packet 1840 * @param Pointer to storage for address 1841 * @note: btstack_type B 1842 */ 1843 static inline void sm_event_just_works_cancel_get_address(const uint8_t * event, bd_addr_t address){ 1844 reverse_bd_addr(&event[5], address); 1845 } 1846 #endif 1847 1848 #ifdef ENABLE_BLE 1849 /** 1850 * @brief Get field handle from event sm_event_passkey_display_number 1851 * @param event packet 1852 * @return handle 1853 * @note: btstack_type H 1854 */ 1855 static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t * event){ 1856 return little_endian_read_16(event, 2); 1857 } 1858 /** 1859 * @brief Get field addr_type from event sm_event_passkey_display_number 1860 * @param event packet 1861 * @return addr_type 1862 * @note: btstack_type 1 1863 */ 1864 static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t * event){ 1865 return event[4]; 1866 } 1867 /** 1868 * @brief Get field address from event sm_event_passkey_display_number 1869 * @param event packet 1870 * @param Pointer to storage for address 1871 * @note: btstack_type B 1872 */ 1873 static inline void sm_event_passkey_display_number_get_address(const uint8_t * event, bd_addr_t address){ 1874 reverse_bd_addr(&event[5], address); 1875 } 1876 /** 1877 * @brief Get field passkey from event sm_event_passkey_display_number 1878 * @param event packet 1879 * @return passkey 1880 * @note: btstack_type 4 1881 */ 1882 static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t * event){ 1883 return little_endian_read_32(event, 11); 1884 } 1885 #endif 1886 1887 #ifdef ENABLE_BLE 1888 /** 1889 * @brief Get field handle from event sm_event_passkey_display_cancel 1890 * @param event packet 1891 * @return handle 1892 * @note: btstack_type H 1893 */ 1894 static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t * event){ 1895 return little_endian_read_16(event, 2); 1896 } 1897 /** 1898 * @brief Get field addr_type from event sm_event_passkey_display_cancel 1899 * @param event packet 1900 * @return addr_type 1901 * @note: btstack_type 1 1902 */ 1903 static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t * event){ 1904 return event[4]; 1905 } 1906 /** 1907 * @brief Get field address from event sm_event_passkey_display_cancel 1908 * @param event packet 1909 * @param Pointer to storage for address 1910 * @note: btstack_type B 1911 */ 1912 static inline void sm_event_passkey_display_cancel_get_address(const uint8_t * event, bd_addr_t address){ 1913 reverse_bd_addr(&event[5], address); 1914 } 1915 #endif 1916 1917 #ifdef ENABLE_BLE 1918 /** 1919 * @brief Get field handle from event sm_event_passkey_input_number 1920 * @param event packet 1921 * @return handle 1922 * @note: btstack_type H 1923 */ 1924 static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t * event){ 1925 return little_endian_read_16(event, 2); 1926 } 1927 /** 1928 * @brief Get field addr_type from event sm_event_passkey_input_number 1929 * @param event packet 1930 * @return addr_type 1931 * @note: btstack_type 1 1932 */ 1933 static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t * event){ 1934 return event[4]; 1935 } 1936 /** 1937 * @brief Get field address from event sm_event_passkey_input_number 1938 * @param event packet 1939 * @param Pointer to storage for address 1940 * @note: btstack_type B 1941 */ 1942 static inline void sm_event_passkey_input_number_get_address(const uint8_t * event, bd_addr_t address){ 1943 reverse_bd_addr(&event[5], address); 1944 } 1945 #endif 1946 1947 #ifdef ENABLE_BLE 1948 /** 1949 * @brief Get field handle from event sm_event_passkey_input_cancel 1950 * @param event packet 1951 * @return handle 1952 * @note: btstack_type H 1953 */ 1954 static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t * event){ 1955 return little_endian_read_16(event, 2); 1956 } 1957 /** 1958 * @brief Get field addr_type from event sm_event_passkey_input_cancel 1959 * @param event packet 1960 * @return addr_type 1961 * @note: btstack_type 1 1962 */ 1963 static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t * event){ 1964 return event[4]; 1965 } 1966 /** 1967 * @brief Get field address from event sm_event_passkey_input_cancel 1968 * @param event packet 1969 * @param Pointer to storage for address 1970 * @note: btstack_type B 1971 */ 1972 static inline void sm_event_passkey_input_cancel_get_address(const uint8_t * event, bd_addr_t address){ 1973 reverse_bd_addr(&event[5], address); 1974 } 1975 #endif 1976 1977 #ifdef ENABLE_BLE 1978 /** 1979 * @brief Get field handle from event sm_event_identity_resolving_started 1980 * @param event packet 1981 * @return handle 1982 * @note: btstack_type H 1983 */ 1984 static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t * event){ 1985 return little_endian_read_16(event, 2); 1986 } 1987 /** 1988 * @brief Get field addr_type from event sm_event_identity_resolving_started 1989 * @param event packet 1990 * @return addr_type 1991 * @note: btstack_type 1 1992 */ 1993 static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t * event){ 1994 return event[4]; 1995 } 1996 /** 1997 * @brief Get field address from event sm_event_identity_resolving_started 1998 * @param event packet 1999 * @param Pointer to storage for address 2000 * @note: btstack_type B 2001 */ 2002 static inline void sm_event_identity_resolving_started_get_address(const uint8_t * event, bd_addr_t address){ 2003 reverse_bd_addr(&event[5], address); 2004 } 2005 #endif 2006 2007 #ifdef ENABLE_BLE 2008 /** 2009 * @brief Get field handle from event sm_event_identity_resolving_failed 2010 * @param event packet 2011 * @return handle 2012 * @note: btstack_type H 2013 */ 2014 static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t * event){ 2015 return little_endian_read_16(event, 2); 2016 } 2017 /** 2018 * @brief Get field addr_type from event sm_event_identity_resolving_failed 2019 * @param event packet 2020 * @return addr_type 2021 * @note: btstack_type 1 2022 */ 2023 static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t * event){ 2024 return event[4]; 2025 } 2026 /** 2027 * @brief Get field address from event sm_event_identity_resolving_failed 2028 * @param event packet 2029 * @param Pointer to storage for address 2030 * @note: btstack_type B 2031 */ 2032 static inline void sm_event_identity_resolving_failed_get_address(const uint8_t * event, bd_addr_t address){ 2033 reverse_bd_addr(&event[5], address); 2034 } 2035 #endif 2036 2037 #ifdef ENABLE_BLE 2038 /** 2039 * @brief Get field handle from event sm_event_identity_resolving_succeeded 2040 * @param event packet 2041 * @return handle 2042 * @note: btstack_type H 2043 */ 2044 static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t * event){ 2045 return little_endian_read_16(event, 2); 2046 } 2047 /** 2048 * @brief Get field addr_type from event sm_event_identity_resolving_succeeded 2049 * @param event packet 2050 * @return addr_type 2051 * @note: btstack_type 1 2052 */ 2053 static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t * event){ 2054 return event[4]; 2055 } 2056 /** 2057 * @brief Get field address from event sm_event_identity_resolving_succeeded 2058 * @param event packet 2059 * @param Pointer to storage for address 2060 * @note: btstack_type B 2061 */ 2062 static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t * event, bd_addr_t address){ 2063 reverse_bd_addr(&event[5], address); 2064 } 2065 /** 2066 * @brief Get field le_device_db_index from event sm_event_identity_resolving_succeeded 2067 * @param event packet 2068 * @return le_device_db_index 2069 * @note: btstack_type 2 2070 */ 2071 static inline uint16_t sm_event_identity_resolving_succeeded_get_le_device_db_index(const uint8_t * event){ 2072 return little_endian_read_16(event, 11); 2073 } 2074 #endif 2075 2076 #ifdef ENABLE_BLE 2077 /** 2078 * @brief Get field handle from event sm_event_authorization_request 2079 * @param event packet 2080 * @return handle 2081 * @note: btstack_type H 2082 */ 2083 static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t * event){ 2084 return little_endian_read_16(event, 2); 2085 } 2086 /** 2087 * @brief Get field addr_type from event sm_event_authorization_request 2088 * @param event packet 2089 * @return addr_type 2090 * @note: btstack_type 1 2091 */ 2092 static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t * event){ 2093 return event[4]; 2094 } 2095 /** 2096 * @brief Get field address from event sm_event_authorization_request 2097 * @param event packet 2098 * @param Pointer to storage for address 2099 * @note: btstack_type B 2100 */ 2101 static inline void sm_event_authorization_request_get_address(const uint8_t * event, bd_addr_t address){ 2102 reverse_bd_addr(&event[5], address); 2103 } 2104 #endif 2105 2106 #ifdef ENABLE_BLE 2107 /** 2108 * @brief Get field handle from event sm_event_authorization_result 2109 * @param event packet 2110 * @return handle 2111 * @note: btstack_type H 2112 */ 2113 static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t * event){ 2114 return little_endian_read_16(event, 2); 2115 } 2116 /** 2117 * @brief Get field addr_type from event sm_event_authorization_result 2118 * @param event packet 2119 * @return addr_type 2120 * @note: btstack_type 1 2121 */ 2122 static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t * event){ 2123 return event[4]; 2124 } 2125 /** 2126 * @brief Get field address from event sm_event_authorization_result 2127 * @param event packet 2128 * @param Pointer to storage for address 2129 * @note: btstack_type B 2130 */ 2131 static inline void sm_event_authorization_result_get_address(const uint8_t * event, bd_addr_t address){ 2132 reverse_bd_addr(&event[5], address); 2133 } 2134 /** 2135 * @brief Get field authorization_result from event sm_event_authorization_result 2136 * @param event packet 2137 * @return authorization_result 2138 * @note: btstack_type 1 2139 */ 2140 static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t * event){ 2141 return event[11]; 2142 } 2143 #endif 2144 2145 /** 2146 * @brief Get field advertising_event_type from event gap_le_event_advertising_report 2147 * @param event packet 2148 * @return advertising_event_type 2149 * @note: btstack_type 1 2150 */ 2151 static inline uint8_t gap_le_event_advertising_report_get_advertising_event_type(const uint8_t * event){ 2152 return event[2]; 2153 } 2154 /** 2155 * @brief Get field address_type from event gap_le_event_advertising_report 2156 * @param event packet 2157 * @return address_type 2158 * @note: btstack_type 1 2159 */ 2160 static inline uint8_t gap_le_event_advertising_report_get_address_type(const uint8_t * event){ 2161 return event[3]; 2162 } 2163 /** 2164 * @brief Get field address from event gap_le_event_advertising_report 2165 * @param event packet 2166 * @param Pointer to storage for address 2167 * @note: btstack_type B 2168 */ 2169 static inline void gap_le_event_advertising_report_get_address(const uint8_t * event, bd_addr_t address){ 2170 reverse_bd_addr(&event[4], address); 2171 } 2172 /** 2173 * @brief Get field rssi from event gap_le_event_advertising_report 2174 * @param event packet 2175 * @return rssi 2176 * @note: btstack_type 1 2177 */ 2178 static inline uint8_t gap_le_event_advertising_report_get_rssi(const uint8_t * event){ 2179 return event[10]; 2180 } 2181 /** 2182 * @brief Get field data_length from event gap_le_event_advertising_report 2183 * @param event packet 2184 * @return data_length 2185 * @note: btstack_type J 2186 */ 2187 static inline int gap_le_event_advertising_report_get_data_length(const uint8_t * event){ 2188 return event[11]; 2189 } 2190 /** 2191 * @brief Get field data from event gap_le_event_advertising_report 2192 * @param event packet 2193 * @return data 2194 * @note: btstack_type V 2195 */ 2196 static inline const uint8_t * gap_le_event_advertising_report_get_data(const uint8_t * event){ 2197 return &event[12]; 2198 } 2199 2200 /** 2201 * @brief Get field status from event hsp_subevent_audio_connection_complete 2202 * @param event packet 2203 * @return status 2204 * @note: btstack_type 1 2205 */ 2206 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){ 2207 return event[3]; 2208 } 2209 /** 2210 * @brief Get field handle from event hsp_subevent_audio_connection_complete 2211 * @param event packet 2212 * @return handle 2213 * @note: btstack_type H 2214 */ 2215 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){ 2216 return little_endian_read_16(event, 4); 2217 } 2218 2219 /** 2220 * @brief Get field status from event hsp_subevent_audio_disconnection_complete 2221 * @param event packet 2222 * @return status 2223 * @note: btstack_type 1 2224 */ 2225 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){ 2226 return event[3]; 2227 } 2228 2229 2230 /** 2231 * @brief Get field gain from event hsp_subevent_microphone_gain_changed 2232 * @param event packet 2233 * @return gain 2234 * @note: btstack_type 1 2235 */ 2236 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){ 2237 return event[3]; 2238 } 2239 2240 /** 2241 * @brief Get field gain from event hsp_subevent_speaker_gain_changed 2242 * @param event packet 2243 * @return gain 2244 * @note: btstack_type 1 2245 */ 2246 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){ 2247 return event[3]; 2248 } 2249 2250 /** 2251 * @brief Get field value_length from event hsp_subevent_hs_command 2252 * @param event packet 2253 * @return value_length 2254 * @note: btstack_type J 2255 */ 2256 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){ 2257 return event[3]; 2258 } 2259 /** 2260 * @brief Get field value from event hsp_subevent_hs_command 2261 * @param event packet 2262 * @return value 2263 * @note: btstack_type V 2264 */ 2265 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){ 2266 return &event[4]; 2267 } 2268 2269 /** 2270 * @brief Get field value_length from event hsp_subevent_ag_indication 2271 * @param event packet 2272 * @return value_length 2273 * @note: btstack_type J 2274 */ 2275 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){ 2276 return event[3]; 2277 } 2278 /** 2279 * @brief Get field value from event hsp_subevent_ag_indication 2280 * @param event packet 2281 * @return value 2282 * @note: btstack_type V 2283 */ 2284 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){ 2285 return &event[4]; 2286 } 2287 2288 #ifdef ENABLE_BLE 2289 /** 2290 * @brief Get field handle from event ancs_subevent_client_connected 2291 * @param event packet 2292 * @return handle 2293 * @note: btstack_type H 2294 */ 2295 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){ 2296 return little_endian_read_16(event, 3); 2297 } 2298 #endif 2299 2300 #ifdef ENABLE_BLE 2301 /** 2302 * @brief Get field handle from event ancs_subevent_client_notification 2303 * @param event packet 2304 * @return handle 2305 * @note: btstack_type H 2306 */ 2307 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){ 2308 return little_endian_read_16(event, 3); 2309 } 2310 /** 2311 * @brief Get field attribute_id from event ancs_subevent_client_notification 2312 * @param event packet 2313 * @return attribute_id 2314 * @note: btstack_type 2 2315 */ 2316 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){ 2317 return little_endian_read_16(event, 5); 2318 } 2319 /** 2320 * @brief Get field text from event ancs_subevent_client_notification 2321 * @param event packet 2322 * @return text 2323 * @note: btstack_type T 2324 */ 2325 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){ 2326 return (const char *) &event[7]; 2327 } 2328 #endif 2329 2330 #ifdef ENABLE_BLE 2331 /** 2332 * @brief Get field handle from event ancs_subevent_client_disconnected 2333 * @param event packet 2334 * @return handle 2335 * @note: btstack_type H 2336 */ 2337 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){ 2338 return little_endian_read_16(event, 3); 2339 } 2340 #endif 2341 2342 2343 2344 /* API_END */ 2345 2346 #if defined __cplusplus 2347 } 2348 #endif 2349 2350 #endif // __BTSTACK_EVENT_H 2351