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