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 * @brief Get field state from event BTSTACK_EVENT_STATE 869 * @param event packet 870 * @return state 871 * @note: btstack_type 1 872 */ 873 static inline uint8_t btstack_event_state_get_state(const uint8_t * event){ 874 return event[2]; 875 } 876 877 878 /** 879 * @brief Get field discoverable from event BTSTACK_EVENT_DISCOVERABLE_ENABLED 880 * @param event packet 881 * @return discoverable 882 * @note: btstack_type 1 883 */ 884 static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t * event){ 885 return event[2]; 886 } 887 888 /** 889 * @brief Get field handle from event HCI_EVENT_SCO_CAN_SEND_NOW 890 * @param event packet 891 * @param Pointer to storage for handle 892 * @note: btstack_type B 893 */ 894 static inline void hci_event_sco_can_send_now_get_handle(const uint8_t * event, bd_addr_t handle){ 895 reverse_bd_addr(&event[2], handle); 896 } 897 898 /** 899 * @brief Get field status from event L2CAP_EVENT_CHANNEL_OPENED 900 * @param event packet 901 * @return status 902 * @note: btstack_type 1 903 */ 904 static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t * event){ 905 return event[2]; 906 } 907 /** 908 * @brief Get field address from event L2CAP_EVENT_CHANNEL_OPENED 909 * @param event packet 910 * @param Pointer to storage for address 911 * @note: btstack_type B 912 */ 913 static inline void l2cap_event_channel_opened_get_address(const uint8_t * event, bd_addr_t address){ 914 reverse_bd_addr(&event[3], address); 915 } 916 /** 917 * @brief Get field handle from event L2CAP_EVENT_CHANNEL_OPENED 918 * @param event packet 919 * @return handle 920 * @note: btstack_type H 921 */ 922 static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t * event){ 923 return little_endian_read_16(event, 9); 924 } 925 /** 926 * @brief Get field psm from event L2CAP_EVENT_CHANNEL_OPENED 927 * @param event packet 928 * @return psm 929 * @note: btstack_type 2 930 */ 931 static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t * event){ 932 return little_endian_read_16(event, 11); 933 } 934 /** 935 * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_OPENED 936 * @param event packet 937 * @return local_cid 938 * @note: btstack_type 2 939 */ 940 static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t * event){ 941 return little_endian_read_16(event, 13); 942 } 943 /** 944 * @brief Get field remote_cid from event L2CAP_EVENT_CHANNEL_OPENED 945 * @param event packet 946 * @return remote_cid 947 * @note: btstack_type 2 948 */ 949 static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t * event){ 950 return little_endian_read_16(event, 15); 951 } 952 /** 953 * @brief Get field local_mtu from event L2CAP_EVENT_CHANNEL_OPENED 954 * @param event packet 955 * @return local_mtu 956 * @note: btstack_type 2 957 */ 958 static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t * event){ 959 return little_endian_read_16(event, 17); 960 } 961 /** 962 * @brief Get field remote_mtu from event L2CAP_EVENT_CHANNEL_OPENED 963 * @param event packet 964 * @return remote_mtu 965 * @note: btstack_type 2 966 */ 967 static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t * event){ 968 return little_endian_read_16(event, 19); 969 } 970 /** 971 * @brief Get field flush_timeout from event L2CAP_EVENT_CHANNEL_OPENED 972 * @param event packet 973 * @return flush_timeout 974 * @note: btstack_type 2 975 */ 976 static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t * event){ 977 return little_endian_read_16(event, 21); 978 } 979 980 /** 981 * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_CLOSED 982 * @param event packet 983 * @return local_cid 984 * @note: btstack_type 2 985 */ 986 static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t * event){ 987 return little_endian_read_16(event, 2); 988 } 989 990 /** 991 * @brief Get field status from event L2CAP_EVENT_INCOMING_CONNECTION 992 * @param event packet 993 * @return status 994 * @note: btstack_type 1 995 */ 996 static inline uint8_t l2cap_event_incoming_connection_get_status(const uint8_t * event){ 997 return event[2]; 998 } 999 /** 1000 * @brief Get field address from event L2CAP_EVENT_INCOMING_CONNECTION 1001 * @param event packet 1002 * @param Pointer to storage for address 1003 * @note: btstack_type B 1004 */ 1005 static inline void l2cap_event_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ 1006 reverse_bd_addr(&event[3], address); 1007 } 1008 /** 1009 * @brief Get field handle from event L2CAP_EVENT_INCOMING_CONNECTION 1010 * @param event packet 1011 * @return handle 1012 * @note: btstack_type H 1013 */ 1014 static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t * event){ 1015 return little_endian_read_16(event, 9); 1016 } 1017 /** 1018 * @brief Get field psm from event L2CAP_EVENT_INCOMING_CONNECTION 1019 * @param event packet 1020 * @return psm 1021 * @note: btstack_type 2 1022 */ 1023 static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t * event){ 1024 return little_endian_read_16(event, 11); 1025 } 1026 /** 1027 * @brief Get field local_cid from event L2CAP_EVENT_INCOMING_CONNECTION 1028 * @param event packet 1029 * @return local_cid 1030 * @note: btstack_type 2 1031 */ 1032 static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t * event){ 1033 return little_endian_read_16(event, 13); 1034 } 1035 /** 1036 * @brief Get field remote_cid from event L2CAP_EVENT_INCOMING_CONNECTION 1037 * @param event packet 1038 * @return remote_cid 1039 * @note: btstack_type 2 1040 */ 1041 static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t * event){ 1042 return little_endian_read_16(event, 15); 1043 } 1044 1045 /** 1046 * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1047 * @param event packet 1048 * @return handle 1049 * @note: btstack_type H 1050 */ 1051 static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t * event){ 1052 return little_endian_read_16(event, 2); 1053 } 1054 /** 1055 * @brief Get field interval_min from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1056 * @param event packet 1057 * @return interval_min 1058 * @note: btstack_type 2 1059 */ 1060 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t * event){ 1061 return little_endian_read_16(event, 4); 1062 } 1063 /** 1064 * @brief Get field interval_max from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1065 * @param event packet 1066 * @return interval_max 1067 * @note: btstack_type 2 1068 */ 1069 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t * event){ 1070 return little_endian_read_16(event, 6); 1071 } 1072 /** 1073 * @brief Get field latencey from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1074 * @param event packet 1075 * @return latencey 1076 * @note: btstack_type 2 1077 */ 1078 static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t * event){ 1079 return little_endian_read_16(event, 8); 1080 } 1081 /** 1082 * @brief Get field timeout_multiplier from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 1083 * @param event packet 1084 * @return timeout_multiplier 1085 * @note: btstack_type 2 1086 */ 1087 static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t * event){ 1088 return little_endian_read_16(event, 10); 1089 } 1090 1091 /** 1092 * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 1093 * @param event packet 1094 * @return handle 1095 * @note: btstack_type H 1096 */ 1097 static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t * event){ 1098 return little_endian_read_16(event, 2); 1099 } 1100 1101 /** 1102 * @brief Get field local_cid from event L2CAP_EVENT_CAN_SEND_NOW 1103 * @param event packet 1104 * @return local_cid 1105 * @note: btstack_type 2 1106 */ 1107 static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * event){ 1108 return little_endian_read_16(event, 2); 1109 } 1110 1111 /** 1112 * @brief Get field status from event RFCOMM_EVENT_CHANNEL_OPENED 1113 * @param event packet 1114 * @return status 1115 * @note: btstack_type 1 1116 */ 1117 static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t * event){ 1118 return event[2]; 1119 } 1120 /** 1121 * @brief Get field bd_addr from event RFCOMM_EVENT_CHANNEL_OPENED 1122 * @param event packet 1123 * @param Pointer to storage for bd_addr 1124 * @note: btstack_type B 1125 */ 1126 static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1127 reverse_bd_addr(&event[3], bd_addr); 1128 } 1129 /** 1130 * @brief Get field con_handle from event RFCOMM_EVENT_CHANNEL_OPENED 1131 * @param event packet 1132 * @return con_handle 1133 * @note: btstack_type 2 1134 */ 1135 static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t * event){ 1136 return little_endian_read_16(event, 9); 1137 } 1138 /** 1139 * @brief Get field server_channel from event RFCOMM_EVENT_CHANNEL_OPENED 1140 * @param event packet 1141 * @return server_channel 1142 * @note: btstack_type 1 1143 */ 1144 static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t * event){ 1145 return event[11]; 1146 } 1147 /** 1148 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_OPENED 1149 * @param event packet 1150 * @return rfcomm_cid 1151 * @note: btstack_type 2 1152 */ 1153 static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t * event){ 1154 return little_endian_read_16(event, 12); 1155 } 1156 /** 1157 * @brief Get field max_frame_size from event RFCOMM_EVENT_CHANNEL_OPENED 1158 * @param event packet 1159 * @return max_frame_size 1160 * @note: btstack_type 2 1161 */ 1162 static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t * event){ 1163 return little_endian_read_16(event, 14); 1164 } 1165 1166 /** 1167 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_CLOSED 1168 * @param event packet 1169 * @return rfcomm_cid 1170 * @note: btstack_type 2 1171 */ 1172 static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t * event){ 1173 return little_endian_read_16(event, 2); 1174 } 1175 1176 /** 1177 * @brief Get field bd_addr from event RFCOMM_EVENT_INCOMING_CONNECTION 1178 * @param event packet 1179 * @param Pointer to storage for bd_addr 1180 * @note: btstack_type B 1181 */ 1182 static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ 1183 reverse_bd_addr(&event[2], bd_addr); 1184 } 1185 /** 1186 * @brief Get field server_channel from event RFCOMM_EVENT_INCOMING_CONNECTION 1187 * @param event packet 1188 * @return server_channel 1189 * @note: btstack_type 1 1190 */ 1191 static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t * event){ 1192 return event[8]; 1193 } 1194 /** 1195 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_INCOMING_CONNECTION 1196 * @param event packet 1197 * @return rfcomm_cid 1198 * @note: btstack_type 2 1199 */ 1200 static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t * event){ 1201 return little_endian_read_16(event, 9); 1202 } 1203 1204 /** 1205 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_LINE_STATUS 1206 * @param event packet 1207 * @return rfcomm_cid 1208 * @note: btstack_type 2 1209 */ 1210 static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t * event){ 1211 return little_endian_read_16(event, 2); 1212 } 1213 /** 1214 * @brief Get field line_status from event RFCOMM_EVENT_REMOTE_LINE_STATUS 1215 * @param event packet 1216 * @return line_status 1217 * @note: btstack_type 1 1218 */ 1219 static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t * event){ 1220 return event[4]; 1221 } 1222 1223 /** 1224 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_MODEM_STATUS 1225 * @param event packet 1226 * @return rfcomm_cid 1227 * @note: btstack_type 2 1228 */ 1229 static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t * event){ 1230 return little_endian_read_16(event, 2); 1231 } 1232 /** 1233 * @brief Get field modem_status from event RFCOMM_EVENT_REMOTE_MODEM_STATUS 1234 * @param event packet 1235 * @return modem_status 1236 * @note: btstack_type 1 1237 */ 1238 static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t * event){ 1239 return event[4]; 1240 } 1241 1242 /** 1243 * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CAN_SEND_NOW 1244 * @param event packet 1245 * @return rfcomm_cid 1246 * @note: btstack_type 2 1247 */ 1248 static inline uint16_t rfcomm_event_can_send_now_get_rfcomm_cid(const uint8_t * event){ 1249 return little_endian_read_16(event, 2); 1250 } 1251 1252 /** 1253 * @brief Get field status from event SDP_EVENT_QUERY_COMPLETE 1254 * @param event packet 1255 * @return status 1256 * @note: btstack_type 1 1257 */ 1258 static inline uint8_t sdp_event_query_complete_get_status(const uint8_t * event){ 1259 return event[2]; 1260 } 1261 1262 /** 1263 * @brief Get field rfcomm_channel from event SDP_EVENT_QUERY_RFCOMM_SERVICE 1264 * @param event packet 1265 * @return rfcomm_channel 1266 * @note: btstack_type 1 1267 */ 1268 static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t * event){ 1269 return event[2]; 1270 } 1271 /** 1272 * @brief Get field name from event SDP_EVENT_QUERY_RFCOMM_SERVICE 1273 * @param event packet 1274 * @return name 1275 * @note: btstack_type T 1276 */ 1277 static inline const char * sdp_event_query_rfcomm_service_get_name(const uint8_t * event){ 1278 return (const char *) &event[3]; 1279 } 1280 1281 /** 1282 * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1283 * @param event packet 1284 * @return record_id 1285 * @note: btstack_type 2 1286 */ 1287 static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t * event){ 1288 return little_endian_read_16(event, 2); 1289 } 1290 /** 1291 * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1292 * @param event packet 1293 * @return attribute_id 1294 * @note: btstack_type 2 1295 */ 1296 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t * event){ 1297 return little_endian_read_16(event, 4); 1298 } 1299 /** 1300 * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1301 * @param event packet 1302 * @return attribute_length 1303 * @note: btstack_type 2 1304 */ 1305 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t * event){ 1306 return little_endian_read_16(event, 6); 1307 } 1308 /** 1309 * @brief Get field data_offset from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1310 * @param event packet 1311 * @return data_offset 1312 * @note: btstack_type 2 1313 */ 1314 static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t * event){ 1315 return little_endian_read_16(event, 8); 1316 } 1317 /** 1318 * @brief Get field data from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE 1319 * @param event packet 1320 * @return data 1321 * @note: btstack_type 1 1322 */ 1323 static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t * event){ 1324 return event[10]; 1325 } 1326 1327 /** 1328 * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1329 * @param event packet 1330 * @return record_id 1331 * @note: btstack_type 2 1332 */ 1333 static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t * event){ 1334 return little_endian_read_16(event, 2); 1335 } 1336 /** 1337 * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1338 * @param event packet 1339 * @return attribute_id 1340 * @note: btstack_type 2 1341 */ 1342 static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t * event){ 1343 return little_endian_read_16(event, 4); 1344 } 1345 /** 1346 * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1347 * @param event packet 1348 * @return attribute_length 1349 * @note: btstack_type L 1350 */ 1351 static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t * event){ 1352 return little_endian_read_16(event, 6); 1353 } 1354 /** 1355 * @brief Get field attribute_value from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE 1356 * @param event packet 1357 * @return attribute_value 1358 * @note: btstack_type V 1359 */ 1360 static inline const uint8_t * sdp_event_query_attribute_value_get_attribute_value(const uint8_t * event){ 1361 return &event[8]; 1362 } 1363 1364 /** 1365 * @brief Get field total_count from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1366 * @param event packet 1367 * @return total_count 1368 * @note: btstack_type 2 1369 */ 1370 static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t * event){ 1371 return little_endian_read_16(event, 2); 1372 } 1373 /** 1374 * @brief Get field record_index from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1375 * @param event packet 1376 * @return record_index 1377 * @note: btstack_type 2 1378 */ 1379 static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t * event){ 1380 return little_endian_read_16(event, 4); 1381 } 1382 /** 1383 * @brief Get field record_handle from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE 1384 * @param event packet 1385 * @return record_handle 1386 * @note: btstack_type 4 1387 */ 1388 static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t * event){ 1389 return little_endian_read_32(event, 6); 1390 } 1391 1392 #ifdef ENABLE_BLE 1393 /** 1394 * @brief Get field handle from event GATT_EVENT_QUERY_COMPLETE 1395 * @param event packet 1396 * @return handle 1397 * @note: btstack_type H 1398 */ 1399 static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t * event){ 1400 return little_endian_read_16(event, 2); 1401 } 1402 /** 1403 * @brief Get field status from event GATT_EVENT_QUERY_COMPLETE 1404 * @param event packet 1405 * @return status 1406 * @note: btstack_type 1 1407 */ 1408 static inline uint8_t gatt_event_query_complete_get_status(const uint8_t * event){ 1409 return event[4]; 1410 } 1411 #endif 1412 1413 #ifdef ENABLE_BLE 1414 /** 1415 * @brief Get field handle from event GATT_EVENT_SERVICE_QUERY_RESULT 1416 * @param event packet 1417 * @return handle 1418 * @note: btstack_type H 1419 */ 1420 static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t * event){ 1421 return little_endian_read_16(event, 2); 1422 } 1423 /** 1424 * @brief Get field service from event GATT_EVENT_SERVICE_QUERY_RESULT 1425 * @param event packet 1426 * @param Pointer to storage for service 1427 * @note: btstack_type X 1428 */ 1429 static inline void gatt_event_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1430 gatt_client_deserialize_service(event, 4, service); 1431 } 1432 #endif 1433 1434 #ifdef ENABLE_BLE 1435 /** 1436 * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 1437 * @param event packet 1438 * @return handle 1439 * @note: btstack_type H 1440 */ 1441 static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t * event){ 1442 return little_endian_read_16(event, 2); 1443 } 1444 /** 1445 * @brief Get field characteristic from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 1446 * @param event packet 1447 * @param Pointer to storage for characteristic 1448 * @note: btstack_type Y 1449 */ 1450 static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t * event, gatt_client_characteristic_t * characteristic){ 1451 gatt_client_deserialize_characteristic(event, 4, characteristic); 1452 } 1453 #endif 1454 1455 #ifdef ENABLE_BLE 1456 /** 1457 * @brief Get field handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1458 * @param event packet 1459 * @return handle 1460 * @note: btstack_type H 1461 */ 1462 static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){ 1463 return little_endian_read_16(event, 2); 1464 } 1465 /** 1466 * @brief Get field include_handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1467 * @param event packet 1468 * @return include_handle 1469 * @note: btstack_type 2 1470 */ 1471 static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){ 1472 return little_endian_read_16(event, 4); 1473 } 1474 /** 1475 * @brief Get field service from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT 1476 * @param event packet 1477 * @param Pointer to storage for service 1478 * @note: btstack_type X 1479 */ 1480 static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){ 1481 gatt_client_deserialize_service(event, 6, service); 1482 } 1483 #endif 1484 1485 #ifdef ENABLE_BLE 1486 /** 1487 * @brief Get field handle from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 1488 * @param event packet 1489 * @return handle 1490 * @note: btstack_type H 1491 */ 1492 static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t * event){ 1493 return little_endian_read_16(event, 2); 1494 } 1495 /** 1496 * @brief Get field characteristic_descriptor from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 1497 * @param event packet 1498 * @param Pointer to storage for characteristic_descriptor 1499 * @note: btstack_type Z 1500 */ 1501 static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t * event, gatt_client_characteristic_descriptor_t * characteristic_descriptor){ 1502 gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor); 1503 } 1504 #endif 1505 1506 #ifdef ENABLE_BLE 1507 /** 1508 * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1509 * @param event packet 1510 * @return handle 1511 * @note: btstack_type H 1512 */ 1513 static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t * event){ 1514 return little_endian_read_16(event, 2); 1515 } 1516 /** 1517 * @brief Get field value_handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1518 * @param event packet 1519 * @return value_handle 1520 * @note: btstack_type 2 1521 */ 1522 static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1523 return little_endian_read_16(event, 4); 1524 } 1525 /** 1526 * @brief Get field value_length from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1527 * @param event packet 1528 * @return value_length 1529 * @note: btstack_type L 1530 */ 1531 static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1532 return little_endian_read_16(event, 6); 1533 } 1534 /** 1535 * @brief Get field value from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT 1536 * @param event packet 1537 * @return value 1538 * @note: btstack_type V 1539 */ 1540 static inline const uint8_t * gatt_event_characteristic_value_query_result_get_value(const uint8_t * event){ 1541 return &event[8]; 1542 } 1543 #endif 1544 1545 #ifdef ENABLE_BLE 1546 /** 1547 * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1548 * @param event packet 1549 * @return handle 1550 * @note: btstack_type H 1551 */ 1552 static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t * event){ 1553 return little_endian_read_16(event, 2); 1554 } 1555 /** 1556 * @brief Get field value_handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1557 * @param event packet 1558 * @return value_handle 1559 * @note: btstack_type 2 1560 */ 1561 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t * event){ 1562 return little_endian_read_16(event, 4); 1563 } 1564 /** 1565 * @brief Get field value_offset from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1566 * @param event packet 1567 * @return value_offset 1568 * @note: btstack_type 2 1569 */ 1570 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t * event){ 1571 return little_endian_read_16(event, 6); 1572 } 1573 /** 1574 * @brief Get field value_length from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1575 * @param event packet 1576 * @return value_length 1577 * @note: btstack_type L 1578 */ 1579 static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t * event){ 1580 return little_endian_read_16(event, 8); 1581 } 1582 /** 1583 * @brief Get field value from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 1584 * @param event packet 1585 * @return value 1586 * @note: btstack_type V 1587 */ 1588 static inline const uint8_t * gatt_event_long_characteristic_value_query_result_get_value(const uint8_t * event){ 1589 return &event[10]; 1590 } 1591 #endif 1592 1593 #ifdef ENABLE_BLE 1594 /** 1595 * @brief Get field handle from event GATT_EVENT_NOTIFICATION 1596 * @param event packet 1597 * @return handle 1598 * @note: btstack_type H 1599 */ 1600 static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t * event){ 1601 return little_endian_read_16(event, 2); 1602 } 1603 /** 1604 * @brief Get field value_handle from event GATT_EVENT_NOTIFICATION 1605 * @param event packet 1606 * @return value_handle 1607 * @note: btstack_type 2 1608 */ 1609 static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t * event){ 1610 return little_endian_read_16(event, 4); 1611 } 1612 /** 1613 * @brief Get field value_length from event GATT_EVENT_NOTIFICATION 1614 * @param event packet 1615 * @return value_length 1616 * @note: btstack_type L 1617 */ 1618 static inline int gatt_event_notification_get_value_length(const uint8_t * event){ 1619 return little_endian_read_16(event, 6); 1620 } 1621 /** 1622 * @brief Get field value from event GATT_EVENT_NOTIFICATION 1623 * @param event packet 1624 * @return value 1625 * @note: btstack_type V 1626 */ 1627 static inline const uint8_t * gatt_event_notification_get_value(const uint8_t * event){ 1628 return &event[8]; 1629 } 1630 #endif 1631 1632 #ifdef ENABLE_BLE 1633 /** 1634 * @brief Get field handle from event GATT_EVENT_INDICATION 1635 * @param event packet 1636 * @return handle 1637 * @note: btstack_type H 1638 */ 1639 static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t * event){ 1640 return little_endian_read_16(event, 2); 1641 } 1642 /** 1643 * @brief Get field value_handle from event GATT_EVENT_INDICATION 1644 * @param event packet 1645 * @return value_handle 1646 * @note: btstack_type 2 1647 */ 1648 static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t * event){ 1649 return little_endian_read_16(event, 4); 1650 } 1651 /** 1652 * @brief Get field value_length from event GATT_EVENT_INDICATION 1653 * @param event packet 1654 * @return value_length 1655 * @note: btstack_type L 1656 */ 1657 static inline int gatt_event_indication_get_value_length(const uint8_t * event){ 1658 return little_endian_read_16(event, 6); 1659 } 1660 /** 1661 * @brief Get field value from event GATT_EVENT_INDICATION 1662 * @param event packet 1663 * @return value 1664 * @note: btstack_type V 1665 */ 1666 static inline const uint8_t * gatt_event_indication_get_value(const uint8_t * event){ 1667 return &event[8]; 1668 } 1669 #endif 1670 1671 #ifdef ENABLE_BLE 1672 /** 1673 * @brief Get field descriptor_handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1674 * @param event packet 1675 * @return descriptor_handle 1676 * @note: btstack_type H 1677 */ 1678 static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t * event){ 1679 return little_endian_read_16(event, 2); 1680 } 1681 /** 1682 * @brief Get field descriptor_length from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1683 * @param event packet 1684 * @return descriptor_length 1685 * @note: btstack_type 2 1686 */ 1687 static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1688 return little_endian_read_16(event, 4); 1689 } 1690 /** 1691 * @brief Get field descriptor from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1692 * @param event packet 1693 * @return descriptor 1694 * @note: btstack_type L 1695 */ 1696 static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1697 return little_endian_read_16(event, 6); 1698 } 1699 #endif 1700 1701 #ifdef ENABLE_BLE 1702 /** 1703 * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1704 * @param event packet 1705 * @return handle 1706 * @note: btstack_type H 1707 */ 1708 static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t * event){ 1709 return little_endian_read_16(event, 2); 1710 } 1711 /** 1712 * @brief Get field descriptor_offset from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1713 * @param event packet 1714 * @return descriptor_offset 1715 * @note: btstack_type 2 1716 */ 1717 static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t * event){ 1718 return little_endian_read_16(event, 4); 1719 } 1720 /** 1721 * @brief Get field descriptor_length from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1722 * @param event packet 1723 * @return descriptor_length 1724 * @note: btstack_type L 1725 */ 1726 static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){ 1727 return little_endian_read_16(event, 6); 1728 } 1729 /** 1730 * @brief Get field descriptor from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 1731 * @param event packet 1732 * @return descriptor 1733 * @note: btstack_type V 1734 */ 1735 static inline const uint8_t * gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){ 1736 return &event[8]; 1737 } 1738 #endif 1739 1740 #ifdef ENABLE_BLE 1741 /** 1742 * @brief Get field handle from event GATT_EVENT_MTU 1743 * @param event packet 1744 * @return handle 1745 * @note: btstack_type H 1746 */ 1747 static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t * event){ 1748 return little_endian_read_16(event, 2); 1749 } 1750 /** 1751 * @brief Get field MTU from event GATT_EVENT_MTU 1752 * @param event packet 1753 * @return MTU 1754 * @note: btstack_type 2 1755 */ 1756 static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t * event){ 1757 return little_endian_read_16(event, 4); 1758 } 1759 #endif 1760 1761 /** 1762 * @brief Get field handle from event ATT_EVENT_MTU_EXCHANGE_COMPLETE 1763 * @param event packet 1764 * @return handle 1765 * @note: btstack_type H 1766 */ 1767 static inline hci_con_handle_t att_event_mtu_exchange_complete_get_handle(const uint8_t * event){ 1768 return little_endian_read_16(event, 2); 1769 } 1770 /** 1771 * @brief Get field MTU from event ATT_EVENT_MTU_EXCHANGE_COMPLETE 1772 * @param event packet 1773 * @return MTU 1774 * @note: btstack_type 2 1775 */ 1776 static inline uint16_t att_event_mtu_exchange_complete_get_MTU(const uint8_t * event){ 1777 return little_endian_read_16(event, 4); 1778 } 1779 1780 /** 1781 * @brief Get field status from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 1782 * @param event packet 1783 * @return status 1784 * @note: btstack_type 1 1785 */ 1786 static inline uint8_t att_event_handle_value_indication_complete_get_status(const uint8_t * event){ 1787 return event[2]; 1788 } 1789 /** 1790 * @brief Get field conn_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 1791 * @param event packet 1792 * @return conn_handle 1793 * @note: btstack_type H 1794 */ 1795 static inline hci_con_handle_t att_event_handle_value_indication_complete_get_conn_handle(const uint8_t * event){ 1796 return little_endian_read_16(event, 3); 1797 } 1798 /** 1799 * @brief Get field attribute_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE 1800 * @param event packet 1801 * @return attribute_handle 1802 * @note: btstack_type 2 1803 */ 1804 static inline uint16_t att_event_handle_value_indication_complete_get_attribute_handle(const uint8_t * event){ 1805 return little_endian_read_16(event, 5); 1806 } 1807 1808 1809 /** 1810 * @brief Get field status from event BNEP_EVENT_SERVICE_REGISTERED 1811 * @param event packet 1812 * @return status 1813 * @note: btstack_type 1 1814 */ 1815 static inline uint8_t bnep_event_service_registered_get_status(const uint8_t * event){ 1816 return event[2]; 1817 } 1818 /** 1819 * @brief Get field service_uuid from event BNEP_EVENT_SERVICE_REGISTERED 1820 * @param event packet 1821 * @return service_uuid 1822 * @note: btstack_type 2 1823 */ 1824 static inline uint16_t bnep_event_service_registered_get_service_uuid(const uint8_t * event){ 1825 return little_endian_read_16(event, 3); 1826 } 1827 1828 /** 1829 * @brief Get field status from event BNEP_EVENT_CHANNEL_OPENED 1830 * @param event packet 1831 * @return status 1832 * @note: btstack_type 1 1833 */ 1834 static inline uint8_t bnep_event_channel_opened_get_status(const uint8_t * event){ 1835 return event[2]; 1836 } 1837 /** 1838 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_OPENED 1839 * @param event packet 1840 * @return bnep_cid 1841 * @note: btstack_type 2 1842 */ 1843 static inline uint16_t bnep_event_channel_opened_get_bnep_cid(const uint8_t * event){ 1844 return little_endian_read_16(event, 3); 1845 } 1846 /** 1847 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_OPENED 1848 * @param event packet 1849 * @return source_uuid 1850 * @note: btstack_type 2 1851 */ 1852 static inline uint16_t bnep_event_channel_opened_get_source_uuid(const uint8_t * event){ 1853 return little_endian_read_16(event, 5); 1854 } 1855 /** 1856 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_OPENED 1857 * @param event packet 1858 * @return destination_uuid 1859 * @note: btstack_type 2 1860 */ 1861 static inline uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t * event){ 1862 return little_endian_read_16(event, 7); 1863 } 1864 /** 1865 * @brief Get field mtu from event BNEP_EVENT_CHANNEL_OPENED 1866 * @param event packet 1867 * @return mtu 1868 * @note: btstack_type 2 1869 */ 1870 static inline uint16_t bnep_event_channel_opened_get_mtu(const uint8_t * event){ 1871 return little_endian_read_16(event, 9); 1872 } 1873 /** 1874 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_OPENED 1875 * @param event packet 1876 * @param Pointer to storage for remote_address 1877 * @note: btstack_type B 1878 */ 1879 static inline void bnep_event_channel_opened_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1880 reverse_bd_addr(&event[11], remote_address); 1881 } 1882 1883 /** 1884 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_CLOSED 1885 * @param event packet 1886 * @return bnep_cid 1887 * @note: btstack_type 2 1888 */ 1889 static inline uint16_t bnep_event_channel_closed_get_bnep_cid(const uint8_t * event){ 1890 return little_endian_read_16(event, 2); 1891 } 1892 /** 1893 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_CLOSED 1894 * @param event packet 1895 * @return source_uuid 1896 * @note: btstack_type 2 1897 */ 1898 static inline uint16_t bnep_event_channel_closed_get_source_uuid(const uint8_t * event){ 1899 return little_endian_read_16(event, 4); 1900 } 1901 /** 1902 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_CLOSED 1903 * @param event packet 1904 * @return destination_uuid 1905 * @note: btstack_type 2 1906 */ 1907 static inline uint16_t bnep_event_channel_closed_get_destination_uuid(const uint8_t * event){ 1908 return little_endian_read_16(event, 6); 1909 } 1910 /** 1911 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_CLOSED 1912 * @param event packet 1913 * @param Pointer to storage for remote_address 1914 * @note: btstack_type B 1915 */ 1916 static inline void bnep_event_channel_closed_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1917 reverse_bd_addr(&event[8], remote_address); 1918 } 1919 1920 /** 1921 * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_TIMEOUT 1922 * @param event packet 1923 * @return bnep_cid 1924 * @note: btstack_type 2 1925 */ 1926 static inline uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t * event){ 1927 return little_endian_read_16(event, 2); 1928 } 1929 /** 1930 * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT 1931 * @param event packet 1932 * @return source_uuid 1933 * @note: btstack_type 2 1934 */ 1935 static inline uint16_t bnep_event_channel_timeout_get_source_uuid(const uint8_t * event){ 1936 return little_endian_read_16(event, 4); 1937 } 1938 /** 1939 * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT 1940 * @param event packet 1941 * @return destination_uuid 1942 * @note: btstack_type 2 1943 */ 1944 static inline uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t * event){ 1945 return little_endian_read_16(event, 6); 1946 } 1947 /** 1948 * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_TIMEOUT 1949 * @param event packet 1950 * @param Pointer to storage for remote_address 1951 * @note: btstack_type B 1952 */ 1953 static inline void bnep_event_channel_timeout_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 1954 reverse_bd_addr(&event[8], remote_address); 1955 } 1956 /** 1957 * @brief Get field channel_state from event BNEP_EVENT_CHANNEL_TIMEOUT 1958 * @param event packet 1959 * @return channel_state 1960 * @note: btstack_type 1 1961 */ 1962 static inline uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t * event){ 1963 return event[14]; 1964 } 1965 1966 /** 1967 * @brief Get field bnep_cid from event BNEP_EVENT_CAN_SEND_NOW 1968 * @param event packet 1969 * @return bnep_cid 1970 * @note: btstack_type 2 1971 */ 1972 static inline uint16_t bnep_event_can_send_now_get_bnep_cid(const uint8_t * event){ 1973 return little_endian_read_16(event, 2); 1974 } 1975 /** 1976 * @brief Get field source_uuid from event BNEP_EVENT_CAN_SEND_NOW 1977 * @param event packet 1978 * @return source_uuid 1979 * @note: btstack_type 2 1980 */ 1981 static inline uint16_t bnep_event_can_send_now_get_source_uuid(const uint8_t * event){ 1982 return little_endian_read_16(event, 4); 1983 } 1984 /** 1985 * @brief Get field destination_uuid from event BNEP_EVENT_CAN_SEND_NOW 1986 * @param event packet 1987 * @return destination_uuid 1988 * @note: btstack_type 2 1989 */ 1990 static inline uint16_t bnep_event_can_send_now_get_destination_uuid(const uint8_t * event){ 1991 return little_endian_read_16(event, 6); 1992 } 1993 /** 1994 * @brief Get field remote_address from event BNEP_EVENT_CAN_SEND_NOW 1995 * @param event packet 1996 * @param Pointer to storage for remote_address 1997 * @note: btstack_type B 1998 */ 1999 static inline void bnep_event_can_send_now_get_remote_address(const uint8_t * event, bd_addr_t remote_address){ 2000 reverse_bd_addr(&event[8], remote_address); 2001 } 2002 2003 #ifdef ENABLE_BLE 2004 /** 2005 * @brief Get field handle from event SM_EVENT_JUST_WORKS_REQUEST 2006 * @param event packet 2007 * @return handle 2008 * @note: btstack_type H 2009 */ 2010 static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t * event){ 2011 return little_endian_read_16(event, 2); 2012 } 2013 /** 2014 * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_REQUEST 2015 * @param event packet 2016 * @return addr_type 2017 * @note: btstack_type 1 2018 */ 2019 static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t * event){ 2020 return event[4]; 2021 } 2022 /** 2023 * @brief Get field address from event SM_EVENT_JUST_WORKS_REQUEST 2024 * @param event packet 2025 * @param Pointer to storage for address 2026 * @note: btstack_type B 2027 */ 2028 static inline void sm_event_just_works_request_get_address(const uint8_t * event, bd_addr_t address){ 2029 reverse_bd_addr(&event[5], address); 2030 } 2031 #endif 2032 2033 #ifdef ENABLE_BLE 2034 /** 2035 * @brief Get field handle from event SM_EVENT_JUST_WORKS_CANCEL 2036 * @param event packet 2037 * @return handle 2038 * @note: btstack_type H 2039 */ 2040 static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t * event){ 2041 return little_endian_read_16(event, 2); 2042 } 2043 /** 2044 * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_CANCEL 2045 * @param event packet 2046 * @return addr_type 2047 * @note: btstack_type 1 2048 */ 2049 static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t * event){ 2050 return event[4]; 2051 } 2052 /** 2053 * @brief Get field address from event SM_EVENT_JUST_WORKS_CANCEL 2054 * @param event packet 2055 * @param Pointer to storage for address 2056 * @note: btstack_type B 2057 */ 2058 static inline void sm_event_just_works_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2059 reverse_bd_addr(&event[5], address); 2060 } 2061 #endif 2062 2063 #ifdef ENABLE_BLE 2064 /** 2065 * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2066 * @param event packet 2067 * @return handle 2068 * @note: btstack_type H 2069 */ 2070 static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t * event){ 2071 return little_endian_read_16(event, 2); 2072 } 2073 /** 2074 * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2075 * @param event packet 2076 * @return addr_type 2077 * @note: btstack_type 1 2078 */ 2079 static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t * event){ 2080 return event[4]; 2081 } 2082 /** 2083 * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2084 * @param event packet 2085 * @param Pointer to storage for address 2086 * @note: btstack_type B 2087 */ 2088 static inline void sm_event_passkey_display_number_get_address(const uint8_t * event, bd_addr_t address){ 2089 reverse_bd_addr(&event[5], address); 2090 } 2091 /** 2092 * @brief Get field passkey from event SM_EVENT_PASSKEY_DISPLAY_NUMBER 2093 * @param event packet 2094 * @return passkey 2095 * @note: btstack_type 4 2096 */ 2097 static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t * event){ 2098 return little_endian_read_32(event, 11); 2099 } 2100 #endif 2101 2102 #ifdef ENABLE_BLE 2103 /** 2104 * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2105 * @param event packet 2106 * @return handle 2107 * @note: btstack_type H 2108 */ 2109 static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t * event){ 2110 return little_endian_read_16(event, 2); 2111 } 2112 /** 2113 * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2114 * @param event packet 2115 * @return addr_type 2116 * @note: btstack_type 1 2117 */ 2118 static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t * event){ 2119 return event[4]; 2120 } 2121 /** 2122 * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_CANCEL 2123 * @param event packet 2124 * @param Pointer to storage for address 2125 * @note: btstack_type B 2126 */ 2127 static inline void sm_event_passkey_display_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2128 reverse_bd_addr(&event[5], address); 2129 } 2130 #endif 2131 2132 #ifdef ENABLE_BLE 2133 /** 2134 * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_NUMBER 2135 * @param event packet 2136 * @return handle 2137 * @note: btstack_type H 2138 */ 2139 static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t * event){ 2140 return little_endian_read_16(event, 2); 2141 } 2142 /** 2143 * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_NUMBER 2144 * @param event packet 2145 * @return addr_type 2146 * @note: btstack_type 1 2147 */ 2148 static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t * event){ 2149 return event[4]; 2150 } 2151 /** 2152 * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_NUMBER 2153 * @param event packet 2154 * @param Pointer to storage for address 2155 * @note: btstack_type B 2156 */ 2157 static inline void sm_event_passkey_input_number_get_address(const uint8_t * event, bd_addr_t address){ 2158 reverse_bd_addr(&event[5], address); 2159 } 2160 #endif 2161 2162 #ifdef ENABLE_BLE 2163 /** 2164 * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_CANCEL 2165 * @param event packet 2166 * @return handle 2167 * @note: btstack_type H 2168 */ 2169 static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t * event){ 2170 return little_endian_read_16(event, 2); 2171 } 2172 /** 2173 * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_CANCEL 2174 * @param event packet 2175 * @return addr_type 2176 * @note: btstack_type 1 2177 */ 2178 static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t * event){ 2179 return event[4]; 2180 } 2181 /** 2182 * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_CANCEL 2183 * @param event packet 2184 * @param Pointer to storage for address 2185 * @note: btstack_type B 2186 */ 2187 static inline void sm_event_passkey_input_cancel_get_address(const uint8_t * event, bd_addr_t address){ 2188 reverse_bd_addr(&event[5], address); 2189 } 2190 #endif 2191 2192 #ifdef ENABLE_BLE 2193 /** 2194 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2195 * @param event packet 2196 * @return handle 2197 * @note: btstack_type H 2198 */ 2199 static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t * event){ 2200 return little_endian_read_16(event, 2); 2201 } 2202 /** 2203 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2204 * @param event packet 2205 * @return addr_type 2206 * @note: btstack_type 1 2207 */ 2208 static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t * event){ 2209 return event[4]; 2210 } 2211 /** 2212 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_STARTED 2213 * @param event packet 2214 * @param Pointer to storage for address 2215 * @note: btstack_type B 2216 */ 2217 static inline void sm_event_identity_resolving_started_get_address(const uint8_t * event, bd_addr_t address){ 2218 reverse_bd_addr(&event[5], address); 2219 } 2220 #endif 2221 2222 #ifdef ENABLE_BLE 2223 /** 2224 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2225 * @param event packet 2226 * @return handle 2227 * @note: btstack_type H 2228 */ 2229 static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t * event){ 2230 return little_endian_read_16(event, 2); 2231 } 2232 /** 2233 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2234 * @param event packet 2235 * @return addr_type 2236 * @note: btstack_type 1 2237 */ 2238 static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t * event){ 2239 return event[4]; 2240 } 2241 /** 2242 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_FAILED 2243 * @param event packet 2244 * @param Pointer to storage for address 2245 * @note: btstack_type B 2246 */ 2247 static inline void sm_event_identity_resolving_failed_get_address(const uint8_t * event, bd_addr_t address){ 2248 reverse_bd_addr(&event[5], address); 2249 } 2250 #endif 2251 2252 #ifdef ENABLE_BLE 2253 /** 2254 * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2255 * @param event packet 2256 * @return handle 2257 * @note: btstack_type H 2258 */ 2259 static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t * event){ 2260 return little_endian_read_16(event, 2); 2261 } 2262 /** 2263 * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2264 * @param event packet 2265 * @return addr_type 2266 * @note: btstack_type 1 2267 */ 2268 static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t * event){ 2269 return event[4]; 2270 } 2271 /** 2272 * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2273 * @param event packet 2274 * @param Pointer to storage for address 2275 * @note: btstack_type B 2276 */ 2277 static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t * event, bd_addr_t address){ 2278 reverse_bd_addr(&event[5], address); 2279 } 2280 /** 2281 * @brief Get field le_device_db_index from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 2282 * @param event packet 2283 * @return le_device_db_index 2284 * @note: btstack_type 2 2285 */ 2286 static inline uint16_t sm_event_identity_resolving_succeeded_get_le_device_db_index(const uint8_t * event){ 2287 return little_endian_read_16(event, 11); 2288 } 2289 #endif 2290 2291 #ifdef ENABLE_BLE 2292 /** 2293 * @brief Get field handle from event SM_EVENT_AUTHORIZATION_REQUEST 2294 * @param event packet 2295 * @return handle 2296 * @note: btstack_type H 2297 */ 2298 static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t * event){ 2299 return little_endian_read_16(event, 2); 2300 } 2301 /** 2302 * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_REQUEST 2303 * @param event packet 2304 * @return addr_type 2305 * @note: btstack_type 1 2306 */ 2307 static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t * event){ 2308 return event[4]; 2309 } 2310 /** 2311 * @brief Get field address from event SM_EVENT_AUTHORIZATION_REQUEST 2312 * @param event packet 2313 * @param Pointer to storage for address 2314 * @note: btstack_type B 2315 */ 2316 static inline void sm_event_authorization_request_get_address(const uint8_t * event, bd_addr_t address){ 2317 reverse_bd_addr(&event[5], address); 2318 } 2319 #endif 2320 2321 #ifdef ENABLE_BLE 2322 /** 2323 * @brief Get field handle from event SM_EVENT_AUTHORIZATION_RESULT 2324 * @param event packet 2325 * @return handle 2326 * @note: btstack_type H 2327 */ 2328 static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t * event){ 2329 return little_endian_read_16(event, 2); 2330 } 2331 /** 2332 * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_RESULT 2333 * @param event packet 2334 * @return addr_type 2335 * @note: btstack_type 1 2336 */ 2337 static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t * event){ 2338 return event[4]; 2339 } 2340 /** 2341 * @brief Get field address from event SM_EVENT_AUTHORIZATION_RESULT 2342 * @param event packet 2343 * @param Pointer to storage for address 2344 * @note: btstack_type B 2345 */ 2346 static inline void sm_event_authorization_result_get_address(const uint8_t * event, bd_addr_t address){ 2347 reverse_bd_addr(&event[5], address); 2348 } 2349 /** 2350 * @brief Get field authorization_result from event SM_EVENT_AUTHORIZATION_RESULT 2351 * @param event packet 2352 * @return authorization_result 2353 * @note: btstack_type 1 2354 */ 2355 static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t * event){ 2356 return event[11]; 2357 } 2358 #endif 2359 2360 /** 2361 <<<<<<< HEAD 2362 * @brief Get field handle from event gap_event_security_level 2363 * @param event packet 2364 * @return handle 2365 * @note: btstack_type H 2366 */ 2367 static inline hci_con_handle_t gap_event_security_level_get_handle(const uint8_t * event){ 2368 return little_endian_read_16(event, 2); 2369 } 2370 /** 2371 * @brief Get field security_level from event gap_event_security_level 2372 * @param event packet 2373 * @return security_level 2374 * @note: btstack_type 1 2375 */ 2376 static inline uint8_t gap_event_security_level_get_security_level(const uint8_t * event){ 2377 return event[4]; 2378 } 2379 2380 /** 2381 * @brief Get field status from event gap_event_dedicated_bonding_completed 2382 * @param event packet 2383 * @return status 2384 * @note: btstack_type 1 2385 */ 2386 static inline uint8_t gap_event_dedicated_bonding_completed_get_status(const uint8_t * event){ 2387 return event[2]; 2388 } 2389 /** 2390 * @brief Get field address from event gap_event_dedicated_bonding_completed 2391 * @param event packet 2392 * @param Pointer to storage for address 2393 * @note: btstack_type B 2394 */ 2395 static inline void gap_event_dedicated_bonding_completed_get_address(const uint8_t * event, bd_addr_t address){ 2396 reverse_bd_addr(&event[3], address); 2397 } 2398 2399 /** 2400 * @brief Get field advertising_event_type from event gap_event_advertising_report 2401 ======= 2402 * @brief Get field advertising_event_type from event GAP_EVENT_ADVERTISING_REPORT 2403 >>>>>>> 568284b08fa415cfefa87358341b4d966401705d 2404 * @param event packet 2405 * @return advertising_event_type 2406 * @note: btstack_type 1 2407 */ 2408 static inline uint8_t gap_event_advertising_report_get_advertising_event_type(const uint8_t * event){ 2409 return event[2]; 2410 } 2411 /** 2412 * @brief Get field address_type from event GAP_EVENT_ADVERTISING_REPORT 2413 * @param event packet 2414 * @return address_type 2415 * @note: btstack_type 1 2416 */ 2417 static inline uint8_t gap_event_advertising_report_get_address_type(const uint8_t * event){ 2418 return event[3]; 2419 } 2420 /** 2421 * @brief Get field address from event GAP_EVENT_ADVERTISING_REPORT 2422 * @param event packet 2423 * @param Pointer to storage for address 2424 * @note: btstack_type B 2425 */ 2426 static inline void gap_event_advertising_report_get_address(const uint8_t * event, bd_addr_t address){ 2427 reverse_bd_addr(&event[4], address); 2428 } 2429 /** 2430 * @brief Get field rssi from event GAP_EVENT_ADVERTISING_REPORT 2431 * @param event packet 2432 * @return rssi 2433 * @note: btstack_type 1 2434 */ 2435 static inline uint8_t gap_event_advertising_report_get_rssi(const uint8_t * event){ 2436 return event[10]; 2437 } 2438 /** 2439 * @brief Get field data_length from event GAP_EVENT_ADVERTISING_REPORT 2440 * @param event packet 2441 * @return data_length 2442 * @note: btstack_type J 2443 */ 2444 static inline int gap_event_advertising_report_get_data_length(const uint8_t * event){ 2445 return event[11]; 2446 } 2447 /** 2448 * @brief Get field data from event GAP_EVENT_ADVERTISING_REPORT 2449 * @param event packet 2450 * @return data 2451 * @note: btstack_type V 2452 */ 2453 static inline const uint8_t * gap_event_advertising_report_get_data(const uint8_t * event){ 2454 return &event[12]; 2455 } 2456 2457 /** 2458 * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2459 * @param event packet 2460 * @return status 2461 * @note: btstack_type 1 2462 */ 2463 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){ 2464 return event[3]; 2465 } 2466 /** 2467 * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2468 * @param event packet 2469 * @return connection_handle 2470 * @note: btstack_type H 2471 */ 2472 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){ 2473 return little_endian_read_16(event, 4); 2474 } 2475 /** 2476 * @brief Get field role from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2477 * @param event packet 2478 * @return role 2479 * @note: btstack_type 1 2480 */ 2481 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){ 2482 return event[6]; 2483 } 2484 /** 2485 * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2486 * @param event packet 2487 * @return peer_address_type 2488 * @note: btstack_type 1 2489 */ 2490 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){ 2491 return event[7]; 2492 } 2493 /** 2494 * @brief Get field peer_address from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2495 * @param event packet 2496 * @param Pointer to storage for peer_address 2497 * @note: btstack_type B 2498 */ 2499 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){ 2500 reverse_bd_addr(&event[8], peer_address); 2501 } 2502 /** 2503 * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2504 * @param event packet 2505 * @return conn_interval 2506 * @note: btstack_type 2 2507 */ 2508 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){ 2509 return little_endian_read_16(event, 14); 2510 } 2511 /** 2512 * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2513 * @param event packet 2514 * @return conn_latency 2515 * @note: btstack_type 2 2516 */ 2517 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){ 2518 return little_endian_read_16(event, 16); 2519 } 2520 /** 2521 * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2522 * @param event packet 2523 * @return supervision_timeout 2524 * @note: btstack_type 2 2525 */ 2526 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){ 2527 return little_endian_read_16(event, 18); 2528 } 2529 /** 2530 * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE 2531 * @param event packet 2532 * @return master_clock_accuracy 2533 * @note: btstack_type 1 2534 */ 2535 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){ 2536 return event[20]; 2537 } 2538 2539 /** 2540 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE 2541 * @param event packet 2542 * @return status 2543 * @note: btstack_type 1 2544 */ 2545 static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t * event){ 2546 return event[3]; 2547 } 2548 2549 /** 2550 * @brief Get field status from event HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE 2551 * @param event packet 2552 * @return status 2553 * @note: btstack_type 1 2554 */ 2555 static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t * event){ 2556 return event[3]; 2557 } 2558 2559 /** 2560 * @brief Get field status from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 2561 * @param event packet 2562 * @return status 2563 * @note: btstack_type 1 2564 */ 2565 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){ 2566 return event[3]; 2567 } 2568 /** 2569 * @brief Get field handle from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 2570 * @param event packet 2571 * @return handle 2572 * @note: btstack_type H 2573 */ 2574 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){ 2575 return little_endian_read_16(event, 4); 2576 } 2577 2578 /** 2579 * @brief Get field status from event HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 2580 * @param event packet 2581 * @return status 2582 * @note: btstack_type 1 2583 */ 2584 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){ 2585 return event[3]; 2586 } 2587 2588 2589 /** 2590 * @brief Get field gain from event HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 2591 * @param event packet 2592 * @return gain 2593 * @note: btstack_type 1 2594 */ 2595 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){ 2596 return event[3]; 2597 } 2598 2599 /** 2600 * @brief Get field gain from event HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 2601 * @param event packet 2602 * @return gain 2603 * @note: btstack_type 1 2604 */ 2605 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){ 2606 return event[3]; 2607 } 2608 2609 /** 2610 * @brief Get field value_length from event HSP_SUBEVENT_HS_COMMAND 2611 * @param event packet 2612 * @return value_length 2613 * @note: btstack_type J 2614 */ 2615 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){ 2616 return event[3]; 2617 } 2618 /** 2619 * @brief Get field value from event HSP_SUBEVENT_HS_COMMAND 2620 * @param event packet 2621 * @return value 2622 * @note: btstack_type V 2623 */ 2624 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){ 2625 return &event[4]; 2626 } 2627 2628 /** 2629 * @brief Get field value_length from event HSP_SUBEVENT_AG_INDICATION 2630 * @param event packet 2631 * @return value_length 2632 * @note: btstack_type J 2633 */ 2634 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){ 2635 return event[3]; 2636 } 2637 /** 2638 * @brief Get field value from event HSP_SUBEVENT_AG_INDICATION 2639 * @param event packet 2640 * @return value 2641 * @note: btstack_type V 2642 */ 2643 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){ 2644 return &event[4]; 2645 } 2646 2647 /** 2648 * @brief Get field status from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 2649 * @param event packet 2650 * @return status 2651 * @note: btstack_type 1 2652 */ 2653 static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t * event){ 2654 return event[3]; 2655 } 2656 2657 2658 /** 2659 * @brief Get field status from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 2660 * @param event packet 2661 * @return status 2662 * @note: btstack_type 1 2663 */ 2664 static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){ 2665 return event[3]; 2666 } 2667 2668 2669 /** 2670 * @brief Get field status from event HFP_SUBEVENT_COMPLETE 2671 * @param event packet 2672 * @return status 2673 * @note: btstack_type 1 2674 */ 2675 static inline uint8_t hfp_subevent_complete_get_status(const uint8_t * event){ 2676 return event[3]; 2677 } 2678 2679 /** 2680 * @brief Get field indicator_index from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 2681 * @param event packet 2682 * @return indicator_index 2683 * @note: btstack_type 1 2684 */ 2685 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t * event){ 2686 return event[3]; 2687 } 2688 /** 2689 * @brief Get field indicator_status from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 2690 * @param event packet 2691 * @return indicator_status 2692 * @note: btstack_type 1 2693 */ 2694 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t * event){ 2695 return event[4]; 2696 } 2697 /** 2698 * @brief Get field indicator_name from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 2699 * @param event packet 2700 * @return indicator_name 2701 * @note: btstack_type T 2702 */ 2703 static inline const char * hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t * event){ 2704 return (const char *) &event[5]; 2705 } 2706 2707 /** 2708 * @brief Get field network_operator_mode from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 2709 * @param event packet 2710 * @return network_operator_mode 2711 * @note: btstack_type 1 2712 */ 2713 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t * event){ 2714 return event[3]; 2715 } 2716 /** 2717 * @brief Get field network_operator_format from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 2718 * @param event packet 2719 * @return network_operator_format 2720 * @note: btstack_type 1 2721 */ 2722 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t * event){ 2723 return event[4]; 2724 } 2725 /** 2726 * @brief Get field network_operator_name from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 2727 * @param event packet 2728 * @return network_operator_name 2729 * @note: btstack_type 1 2730 */ 2731 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t * event){ 2732 return event[5]; 2733 } 2734 2735 /** 2736 * @brief Get field error from event HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 2737 * @param event packet 2738 * @return error 2739 * @note: btstack_type 1 2740 */ 2741 static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t * event){ 2742 return event[3]; 2743 } 2744 2745 /** 2746 * @brief Get field status from event HFP_SUBEVENT_CODECS_CONNECTION_COMPLETE 2747 * @param event packet 2748 * @return status 2749 * @note: btstack_type 1 2750 */ 2751 static inline uint8_t hfp_subevent_codecs_connection_complete_get_status(const uint8_t * event){ 2752 return event[3]; 2753 } 2754 2755 2756 2757 2758 /** 2759 * @brief Get field number from event HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER 2760 * @param event packet 2761 * @return number 2762 * @note: btstack_type T 2763 */ 2764 static inline const char * hfp_subevent_place_call_with_number_get_number(const uint8_t * event){ 2765 return (const char *) &event[3]; 2766 } 2767 2768 2769 /** 2770 * @brief Get field number from event HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG 2771 * @param event packet 2772 * @return number 2773 * @note: btstack_type T 2774 */ 2775 static inline const char * hfp_subevent_number_for_voice_tag_get_number(const uint8_t * event){ 2776 return (const char *) &event[3]; 2777 } 2778 2779 /** 2780 * @brief Get field dtmf from event HFP_SUBEVENT_TRANSMIT_DTMF_CODES 2781 * @param event packet 2782 * @return dtmf 2783 * @note: btstack_type T 2784 */ 2785 static inline const char * hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t * event){ 2786 return (const char *) &event[3]; 2787 } 2788 2789 2790 2791 2792 /** 2793 * @brief Get field status from event HFP_SUBEVENT_SPEAKER_VOLUME 2794 * @param event packet 2795 * @return status 2796 * @note: btstack_type 1 2797 */ 2798 static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t * event){ 2799 return event[3]; 2800 } 2801 /** 2802 * @brief Get field gain from event HFP_SUBEVENT_SPEAKER_VOLUME 2803 * @param event packet 2804 * @return gain 2805 * @note: btstack_type 1 2806 */ 2807 static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t * event){ 2808 return event[4]; 2809 } 2810 2811 /** 2812 * @brief Get field status from event HFP_SUBEVENT_MICROPHONE_VOLUME 2813 * @param event packet 2814 * @return status 2815 * @note: btstack_type 1 2816 */ 2817 static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t * event){ 2818 return event[3]; 2819 } 2820 /** 2821 * @brief Get field gain from event HFP_SUBEVENT_MICROPHONE_VOLUME 2822 * @param event packet 2823 * @return gain 2824 * @note: btstack_type 1 2825 */ 2826 static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t * event){ 2827 return event[4]; 2828 } 2829 2830 /** 2831 * @brief Get field type from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 2832 * @param event packet 2833 * @return type 2834 * @note: btstack_type 1 2835 */ 2836 static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t * event){ 2837 return event[3]; 2838 } 2839 /** 2840 * @brief Get field number from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 2841 * @param event packet 2842 * @return number 2843 * @note: btstack_type T 2844 */ 2845 static inline const char * hfp_subevent_call_waiting_notification_get_number(const uint8_t * event){ 2846 return (const char *) &event[4]; 2847 } 2848 2849 /** 2850 * @brief Get field type from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 2851 * @param event packet 2852 * @return type 2853 * @note: btstack_type 1 2854 */ 2855 static inline uint8_t hfp_subevent_calling_line_indetification_notification_get_type(const uint8_t * event){ 2856 return event[3]; 2857 } 2858 /** 2859 * @brief Get field number from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 2860 * @param event packet 2861 * @return number 2862 * @note: btstack_type T 2863 */ 2864 static inline const char * hfp_subevent_calling_line_indetification_notification_get_number(const uint8_t * event){ 2865 return (const char *) &event[4]; 2866 } 2867 2868 /** 2869 * @brief Get field clcc_idx from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2870 * @param event packet 2871 * @return clcc_idx 2872 * @note: btstack_type 1 2873 */ 2874 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t * event){ 2875 return event[3]; 2876 } 2877 /** 2878 * @brief Get field clcc_dir from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2879 * @param event packet 2880 * @return clcc_dir 2881 * @note: btstack_type 1 2882 */ 2883 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t * event){ 2884 return event[4]; 2885 } 2886 /** 2887 * @brief Get field clcc_status from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2888 * @param event packet 2889 * @return clcc_status 2890 * @note: btstack_type 1 2891 */ 2892 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t * event){ 2893 return event[5]; 2894 } 2895 /** 2896 * @brief Get field clcc_mpty from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2897 * @param event packet 2898 * @return clcc_mpty 2899 * @note: btstack_type 1 2900 */ 2901 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t * event){ 2902 return event[6]; 2903 } 2904 /** 2905 * @brief Get field bnip_type from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2906 * @param event packet 2907 * @return bnip_type 2908 * @note: btstack_type 1 2909 */ 2910 static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t * event){ 2911 return event[7]; 2912 } 2913 /** 2914 * @brief Get field bnip_number from event HFP_SUBEVENT_ENHANCED_CALL_STATUS 2915 * @param event packet 2916 * @return bnip_number 2917 * @note: btstack_type T 2918 */ 2919 static inline const char * hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t * event){ 2920 return (const char *) &event[8]; 2921 } 2922 2923 /** 2924 * @brief Get field status from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 2925 * @param event packet 2926 * @return status 2927 * @note: btstack_type 1 2928 */ 2929 static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t * event){ 2930 return event[3]; 2931 } 2932 /** 2933 * @brief Get field bnip_type from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 2934 * @param event packet 2935 * @return bnip_type 2936 * @note: btstack_type 1 2937 */ 2938 static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t * event){ 2939 return event[4]; 2940 } 2941 /** 2942 * @brief Get field bnip_number from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 2943 * @param event packet 2944 * @return bnip_number 2945 * @note: btstack_type T 2946 */ 2947 static inline const char * hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t * event){ 2948 return (const char *) &event[5]; 2949 } 2950 2951 /** 2952 * @brief Get field value from event HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS 2953 * @param event packet 2954 * @return value 2955 * @note: btstack_type T 2956 */ 2957 static inline const char * hfp_subevent_response_and_hold_status_get_value(const uint8_t * event){ 2958 return (const char *) &event[3]; 2959 } 2960 2961 #ifdef ENABLE_BLE 2962 /** 2963 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_CONNECTED 2964 * @param event packet 2965 * @return handle 2966 * @note: btstack_type H 2967 */ 2968 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){ 2969 return little_endian_read_16(event, 3); 2970 } 2971 #endif 2972 2973 #ifdef ENABLE_BLE 2974 /** 2975 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 2976 * @param event packet 2977 * @return handle 2978 * @note: btstack_type H 2979 */ 2980 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){ 2981 return little_endian_read_16(event, 3); 2982 } 2983 /** 2984 * @brief Get field attribute_id from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 2985 * @param event packet 2986 * @return attribute_id 2987 * @note: btstack_type 2 2988 */ 2989 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){ 2990 return little_endian_read_16(event, 5); 2991 } 2992 /** 2993 * @brief Get field text from event ANCS_SUBEVENT_CLIENT_NOTIFICATION 2994 * @param event packet 2995 * @return text 2996 * @note: btstack_type T 2997 */ 2998 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){ 2999 return (const char *) &event[7]; 3000 } 3001 #endif 3002 3003 #ifdef ENABLE_BLE 3004 /** 3005 * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_DISCONNECTED 3006 * @param event packet 3007 * @return handle 3008 * @note: btstack_type H 3009 */ 3010 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){ 3011 return little_endian_read_16(event, 3); 3012 } 3013 #endif 3014 3015 3016 3017 /* API_END */ 3018 3019 #if defined __cplusplus 3020 } 3021 #endif 3022 3023 #endif // __BTSTACK_EVENT_H 3024