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