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, 35 const RawAddress& new_pseudo_addr); 36 37 /******************************************************************************* 38 * 39 * Function btm_identity_addr_to_random_pseudo 40 * 41 * Description This function map a static BD address to a pseudo random 42 * address in security database. 43 * 44 ******************************************************************************/ 45 bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr, 46 tBLE_ADDR_TYPE* p_addr_type, 47 bool refresh); 48 49 bool btm_identity_addr_to_random_pseudo_from_address_with_type( 50 tBLE_BD_ADDR* address_with_type, bool refresh); 51 52 bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type); 53 54 /* BLE address mapping with CS feature */ 55 bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo, 56 tBLE_ADDR_TYPE* p_identity_addr_type); 57