1 /* 2 * Copyright (C) 2014 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 BLUEKITCHEN 24 * GMBH 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 * @title Genral Access Profile (GAP) 40 * 41 */ 42 43 #ifndef GAP_H 44 #define GAP_H 45 46 #if defined __cplusplus 47 extern "C" { 48 #endif 49 50 #include "btstack_defines.h" 51 #include "btstack_util.h" 52 53 #ifdef ENABLE_CLASSIC 54 #include "classic/btstack_link_key_db.h" 55 #endif 56 57 // BIG has up to 2 BIS (stereo) 58 #ifndef MAX_NR_BIS 59 #define MAX_NR_BIS 2 60 #endif 61 62 typedef enum { 63 64 // MITM protection not required 65 // No encryption required 66 // No user interaction required 67 LEVEL_0 = 0, 68 69 // MITM protection not required 70 // No encryption required 71 // Minimal user interaction desired 72 LEVEL_1, 73 74 // MITM protection not required 75 // Encryption required 76 LEVEL_2, 77 78 // MITM protection required 79 // Encryption required 80 // User interaction acceptable 81 LEVEL_3, 82 83 // MITM protection required 84 // Encryption required 85 // 128-bit equivalent strength for link and encryption keys required (P-192 is not enough) 86 // User interaction acceptable 87 LEVEL_4, 88 } gap_security_level_t; 89 90 91 typedef enum { 92 // non-secure 93 GAP_SECURITY_MODE_1 = 1, 94 95 // service level enforced security 96 GAP_SECURITY_MODE_2, 97 98 // link level enforced security 99 GAP_SECURITY_MODE_3, 100 101 // service level enforced security 102 GAP_SECURITY_MODE_4 103 } gap_security_mode_t; 104 105 typedef enum { 106 GAP_SECURITY_NONE, 107 GAP_SECURITY_ENCRYPTED, // SSP: JUST WORKS 108 GAP_SECURITY_AUTHENTICATED, // SSP: numeric comparison, passkey, OOB 109 // GAP_SECURITY_AUTHORIZED 110 } gap_security_state; 111 112 typedef enum { 113 GAP_CONNECTION_INVALID, 114 GAP_CONNECTION_ACL, 115 GAP_CONNECTION_SCO, 116 GAP_CONNECTION_LE 117 } gap_connection_type_t; 118 119 typedef struct le_connection_parameter_range{ 120 uint16_t le_conn_interval_min; 121 uint16_t le_conn_interval_max; 122 uint16_t le_conn_latency_min; 123 uint16_t le_conn_latency_max; 124 uint16_t le_supervision_timeout_min; 125 uint16_t le_supervision_timeout_max; 126 } le_connection_parameter_range_t; 127 128 typedef enum { 129 GAP_RANDOM_ADDRESS_TYPE_OFF = 0, 130 GAP_RANDOM_ADDRESS_TYPE_STATIC, 131 GAP_RANDOM_ADDRESS_NON_RESOLVABLE, 132 GAP_RANDOM_ADDRESS_RESOLVABLE, 133 } gap_random_address_type_t; 134 135 // Authorization state 136 typedef enum { 137 AUTHORIZATION_UNKNOWN, 138 AUTHORIZATION_PENDING, 139 AUTHORIZATION_DECLINED, 140 AUTHORIZATION_GRANTED 141 } authorization_state_t; 142 143 // Extended Advertising Parameters 144 typedef struct { 145 uint16_t advertising_event_properties; 146 uint16_t primary_advertising_interval_min; 147 uint16_t primary_advertising_interval_max; 148 uint8_t primary_advertising_channel_map; 149 bd_addr_type_t own_address_type; 150 bd_addr_type_t peer_address_type; 151 bd_addr_t peer_address; 152 uint8_t advertising_filter_policy; 153 int8_t advertising_tx_power; 154 uint8_t primary_advertising_phy; 155 uint8_t secondary_advertising_max_skip; 156 uint8_t secondary_advertising_phy; 157 uint8_t advertising_sid; 158 uint8_t scan_request_notification_enable; 159 } le_extended_advertising_parameters_t; 160 161 typedef struct { 162 uint16_t periodic_advertising_interval_min; 163 uint16_t periodic_advertising_interval_max; 164 uint16_t periodic_advertising_properties; 165 } le_periodic_advertising_parameters_t; 166 167 // Extended Advertising Set State 168 typedef struct { 169 btstack_linked_item_t item; 170 le_extended_advertising_parameters_t extended_params; 171 le_periodic_advertising_parameters_t periodic_params; 172 bd_addr_t random_address; 173 const uint8_t * adv_data; 174 const uint8_t * scan_data; 175 const uint8_t * periodic_data; 176 uint16_t adv_data_len; 177 uint16_t scan_data_len; 178 uint16_t periodic_data_len; 179 uint16_t adv_data_pos; 180 uint16_t scan_data_pos; 181 uint16_t periodic_data_pos; 182 uint16_t enable_timeout; 183 uint8_t advertising_handle; 184 uint8_t enable_max_scan_events; 185 bool periodic_include_adi; 186 uint8_t state; 187 uint8_t tasks; 188 } le_advertising_set_t; 189 190 // Isochronous Streams 191 192 // -- Broadcast Isochronous Group BIG 193 194 typedef struct { 195 uint8_t big_handle; 196 uint8_t advertising_handle; 197 uint8_t num_bis; 198 uint32_t sdu_interval_us; 199 uint16_t max_sdu; 200 uint16_t max_transport_latency_ms; 201 uint8_t rtn; 202 uint8_t phy; 203 uint8_t packing; 204 uint8_t framing; 205 uint8_t encryption; 206 uint8_t broadcast_code[16]; 207 } le_audio_big_params_t; 208 209 typedef struct { 210 uint8_t big_handle; 211 uint8_t sync_handle; 212 uint8_t encryption; 213 uint8_t broadcast_code[16]; 214 uint8_t mse; 215 uint16_t big_sync_timeout_10ms; 216 uint8_t num_bis; 217 uint8_t bis_indices[MAX_NR_BIS]; 218 } le_audio_big_sync_params_t; 219 220 typedef enum { 221 LE_AUDIO_BIG_STATE_CREATE, 222 LE_AUDIO_BIG_STATE_W4_ESTABLISHED, 223 LE_AUDIO_BIG_STATE_SETUP_ISO_PATH, 224 LE_AUDIO_BIG_STATE_W4_SETUP_ISO_PATH, 225 LE_AUDIO_BIG_STATE_W4_SETUP_ISO_PATH_THEN_TERMINATE, 226 LE_AUDIO_BIG_STATE_SETUP_ISO_PATHS_FAILED, 227 LE_AUDIO_BIG_STATE_ACTIVE, 228 LE_AUDIO_BIG_STATE_TERMINATE, 229 LE_AUDIO_BIG_STATE_W4_TERMINATED_AFTER_SETUP_FAILED, 230 LE_AUDIO_BIG_STATE_W4_TERMINATED, 231 } le_audio_big_state_t; 232 233 typedef struct { 234 btstack_linked_item_t item; 235 uint8_t big_handle; 236 le_audio_big_state_t state; 237 union { 238 uint8_t next_bis; 239 uint8_t status; 240 } state_vars; 241 uint8_t num_bis; 242 hci_con_handle_t bis_con_handles[MAX_NR_BIS]; 243 const le_audio_big_params_t * params; 244 // request to send 245 bool can_send_now_requested; 246 // previous and current timestamp of number completed event to track ISO intervals 247 bool num_completed_timestamp_previous_valid; 248 bool num_completed_timestamp_current_valid; 249 uint32_t num_completed_timestamp_previous_ms; 250 uint32_t num_completed_timestamp_current_ms; 251 252 } le_audio_big_t; 253 254 typedef struct { 255 btstack_linked_item_t item; 256 uint8_t big_handle; 257 le_audio_big_state_t state; 258 union { 259 uint8_t next_bis; 260 uint8_t status; 261 } state_vars; 262 uint8_t num_bis; 263 hci_con_handle_t bis_con_handles[MAX_NR_BIS]; 264 const le_audio_big_sync_params_t * params; 265 } le_audio_big_sync_t; 266 267 /* API_START */ 268 269 // Classic + LE 270 271 /** 272 * @brief Read RSSI 273 * @param con_handle 274 * @events: GAP_EVENT_RSSI_MEASUREMENT 275 */ 276 int gap_read_rssi(hci_con_handle_t con_handle); 277 278 279 /** 280 * @brief Gets local address. 281 */ 282 void gap_local_bd_addr(bd_addr_t address_buffer); 283 284 /** 285 * @brief Disconnect connection with handle 286 * @param handle 287 */ 288 uint8_t gap_disconnect(hci_con_handle_t handle); 289 290 /** 291 * @brief Get connection type 292 * @param con_handle 293 * @result connection_type 294 */ 295 gap_connection_type_t gap_get_connection_type(hci_con_handle_t connection_handle); 296 297 /** 298 * @brief Get HCI connection role 299 * @param con_handle 300 * @result hci_role_t HCI_ROLE_MASTER / HCI_ROLE_SLAVE / HCI_ROLE_INVALID (if connection does not exist) 301 */ 302 hci_role_t gap_get_role(hci_con_handle_t connection_handle); 303 304 // Classic 305 306 /** 307 * @brief Request role switch 308 * @note this only requests the role switch. A HCI_EVENT_ROLE_CHANGE is emitted and its status field will indicate if the switch was succesful 309 * @param addr 310 * @param hci_role_t HCI_ROLE_MASTER / HCI_ROLE_SLAVE 311 * @result status 312 */ 313 uint8_t gap_request_role(const bd_addr_t addr, hci_role_t role); 314 315 /** 316 * @brief Sets local name. 317 * @note Default name is 'BTstack 00:00:00:00:00:00' 318 * @note '00:00:00:00:00:00' in local_name will be replaced with actual bd addr 319 * @param name is not copied, make sure memory stays valid 320 */ 321 void gap_set_local_name(const char * local_name); 322 323 /** 324 * @brief Set Extended Inquiry Response data 325 * @note If not set, local name will be used for EIR data (see gap_set_local_name) 326 * @note '00:00:00:00:00:00' in local_name will be replaced with actual bd addr 327 * @param eir_data size HCI_EXTENDED_INQUIRY_RESPONSE_DATA_LEN (240) bytes, is not copied make sure memory stays valid 328 */ 329 void gap_set_extended_inquiry_response(const uint8_t * data); 330 331 /** 332 * @brief Set class of device 333 */ 334 void gap_set_class_of_device(uint32_t class_of_device); 335 336 /** 337 * @brief Set default link policy settings for all classic ACL links 338 * @param default_link_policy_settings - see LM_LINK_POLICY_* in bluetooth.h 339 * @note common value: LM_LINK_POLICY_ENABLE_ROLE_SWITCH | LM_LINK_POLICY_ENABLE_SNIFF_MODE to enable role switch and sniff mode 340 */ 341 void gap_set_default_link_policy_settings(uint16_t default_link_policy_settings); 342 343 /** 344 * @brief Set Allow Role Switch param for outgoing classic ACL links 345 * @param allow_role_switch - true: allow remote device to request role switch, false: stay master 346 */ 347 void gap_set_allow_role_switch(bool allow_role_switch); 348 349 /** 350 * @brief Set link supervision timeout for outgoing classic ACL links 351 * @param default_link_supervision_timeout * 0.625 ms, default 0x7d00 = 20 seconds, 0 = no link supervision timeout 352 */ 353 void gap_set_link_supervision_timeout(uint16_t link_supervision_timeout); 354 355 /** 356 * @brief Enable link watchdog. If no ACL packet is sent within timeout_ms, the link will get disconnected 357 * note: current implementation uses the automatic flush timeout controller feature with a max timeout of 1.28s 358 * @param timeout_ms 359 */ 360 void gap_enable_link_watchdog(uint16_t timeout_ms); 361 362 /** 363 * @brief Enable/disable bonding. Default is enabled. 364 * @param enabled 365 */ 366 void gap_set_bondable_mode(int enabled); 367 368 /** 369 * @brief Get bondable mode. 370 * @return 1 if bondable 371 */ 372 int gap_get_bondable_mode(void); 373 374 /** 375 * @brief Set security mode for all outgoing and incoming connections. Default: GAP_SECURITY_MODE_4 376 * @param security_mode is GAP_SECURITY_MODE_2 or GAP_SECURITY_MODE_4 377 * @return status ERROR_CODE_SUCCESS or ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 378 */ 379 uint8_t gap_set_security_mode(gap_security_mode_t security_mode); 380 381 /** 382 * @brief Get security mode 383 * @return security_mode 384 */ 385 gap_security_mode_t gap_get_security_mode(void); 386 387 /** 388 * @brief Set security level for all outgoing and incoming connections. Default: LEVEL_2 389 * @param security_level 390 * @note has to be called before services or profiles are initialized 391 */ 392 void gap_set_security_level(gap_security_level_t security_level); 393 394 /** 395 * @brief Get security level 396 * @return security_level 397 */ 398 gap_security_level_t gap_get_security_level(void); 399 400 /** 401 * @brief Set Secure Connections Only Mode for BR/EDR (Classic) Default: false 402 * @param enable 403 */ 404 void gap_set_secure_connections_only_mode(bool enable); 405 406 /** 407 * @breif Get Secure Connections Only Mode 408 * @param enabled 409 */ 410 bool gap_get_secure_connections_only_mode(void); 411 412 /** 413 * @brief Set minimal security level for registered services 414 * @param security_level 415 * @note Called by L2CAP based on registered services 416 */ 417 void gap_set_minimal_service_security_level(gap_security_level_t security_level); 418 419 /** 420 * @brief Register filter for rejecting classic connections. Callback will return 1 accept connection, 0 on reject. 421 */ 422 void gap_register_classic_connection_filter(int (*accept_callback)(bd_addr_t addr, hci_link_type_t link_type)); 423 424 /* Configure Secure Simple Pairing */ 425 426 /** 427 * @brief Enable will enable SSP during init. Default: true 428 */ 429 void gap_ssp_set_enable(int enable); 430 431 /** 432 * @brief Set IO Capability. BTstack will return capability to SSP requests 433 */ 434 void gap_ssp_set_io_capability(int ssp_io_capability); 435 436 /** 437 * @brief Set Authentication Requirements using during SSP 438 */ 439 void gap_ssp_set_authentication_requirement(int authentication_requirement); 440 441 /** 442 * @brief Enable/disable Secure Connections. Default: true if supported by Controller 443 */ 444 void gap_secure_connections_enable(bool enable); 445 446 /** 447 * @brief Query if Secure Connections can be used for Classic connections. 448 * @note Requires gap_secure_connections_enable == true and Controller to support it 449 */ 450 bool gap_secure_connections_active(void); 451 452 /** 453 * @brief If set, BTstack will confirm a numeric comparison and enter '000000' if requested. 454 */ 455 void gap_ssp_set_auto_accept(int auto_accept); 456 457 /** 458 * @brief Set required encryption key size for GAP Levels 1-3 on ccassic connections. Default: 16 bytes 459 * @param encryption_key_size in bytes. Valid 7..16 460 */ 461 void gap_set_required_encryption_key_size(uint8_t encryption_key_size); 462 463 /** 464 * @brief Start dedicated bonding with device. Disconnect after bonding. 465 * @param device 466 * @param request MITM protection 467 * @return error, if max num acl connections active 468 * @result GAP_DEDICATED_BONDING_COMPLETE 469 */ 470 int gap_dedicated_bonding(bd_addr_t device, int mitm_protection_required); 471 472 gap_security_level_t gap_security_level_for_link_key_type(link_key_type_t link_key_type); 473 474 /** 475 * @brief map link keys to secure connection yes/no 476 */ 477 bool gap_secure_connection_for_link_key_type(link_key_type_t link_key_type); 478 479 /** 480 * @brief map link keys to authenticated 481 */ 482 bool gap_authenticated_for_link_key_type(link_key_type_t link_key_type); 483 484 gap_security_level_t gap_security_level(hci_con_handle_t con_handle); 485 486 void gap_request_security_level(hci_con_handle_t con_handle, gap_security_level_t level); 487 488 bool gap_mitm_protection_required_for_security_level(gap_security_level_t level); 489 490 /** 491 * @brief Set Page Scan Type 492 * @param page_scan_interval * 0.625 ms, range: 0x0012..0x1000, default: 0x0800 493 * @param page_scan_windows * 0.625 ms, range: 0x0011..page_scan_interval, default: 0x0012 494 */ 495 void gap_set_page_scan_activity(uint16_t page_scan_interval, uint16_t page_scan_window); 496 497 /** 498 * @brief Set Page Scan Type 499 * @param page_scan_mode 500 */ 501 void gap_set_page_scan_type(page_scan_type_t page_scan_type); 502 503 /** 504 * @brief Set Page Timeout 505 * @param page_timeout * 0.625 ms, range: 0x0001..0xffff, default: 0x6000 (ca 15 seconds) 506 */ 507 void gap_set_page_timeout(uint16_t page_timeout); 508 509 // LE 510 511 /** 512 * @brief Set parameters for LE Scan 513 * @param scan_type 0 = passive, 1 = active 514 * @param scan_interval range 0x0004..0x4000, unit 0.625 ms 515 * @param scan_window range 0x0004..0x4000, unit 0.625 ms 516 * @param scanning_filter_policy 0 = all devices, 1 = all from whitelist 517 */ 518 void gap_set_scan_params(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window, uint8_t scanning_filter_policy); 519 520 /** 521 * @brief Set parameters for LE Scan 522 * @deprecated Use gap_set_scan_params instead 523 */ 524 void gap_set_scan_parameters(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window); 525 526 /** 527 * @brief Start LE Scan 528 */ 529 void gap_start_scan(void); 530 531 /** 532 * @brief Stop LE Scan 533 */ 534 void gap_stop_scan(void); 535 536 /** 537 * @brief Enable privacy by using random addresses 538 * @param random_address_type to use (incl. OFF) 539 */ 540 void gap_random_address_set_mode(gap_random_address_type_t random_address_type); 541 542 /** 543 * @brief Get privacy mode 544 */ 545 gap_random_address_type_t gap_random_address_get_mode(void); 546 547 /** 548 * @brief Sets update period for random address 549 * @param period_ms in ms 550 */ 551 void gap_random_address_set_update_period(int period_ms); 552 553 /** 554 * @brief Sets a fixed random address for advertising 555 * @param addr 556 * @note Sets random address mode to type off 557 */ 558 void gap_random_address_set(const bd_addr_t addr); 559 560 /** 561 * @brief Set Advertisement Data 562 * @param advertising_data_length 563 * @param advertising_data (max 31 octets) 564 * @note data is not copied, pointer has to stay valid 565 * @note '00:00:00:00:00:00' in advertising_data will be replaced with actual bd addr 566 */ 567 void gap_advertisements_set_data(uint8_t advertising_data_length, uint8_t * advertising_data); 568 569 /** 570 * @brief Set Advertisement Parameters 571 * @param adv_int_min 572 * @param adv_int_max 573 * @param adv_type 574 * @param direct_address_type 575 * @param direct_address 576 * @param channel_map 577 * @param filter_policy 578 * @note own_address_type is used from gap_random_address_set_mode 579 */ 580 void gap_advertisements_set_params(uint16_t adv_int_min, uint16_t adv_int_max, uint8_t adv_type, 581 uint8_t direct_address_typ, bd_addr_t direct_address, uint8_t channel_map, uint8_t filter_policy); 582 583 /** 584 * @brief Enable/Disable Advertisements. OFF by default. 585 * @param enabled 586 */ 587 void gap_advertisements_enable(int enabled); 588 589 /** 590 * @brief Set Scan Response Data 591 * 592 * @note For scan response data, scannable undirected advertising (ADV_SCAN_IND) need to be used 593 * 594 * @param advertising_data_length 595 * @param advertising_data (max 31 octets) 596 * @note data is not copied, pointer has to stay valid 597 * @note '00:00:00:00:00:00' in scan_response_data will be replaced with actual bd addr 598 */ 599 void gap_scan_response_set_data(uint8_t scan_response_data_length, uint8_t * scan_response_data); 600 601 /** 602 * @brief Provide storage for new advertising set and setup on Controller 603 * @param storage to use by stack, needs to stay valid until adv set is removed with gap_extended_advertising_remove 604 * @param advertising_parameters 605 * @param out_advertising_handle to use with other adv config commands 606 * @return status 607 * @events: GAP_SUBEVENT_ADVERTISING_SET_INSTALLED 608 */ 609 uint8_t gap_extended_advertising_setup(le_advertising_set_t * storage, const le_extended_advertising_parameters_t * advertising_parameters, uint8_t * out_advertising_handle); 610 611 /** 612 * @param Set advertising params for advertising set 613 * @param advertising_handle 614 * @param advertising_parameters 615 * @return status 616 */ 617 uint8_t gap_extended_advertising_set_params(uint8_t advertising_handle, const le_extended_advertising_parameters_t * advertising_parameters); 618 619 /** 620 * @param Get advertising params for advertising set, e.g. to update params 621 * @param advertising_handle 622 * @param advertising_parameters 623 * @return status 624 */ 625 uint8_t gap_extended_advertising_get_params(uint8_t advertising_handle, le_extended_advertising_parameters_t * advertising_parameters); 626 627 /** 628 * @param Set periodic advertising params for advertising set 629 * @param advertising_handle 630 * @param advertising_parameters 631 * @return status 632 */ 633 uint8_t gap_periodic_advertising_set_params(uint8_t advertising_handle, const le_periodic_advertising_parameters_t * advertising_parameters); 634 635 /** 636 * @param Get params for periodic advertising set, e.g. to update params 637 * @param advertising_handle 638 * @param advertising_parameters 639 * @return status 640 */ 641 uint8_t gap_periodic_advertising_get_params(uint8_t advertising_handle, le_periodic_advertising_parameters_t * advertising_parameters); 642 643 /** 644 * @param Set random addrress for advertising set 645 * @param advertising_handle 646 * @param random_address 647 * @return status 648 */ 649 uint8_t gap_extended_advertising_set_random_address(uint8_t advertising_handle, bd_addr_t random_address); 650 651 /** 652 * @brief Set Advertising Data for a advertisement set 653 * @param advertising_handle 654 * @param advertising_data_length 655 * @param advertising_data 656 * @return status 657 */ 658 uint8_t gap_extended_advertising_set_adv_data(uint8_t advertising_handle, uint16_t advertising_data_length, const uint8_t * advertising_data); 659 660 /** 661 * @brief Set Scan Response Data for a advertisement set 662 * @param advertising_handle 663 * @param scan_response_data_length 664 * @param scan_response_data 665 * @return status 666 */ 667 uint8_t gap_extended_advertising_set_scan_response_data(uint8_t advertising_handle, uint16_t scan_response_data_length, const uint8_t * scan_response_data); 668 669 /** 670 * @brief Set data for periodic advertisement set 671 * @param advertising_handle 672 * @param periodic_data_length 673 * @param periodic_data 674 * @return status 675 */ 676 uint8_t gap_periodic_advertising_set_data(uint8_t advertising_handle, uint16_t periodic_data_length, const uint8_t * periodic_data); 677 678 /** 679 * @brief Start advertising advertising set 680 * @param advertising_handle 681 * @param timeout in 10ms, or 0 == no timeout 682 * @param num_extended_advertising_events Controller shall send, or 0 == no max number 683 * @return status 684 */ 685 uint8_t gap_extended_advertising_start(uint8_t advertising_handle, uint16_t timeout, uint8_t num_extended_advertising_events); 686 687 /** 688 * @brief Stop advertising 689 * @param advertising_handle 690 * @return status 691 */ 692 uint8_t gap_extended_advertising_stop(uint8_t advertising_handle); 693 694 /** 695 * @brief Start periodic advertising for given advertising set 696 * @param advertising_handle 697 * @param include_adi 698 * @return status 699 */ 700 uint8_t gap_periodic_advertising_start(uint8_t advertising_handle, bool include_adi); 701 702 /** 703 * @brief Stop periodic advertising for given advertising set 704 * @param advertising_handle 705 * @return status 706 */ 707 uint8_t gap_periodic_advertising_stop(uint8_t advertising_handle); 708 709 /** 710 * @brief Remove advertising set from Controller 711 * @param advertising_handle 712 * @return status 713 * @events GAP_SUBEVENT_ADVERTISING_SET_REMOVED 714 */ 715 uint8_t gap_extended_advertising_remove(uint8_t advertising_handle); 716 717 /** 718 * @brief Create Broadcast Isochronous Group (BIG) 719 * @param storage to use by stack, needs to stay valid until adv set is removed with gap_big_terminate 720 * @param big_params 721 * @return status 722 * @events GAP_SUBEVENT_BIG_CREATED unless interrupted by call to gap_big_terminate 723 */ 724 uint8_t gap_big_create(le_audio_big_t * storage, le_audio_big_params_t * big_params); 725 726 /** 727 * @brief Terminate Broadcast Isochronous Group (BIG) 728 * @param big_handle 729 * @return status 730 * @events: GAP_SUBEVENT_BIG_TERMINATED 731 */ 732 uint8_t gap_big_terminate(uint8_t big_handle); 733 734 /** 735 * @brief Synchronize to Broadcast Isochronous Group (BIG) 736 * @param storage to use by stack, needs to stay valid until adv set is removed with gap_big_terminate 737 * @param big_sync_params 738 * @return status 739 * @events GAP_SUBEVENT_BIG_SYNC_CREATED unless interrupted by call to gap_big_sync_terminate 740 */ 741 uint8_t gap_big_sync_create(le_audio_big_sync_t * storage, le_audio_big_sync_params_t * big_sync_params); 742 743 /** 744 * @brief Stop synchronizing to Broadcast Isochronous Group (BIG). Triggers GAP_SUBEVENT_BIG_SYNC_STOPPED 745 * @note Also used to stop synchronizing before BIG Sync was established 746 * @param big_handle 747 * @return status 748 * @events GAP_SUBEVENT_BIG_SYNC_STOPPED 749 */ 750 uint8_t gap_big_sync_terminate(uint8_t big_handle); 751 752 /** 753 * @brief Set connection parameters for outgoing connections 754 * @param conn_scan_interval (unit: 0.625 msec), default: 60 ms 755 * @param conn_scan_window (unit: 0.625 msec), default: 30 ms 756 * @param conn_interval_min (unit: 1.25ms), default: 10 ms 757 * @param conn_interval_max (unit: 1.25ms), default: 30 ms 758 * @param conn_latency, default: 4 759 * @param supervision_timeout (unit: 10ms), default: 720 ms 760 * @param min_ce_length (unit: 0.625ms), default: 10 ms 761 * @param max_ce_length (unit: 0.625ms), default: 30 ms 762 */ 763 void gap_set_connection_parameters(uint16_t conn_scan_interval, uint16_t conn_scan_window, 764 uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, 765 uint16_t supervision_timeout, uint16_t min_ce_length, uint16_t max_ce_length); 766 767 /** 768 * @brief Request an update of the connection parameter for a given LE connection 769 * @param handle 770 * @param conn_interval_min (unit: 1.25ms) 771 * @param conn_interval_max (unit: 1.25ms) 772 * @param conn_latency 773 * @param supervision_timeout (unit: 10ms) 774 * @return 0 if ok 775 */ 776 int gap_request_connection_parameter_update(hci_con_handle_t con_handle, uint16_t conn_interval_min, 777 uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout); 778 779 /** 780 * @brief Updates the connection parameters for a given LE connection 781 * @param handle 782 * @param conn_interval_min (unit: 1.25ms) 783 * @param conn_interval_max (unit: 1.25ms) 784 * @param conn_latency 785 * @param supervision_timeout (unit: 10ms) 786 * @return 0 if ok 787 */ 788 int gap_update_connection_parameters(hci_con_handle_t con_handle, uint16_t conn_interval_min, 789 uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout); 790 791 /** 792 * @brief Set accepted connection parameter range 793 * @param range 794 */ 795 void gap_get_connection_parameter_range(le_connection_parameter_range_t * range); 796 797 /** 798 * @brief Get accepted connection parameter range 799 * @param range 800 */ 801 void gap_set_connection_parameter_range(le_connection_parameter_range_t * range); 802 803 /** 804 * @brief Test if connection parameters are inside in existing rage 805 * @param conn_interval_min (unit: 1.25ms) 806 * @param conn_interval_max (unit: 1.25ms) 807 * @param conn_latency 808 * @param supervision_timeout (unit: 10ms) 809 * @return 1 if included 810 */ 811 int gap_connection_parameter_range_included(le_connection_parameter_range_t * existing_range, uint16_t le_conn_interval_min, uint16_t le_conn_interval_max, uint16_t le_conn_latency, uint16_t le_supervision_timeout); 812 813 /** 814 * @brief Set max number of connections in LE Peripheral role (if Bluetooth Controller supports it) 815 * @note: default: 1 816 * @param max_peripheral_connections 817 */ 818 void gap_set_max_number_peripheral_connections(int max_peripheral_connections); 819 820 /** 821 * @brief Add Device to Whitelist 822 * @param address_typ 823 * @param address 824 * @return 0 if ok 825 */ 826 uint8_t gap_whitelist_add(bd_addr_type_t address_type, const bd_addr_t address); 827 828 /** 829 * @brief Remove Device from Whitelist 830 * @param address_typ 831 * @param address 832 * @return 0 if ok 833 */ 834 uint8_t gap_whitelist_remove(bd_addr_type_t address_type, const bd_addr_t address); 835 836 /** 837 * @brief Clear Whitelist 838 * @return 0 if ok 839 */ 840 uint8_t gap_whitelist_clear(void); 841 842 /** 843 * @brief Connect to remote LE device 844 */ 845 uint8_t gap_connect(const bd_addr_t addr, bd_addr_type_t addr_type); 846 847 /** 848 * @brief Connect with Whitelist 849 * @note Explicit whitelist management and this connect with whitelist replace deprecated gap_auto_connection_* functions 850 * @return - if ok 851 */ 852 uint8_t gap_connect_with_whitelist(void); 853 854 /** 855 * @brief Cancel connection process initiated by gap_connect 856 */ 857 uint8_t gap_connect_cancel(void); 858 859 /** 860 * @brief Auto Connection Establishment - Start Connecting to device 861 * @deprecated Please setup Whitelist with gap_whitelist_* and start connecting with gap_connect_with_whitelist 862 * @param address_type 863 * @param address 864 * @return 0 if ok 865 */ 866 uint8_t gap_auto_connection_start(bd_addr_type_t address_type, const bd_addr_t address); 867 868 /** 869 * @brief Auto Connection Establishment - Stop Connecting to device 870 * @deprecated Please setup Whitelist with gap_whitelist_* and start connecting with gap_connect_with_whitelist 871 * @param address_type 872 * @param address 873 * @return 0 if ok 874 */ 875 uint8_t gap_auto_connection_stop(bd_addr_type_t address_type, const bd_addr_t address); 876 877 /** 878 * @brief Auto Connection Establishment - Stop everything 879 * @deprecated Please setup Whitelist with gap_whitelist_* and start connecting with gap_connect_with_whitelist 880 * @note Convenience function to stop all active auto connection attempts 881 */ 882 uint8_t gap_auto_connection_stop_all(void); 883 884 /** 885 * @brief Set LE PHY 886 * @param con_handle 887 * @param all_phys 0 = set rx/tx, 1 = set only rx, 2 = set only tx 888 * @param tx_phys 1 = 1M, 2 = 2M, 4 = Coded 889 * @param rx_phys 1 = 1M, 2 = 2M, 4 = Coded 890 * @param phy_options 0 = no preferred coding for Coded, 1 = S=2 coding (500 kbit), 2 = S=8 coding (125 kbit) 891 * @return 0 if ok 892 */ 893 uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_options); 894 895 /** 896 * @brief Get connection interval 897 * @param con_handle 898 * @return connection interval, otherwise 0 if error 899 */ 900 uint16_t gap_le_connection_interval(hci_con_handle_t con_handle); 901 902 /** 903 * 904 * @brief Get encryption key size. 905 * @param con_handle 906 * @return 0 if not encrypted, 7-16 otherwise 907 */ 908 uint8_t gap_encryption_key_size(hci_con_handle_t con_handle); 909 910 /** 911 * @brief Get authentication property. 912 * @param con_handle 913 * @return 1 if bonded with OOB/Passkey (AND MITM protection) 914 */ 915 bool gap_authenticated(hci_con_handle_t con_handle); 916 917 /** 918 * @brief Get secure connection property 919 * @param con_handle 920 * @return 1 if bonded usiung LE Secure Connections 921 */ 922 bool gap_secure_connection(hci_con_handle_t con_handle); 923 924 /** 925 * @brief Queries authorization state. 926 * @param con_handle 927 * @return authorization_state for the current session 928 */ 929 authorization_state_t gap_authorization_state(hci_con_handle_t con_handle); 930 931 /** 932 * @brief Get bonded property (BR/EDR/LE) 933 * @note LE: has to be called after identity resolving is complete 934 * @param con_handle 935 * @return true if bonded 936 */ 937 bool gap_bonded(hci_con_handle_t con_handle); 938 939 // Classic 940 #ifdef ENABLE_CLASSIC 941 942 /** 943 * @brief Override page scan mode. Page scan mode enabled by l2cap when services are registered 944 * @note Might be used to reduce power consumption while Bluetooth module stays powered but no (new) 945 * connections are expected 946 */ 947 void gap_connectable_control(uint8_t enable); 948 949 /** 950 * @brief Allows to control if device is discoverable. OFF by default. 951 */ 952 void gap_discoverable_control(uint8_t enable); 953 954 /** 955 * @brief Deletes link key for remote device with baseband address. 956 * @param addr 957 * @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per 958 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 959 * power up, this function only works, when the stack is in working state for these ports. 960 */ 961 void gap_drop_link_key_for_bd_addr(bd_addr_t addr); 962 963 /** 964 * @brief Delete all stored link keys 965 * @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per 966 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 967 * power up, this function only works, when the stack is in working state for these ports. 968 */ 969 void gap_delete_all_link_keys(void); 970 971 /** 972 * @brief Store link key for remote device with baseband address 973 * @param addr 974 * @param link_key 975 * @param link_key_type 976 * @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per 977 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 978 * power up, this function only works, when the stack is in working state for these ports. 979 */ 980 void gap_store_link_key_for_bd_addr(bd_addr_t addr, link_key_t link_key, link_key_type_t type); 981 982 /** 983 * @brief Get link for remote device with basband address 984 * @param addr 985 * @param link_key (out) is stored here 986 * @param link_key_type (out) is stored here 987 * @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per 988 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 989 * power up, this function only works, when the stack is in working state for these ports. 990 */ 991 bool gap_get_link_key_for_bd_addr(bd_addr_t addr, link_key_t link_key, link_key_type_t * type); 992 993 /** 994 * @brief Setup Link Key iterator 995 * @param it 996 * @return 1 on success 997 * @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per 998 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 999 * power up, this function only works, when the stack is in working state for these ports. 1000 */ 1001 int gap_link_key_iterator_init(btstack_link_key_iterator_t * it); 1002 1003 /** 1004 * @brief Get next Link Key 1005 * @param it 1006 * @brief addr 1007 * @brief link_key 1008 * @brief type of link key 1009 * @return 1, if valid link key found 1010 * @see note on gap_link_key_iterator_init 1011 */ 1012 int gap_link_key_iterator_get_next(btstack_link_key_iterator_t * it, bd_addr_t bd_addr, link_key_t link_key, link_key_type_t * type); 1013 1014 /** 1015 * @brief Frees resources allocated by iterator_init 1016 * @note Must be called after iteration to free resources 1017 * @param it 1018 * @see note on gap_link_key_iterator_init 1019 */ 1020 void gap_link_key_iterator_done(btstack_link_key_iterator_t * it); 1021 1022 /** 1023 * @brief Start GAP Classic Inquiry 1024 * @param duration in 1.28s units 1025 * @return 0 if ok 1026 * @events: GAP_EVENT_INQUIRY_RESULT, GAP_EVENT_INQUIRY_COMPLETE 1027 */ 1028 int gap_inquiry_start(uint8_t duration_in_1280ms_units); 1029 1030 /** 1031 * @brief Start GAP Classic Periodic Inquiry 1032 * @param duration in 1.28s units 1033 * @param max_period_length between consecutive inquiries in 1.28s units 1034 * @param min_period_length between consecutive inquiries in 1.28s units 1035 * @return 0 if ok 1036 * @events: GAP_EVENT_INQUIRY_RESULT, GAP_EVENT_INQUIRY_COMPLETE 1037 */ 1038 uint8_t gap_inquiry_periodic_start(uint8_t duration, uint16_t max_period_length, uint16_t min_period_length); 1039 1040 /** 1041 * @brief Stop GAP Classic Inquiry (regular or periodic) 1042 * @return 0 if ok 1043 * @events: GAP_EVENT_INQUIRY_COMPLETE 1044 */ 1045 int gap_inquiry_stop(void); 1046 1047 /** 1048 * @brief Set LAP for GAP Classic Inquiry 1049 * @param lap GAP_IAC_GENERAL_INQUIRY (default), GAP_IAC_LIMITED_INQUIRY 1050 */ 1051 void gap_inquiry_set_lap(uint32_t lap); 1052 1053 /** 1054 * @brief Set Inquiry Scan Activity 1055 * @param inquiry_scan_interval range: 0x0012 to 0x1000; only even values are valid, Time = N * 0.625 ms 1056 * @param inquiry_scan_window range: 0x0011 to 0x1000; Time = N * 0.625 ms 1057 */ 1058 void gap_inquiry_set_scan_activity(uint16_t inquiry_scan_interval, uint16_t inquiry_scan_window); 1059 1060 /** 1061 * @brief Remote Name Request 1062 * @param addr 1063 * @param page_scan_repetition_mode 1064 * @param clock_offset only used when bit 15 is set - pass 0 if not known 1065 * @events: HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 1066 */ 1067 int gap_remote_name_request(const bd_addr_t addr, uint8_t page_scan_repetition_mode, uint16_t clock_offset); 1068 1069 /** 1070 * @brief Legacy Pairing Pin Code Response 1071 * @note data is not copied, pointer has to stay valid 1072 * @param addr 1073 * @param pin 1074 * @return 0 if ok 1075 */ 1076 int gap_pin_code_response(const bd_addr_t addr, const char * pin); 1077 1078 /** 1079 * @brief Legacy Pairing Pin Code Response for binary data / non-strings 1080 * @note data is not copied, pointer has to stay valid 1081 * @param addr 1082 * @param pin_data 1083 * @param pin_len 1084 * @return 0 if ok 1085 */ 1086 int gap_pin_code_response_binary(const bd_addr_t addr, const uint8_t * pin_data, uint8_t pin_len); 1087 1088 /** 1089 * @brief Abort Legacy Pairing 1090 * @param addr 1091 * @param pin 1092 * @return 0 if ok 1093 */ 1094 int gap_pin_code_negative(bd_addr_t addr); 1095 1096 /** 1097 * @brief SSP Passkey Response 1098 * @param addr 1099 * @param passkey [0..999999] 1100 * @return 0 if ok 1101 */ 1102 int gap_ssp_passkey_response(const bd_addr_t addr, uint32_t passkey); 1103 1104 /** 1105 * @brief Abort SSP Passkey Entry/Pairing 1106 * @param addr 1107 * @param pin 1108 * @return 0 if ok 1109 */ 1110 int gap_ssp_passkey_negative(const bd_addr_t addr); 1111 1112 /** 1113 * @brief Accept SSP Numeric Comparison 1114 * @param addr 1115 * @param passkey 1116 * @return 0 if ok 1117 */ 1118 int gap_ssp_confirmation_response(const bd_addr_t addr); 1119 1120 /** 1121 * @brief Abort SSP Numeric Comparison/Pairing 1122 * @param addr 1123 * @param pin 1124 * @return 0 if ok 1125 */ 1126 int gap_ssp_confirmation_negative(const bd_addr_t addr); 1127 1128 /** 1129 * @brief Generate new OOB data 1130 * @note OOB data will be provided in GAP_EVENT_LOCAL_OOB_DATA and be used in future pairing procedures 1131 */ 1132 void gap_ssp_generate_oob_data(void); 1133 1134 /** 1135 * @brief Report Remote OOB Data 1136 * @note Pairing Hash and Randomizer are expected in big-endian byte format 1137 * @param bd_addr 1138 * @param c_192 Simple Pairing Hash C derived from P-192 public key 1139 * @param r_192 Simple Pairing Randomizer derived from P-192 public key 1140 * @param c_256 Simple Pairing Hash C derived from P-256 public key 1141 * @param r_256 Simple Pairing Randomizer derived from P-256 public key 1142 */ 1143 uint8_t gap_ssp_remote_oob_data(const bd_addr_t addr, const uint8_t * c_192, const uint8_t * r_192, const uint8_t * c_256, const uint8_t * r_256); 1144 1145 /** 1146 * Send SSP IO Capabilities Reply 1147 * @note IO Capabilities (Negative) Reply is sent automatically unless ENABLE_EXPLICIT_IO_CAPABILITIES_REPLY 1148 * @param addr 1149 * @return 0 if ok 1150 */ 1151 uint8_t gap_ssp_io_capabilities_response(const bd_addr_t addr); 1152 1153 /** 1154 * Send SSP IO Capabilities Negative Reply 1155 * @note IO Capabilities (Negative) Reply is sent automatically unless ENABLE_EXPLICIT_IO_CAPABILITIES_REPLY 1156 * @param addr 1157 * @return 0 if ok 1158 */ 1159 uint8_t gap_ssp_io_capabilities_negative(const bd_addr_t addr); 1160 1161 /** 1162 * Send Link Key Reponse 1163 * @note Link Key (Negative) Reply is sent automatically unless ENABLE_EXPLICIT_LINK_KEY_RESPONSE 1164 * @param addr 1165 * @param link_key 1166 * @param type or INVALID_LINK_KEY if link key not available 1167 * @return 0 if ok 1168 */ 1169 uint8_t gap_send_link_key_response(const bd_addr_t addr, link_key_t link_key, link_key_type_t type); 1170 1171 /** 1172 * @brief Enter Sniff mode 1173 * @param con_handle 1174 * @param sniff_min_interval range: 0x0002 to 0xFFFE; only even values are valid, Time = N * 0.625 ms 1175 * @param sniff_max_interval range: 0x0002 to 0xFFFE; only even values are valid, Time = N * 0.625 ms 1176 * @param sniff_attempt Number of Baseband receive slots for sniff attempt. 1177 * @param sniff_timeout Number of Baseband receive slots for sniff timeout. 1178 @ @return 0 if ok 1179 */ 1180 uint8_t gap_sniff_mode_enter(hci_con_handle_t con_handle, uint16_t sniff_min_interval, uint16_t sniff_max_interval, uint16_t sniff_attempt, uint16_t sniff_timeout); 1181 1182 /** 1183 * @brief Exit Sniff mode 1184 * @param con_handle 1185 @ @return 0 if ok 1186 */ 1187 uint8_t gap_sniff_mode_exit(hci_con_handle_t con_handle); 1188 1189 /** 1190 * @brief Configure Sniff Subrating 1191 * @param con_handle 1192 * @param max_latency range: 0x0002 to 0xFFFE; Time = N * 0.625 ms 1193 * @param min_remote_timeout range: 0x0002 to 0xFFFE; Time = N * 0.625 ms 1194 * @param min_local_timeout range: 0x0002 to 0xFFFE; Time = N * 0.625 ms 1195 @ @return 0 if ok 1196 */ 1197 uint8_t gap_sniff_subrating_configure(hci_con_handle_t con_handle, uint16_t max_latency, uint16_t min_remote_timeout, uint16_t min_local_timeout); 1198 1199 /** 1200 * @Brief Set QoS 1201 * @param con_handle 1202 * @param service_type 1203 * @param token_rate 1204 * @param peak_bandwidth 1205 * @param latency 1206 * @param delay_variation 1207 @ @return 0 if ok 1208 */ 1209 uint8_t gap_qos_set(hci_con_handle_t con_handle, hci_service_type_t service_type, uint32_t token_rate, uint32_t peak_bandwidth, uint32_t latency, uint32_t delay_variation); 1210 1211 #endif 1212 1213 // LE 1214 1215 /** 1216 * @brief Get own addr type and address used for LE for next scan/advertisement/connect operation 1217 */ 1218 void gap_le_get_own_address(uint8_t * addr_type, bd_addr_t addr); 1219 1220 /** 1221 * @brief Get own addr type and address used for LE advertisements (Peripheral) 1222 */ 1223 void gap_le_get_own_advertisements_address(uint8_t * addr_type, bd_addr_t addr); 1224 1225 /** 1226 * @brief Get own addr type and address used for LE connections (Central) 1227 */ 1228 void gap_le_get_own_connection_address(uint8_t * addr_type, bd_addr_t addr); 1229 1230 /** 1231 * @brief Get state of connection re-encryption for bonded devices when in central role 1232 * @note used by gatt_client and att_server to wait for re-encryption 1233 * @param con_handle 1234 * @return 1 if security setup is active 1235 */ 1236 int gap_reconnect_security_setup_active(hci_con_handle_t con_handle); 1237 1238 /** 1239 * @brief Delete bonding information for remote device 1240 * @note On most desktop ports, the LE Device DB uses a TLV and there is one TLV storage per 1241 * Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during 1242 * power up, this function only works, when the stack is in working state for these ports. 1243 * @param address_type 1244 * @param address 1245 */ 1246 void gap_delete_bonding(bd_addr_type_t address_type, bd_addr_t address); 1247 1248 /** 1249 * LE Privacy 1.2 - requires support by Controller and ENABLE_LE_RESOLVING_LIST to be defined 1250 */ 1251 1252 /** 1253 * @brief Load LE Device DB entries into Controller Resolving List to allow filtering on 1254 * bonded devies with resolvable private addresses 1255 * @return EROOR_CODE_SUCCESS if supported by Controller 1256 */ 1257 uint8_t gap_load_resolving_list_from_le_device_db(void); 1258 1259 /** 1260 * @brief Get local persistent IRK 1261 */ 1262 const uint8_t * gap_get_persistent_irk(void); 1263 1264 /* API_END*/ 1265 1266 #if defined __cplusplus 1267 } 1268 #endif 1269 1270 #endif // GAP_H 1271