#include "stack/include/sco_hci_link_interface.h"
#include "types/raw_address.h"
+void gatt_find_in_device_record(const RawAddress& bd_addr,
+ tBLE_BD_ADDR* address_with_type);
+
struct StackAclBtmAcl {
tACL_CONN* acl_allocate_connection();
tACL_CONN* acl_get_connection_from_handle(uint16_t handle);
.bda = bd_addr,
.type = BLE_ADDR_RANDOM,
};
+ gatt_find_in_device_record(bd_addr, &address_with_type);
+ LOG_DEBUG("Creating le connection to:%s",
+ address_with_type.ToString().c_str());
bluetooth::shim::ACL_CreateLeConnection(address_with_type);
return true;
}
EattExtension::GetInstance()->Stop();
}
+void gatt_find_in_device_record(const RawAddress& bd_addr,
+ tBLE_BD_ADDR* address_with_type) {
+ const tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
+ if (p_dev_rec == nullptr) {
+ return;
+ }
+
+ if (p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
+ if (p_dev_rec->ble.identity_address_with_type.bda.IsEmpty()) {
+ *address_with_type = {.type = p_dev_rec->ble.ble_addr_type,
+ .bda = bd_addr};
+ return;
+ }
+ *address_with_type = p_dev_rec->ble.identity_address_with_type;
+ return;
+ }
+ *address_with_type = {.type = BLE_ADDR_PUBLIC, .bda = bd_addr};
+ return;
+}
+
/*******************************************************************************
*
* Function gatt_connect