Loading system/main/shim/acl.cc +17 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,10 @@ class LeShimAclConnection // TODO Issue LeReadRemoteFeatures Command } bluetooth::hci::AddressWithType GetLocalAddressWithType() { return connection_->GetLocalAddress(); } void OnConnectionUpdate(hci::ErrorCode hci_status, uint16_t connection_interval, uint16_t connection_latency, Loading Loading @@ -1041,6 +1045,19 @@ void shim::legacy::Acl::OnClassicLinkDisconnected(HciHandle handle, is_locally_initiated, reason))); } bluetooth::hci::AddressWithType shim::legacy::Acl::GetConnectionLocalAddress( const RawAddress& remote_bda) { bluetooth::hci::AddressWithType address_with_type; auto remote_address = ToGdAddress(remote_bda); for (auto& [handle, connection] : pimpl_->handle_to_le_connection_map_) { if (connection->GetRemoteAddressWithType().GetAddress() == remote_address) { return connection->GetLocalAddressWithType(); } } LOG_WARN("address not found!"); return address_with_type; } void shim::legacy::Acl::OnLeLinkDisconnected(HciHandle handle, hci::ErrorCode reason) { hci::AddressWithType remote_address_with_type = Loading system/main/shim/acl.h +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, std::unique_ptr<hci::acl_manager::LeAclConnection>) override; void OnLeConnectFail(hci::AddressWithType, hci::ErrorCode reason) override; void OnLeLinkDisconnected(uint16_t handle, hci::ErrorCode reason); bluetooth::hci::AddressWithType GetConnectionLocalAddress( const RawAddress& remote_bda); // LinkConnectionInterface void CreateClassicConnection(const hci::Address& address) override; Loading system/main/shim/acl_api.cc +9 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,12 @@ void bluetooth::shim::ACL_Shutdown() { void bluetooth::shim::ACL_IgnoreAllLeConnections() { return Stack::GetInstance()->GetAcl()->ClearAcceptList(); } void bluetooth::shim::ACL_ReadConnectionAddress(const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t* p_addr_type) { auto local_address = Stack::GetInstance()->GetAcl()->GetConnectionLocalAddress(pseudo_addr); conn_addr = ToRawAddress(local_address.GetAddress()); *p_addr_type = static_cast<uint8_t>(local_address.GetAddressType()); } No newline at end of file system/main/shim/acl_api.h +3 −0 Original line number Diff line number Diff line Loading @@ -35,5 +35,8 @@ void ACL_ConfigureLePrivacy(bool is_le_privacy_enabled); void ACL_Shutdown(); void ACL_IgnoreAllLeConnections(); void ACL_ReadConnectionAddress(const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t* p_addr_type); } // namespace shim } // namespace bluetooth system/stack/acl/btm_acl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -2319,6 +2319,10 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda, bluetooth::shim::L2CA_ReadConnectionAddr(remote_bda, local_conn_addr, p_addr_type); return; } else if (bluetooth::shim::is_gd_scanning_enabled()) { bluetooth::shim::ACL_ReadConnectionAddress(remote_bda, local_conn_addr, p_addr_type); return; } tACL_CONN* p_acl = internal_.btm_bda_to_acl(remote_bda, BT_TRANSPORT_LE); Loading Loading
system/main/shim/acl.cc +17 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,10 @@ class LeShimAclConnection // TODO Issue LeReadRemoteFeatures Command } bluetooth::hci::AddressWithType GetLocalAddressWithType() { return connection_->GetLocalAddress(); } void OnConnectionUpdate(hci::ErrorCode hci_status, uint16_t connection_interval, uint16_t connection_latency, Loading Loading @@ -1041,6 +1045,19 @@ void shim::legacy::Acl::OnClassicLinkDisconnected(HciHandle handle, is_locally_initiated, reason))); } bluetooth::hci::AddressWithType shim::legacy::Acl::GetConnectionLocalAddress( const RawAddress& remote_bda) { bluetooth::hci::AddressWithType address_with_type; auto remote_address = ToGdAddress(remote_bda); for (auto& [handle, connection] : pimpl_->handle_to_le_connection_map_) { if (connection->GetRemoteAddressWithType().GetAddress() == remote_address) { return connection->GetLocalAddressWithType(); } } LOG_WARN("address not found!"); return address_with_type; } void shim::legacy::Acl::OnLeLinkDisconnected(HciHandle handle, hci::ErrorCode reason) { hci::AddressWithType remote_address_with_type = Loading
system/main/shim/acl.h +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, std::unique_ptr<hci::acl_manager::LeAclConnection>) override; void OnLeConnectFail(hci::AddressWithType, hci::ErrorCode reason) override; void OnLeLinkDisconnected(uint16_t handle, hci::ErrorCode reason); bluetooth::hci::AddressWithType GetConnectionLocalAddress( const RawAddress& remote_bda); // LinkConnectionInterface void CreateClassicConnection(const hci::Address& address) override; Loading
system/main/shim/acl_api.cc +9 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,12 @@ void bluetooth::shim::ACL_Shutdown() { void bluetooth::shim::ACL_IgnoreAllLeConnections() { return Stack::GetInstance()->GetAcl()->ClearAcceptList(); } void bluetooth::shim::ACL_ReadConnectionAddress(const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t* p_addr_type) { auto local_address = Stack::GetInstance()->GetAcl()->GetConnectionLocalAddress(pseudo_addr); conn_addr = ToRawAddress(local_address.GetAddress()); *p_addr_type = static_cast<uint8_t>(local_address.GetAddressType()); } No newline at end of file
system/main/shim/acl_api.h +3 −0 Original line number Diff line number Diff line Loading @@ -35,5 +35,8 @@ void ACL_ConfigureLePrivacy(bool is_le_privacy_enabled); void ACL_Shutdown(); void ACL_IgnoreAllLeConnections(); void ACL_ReadConnectionAddress(const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t* p_addr_type); } // namespace shim } // namespace bluetooth
system/stack/acl/btm_acl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -2319,6 +2319,10 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda, bluetooth::shim::L2CA_ReadConnectionAddr(remote_bda, local_conn_addr, p_addr_type); return; } else if (bluetooth::shim::is_gd_scanning_enabled()) { bluetooth::shim::ACL_ReadConnectionAddress(remote_bda, local_conn_addr, p_addr_type); return; } tACL_CONN* p_acl = internal_.btm_bda_to_acl(remote_bda, BT_TRANSPORT_LE); Loading