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