1 /* 2 * Copyright 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at: 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #pragma once 19 20 #include "stack/btm/security_device_record.h" 21 #include "types/ble_address_with_type.h" 22 #include "types/raw_address.h" 23 24 /******************************************************************************* 25 * 26 * Function btm_ble_init_pseudo_addr 27 * 28 * Description This function is used to initialize pseudo address. 29 * If pseudo address is not available, use dummy address 30 * 31 * Returns true is updated; false otherwise. 32 * 33 ******************************************************************************/ 34 bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec, const RawAddress& new_pseudo_addr); 35 36 /******************************************************************************* 37 * 38 * Function btm_identity_addr_to_random_pseudo 39 * 40 * Description This function map a static BD address to a pseudo random 41 * address in security database. 42 * 43 ******************************************************************************/ 44 bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr, tBLE_ADDR_TYPE* p_addr_type, 45 bool refresh); 46 47 bool btm_identity_addr_to_random_pseudo_from_address_with_type(tBLE_BD_ADDR* address_with_type, 48 bool refresh); 49 50 bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type); 51 52 /* BLE address mapping with CS feature */ 53 bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo, 54 tBLE_ADDR_TYPE* p_identity_addr_type); 55