Loading system/main/shim/acl.cc +26 −14 Original line number Diff line number Diff line Loading @@ -563,9 +563,9 @@ void bluetooth::shim::legacy::Acl::WriteData( void bluetooth::shim::legacy::Acl::CreateClassicConnection( const bluetooth::hci::Address& address) { LOG_DEBUG("Initiate the creation of a classic connection %s", address.ToString().c_str()); GetAclManager()->CreateConnection(address); LOG_DEBUG("Connection initiated for classic to remote:%s", PRIVATE_ADDRESS(address)); btm_cb.history_->Push("%-32s: %s classic", "Initiated connection", PRIVATE_ADDRESS(address)); } Loading @@ -573,8 +573,8 @@ void bluetooth::shim::legacy::Acl::CreateClassicConnection( void bluetooth::shim::legacy::Acl::CreateLeConnection( const bluetooth::hci::AddressWithType& address_with_type) { GetAclManager()->CreateLeConnection(address_with_type); LOG_DEBUG("Started Le device to connection %s", address_with_type.ToString().c_str()); LOG_DEBUG("Connection initiated for le connection to remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le", "Initiated connection", PRIVATE_ADDRESS(address_with_type)); } Loading @@ -582,21 +582,23 @@ void bluetooth::shim::legacy::Acl::CreateLeConnection( void bluetooth::shim::legacy::Acl::CancelLeConnection( const bluetooth::hci::AddressWithType& address_with_type) { GetAclManager()->CancelLeConnect(address_with_type); LOG_DEBUG("Canceled le connection %s", address_with_type.ToString().c_str()); LOG_DEBUG("Cancelled le connection to remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le", "Cancelled connection", PRIVATE_ADDRESS(address_with_type)); } void bluetooth::shim::legacy::Acl::OnClassicLinkDisconnected( HciHandle handle, hci::ErrorCode reason) { LOG_DEBUG("Classic link disconnected handle:%hu reason:%s", handle, ErrorCodeText(reason).c_str()); bluetooth::hci::Address remote_address = pimpl_->handle_to_classic_connection_map_[handle]->GetRemoteAddress(); pimpl_->handle_to_classic_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, ToLegacyHciErrorCode(reason)); LOG_DEBUG("Disconnected classic link remote:%s handle:%hu reason:%s", PRIVATE_ADDRESS(remote_address), handle, ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s classic reason:%s", "Disconnected", PRIVATE_ADDRESS(remote_address), ErrorCodeText(reason).c_str()); Loading @@ -604,14 +606,15 @@ void bluetooth::shim::legacy::Acl::OnClassicLinkDisconnected( void bluetooth::shim::legacy::Acl::OnLeLinkDisconnected(HciHandle handle, hci::ErrorCode reason) { LOG_DEBUG("Le link disconnected handle:%hu reason:%s", handle, ErrorCodeText(reason).c_str()); hci::AddressWithType remote_address_with_type = pimpl_->handle_to_le_connection_map_[handle]->GetRemoteAddressWithType(); pimpl_->handle_to_le_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, ToLegacyHciErrorCode(reason)); LOG_DEBUG("Disconnected le link remote:%s handle:%hu reason:%s", PRIVATE_ADDRESS(remote_address_with_type), handle, ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s le reason:%s", "Disconnected", PRIVATE_ADDRESS(remote_address_with_type), ErrorCodeText(reason).c_str()); Loading @@ -622,7 +625,8 @@ void bluetooth::shim::legacy::Acl::OnConnectSuccess( ASSERT(connection != nullptr); auto handle = connection->GetHandle(); bool locally_initiated = connection->locally_initiated_; const RawAddress bd_addr = ToRawAddress(connection->GetAddress()); const hci::Address remote_address = connection->GetAddress(); const RawAddress bd_addr = ToRawAddress(remote_address); pimpl_->handle_to_classic_connection_map_.emplace( handle, Loading @@ -637,8 +641,12 @@ void bluetooth::shim::legacy::Acl::OnConnectSuccess( TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_connected, bd_addr, handle, HCI_SUCCESS, false); LOG_DEBUG("Connection successful classic remote:%s handle:%hu initiator:%s", PRIVATE_ADDRESS(remote_address), handle, (locally_initiated) ? "local" : "remote"); btm_cb.history_->Push( "%-32s: %s %s classic", "Connection successful", PRIVATE_ADDRESS(bd_addr), "%-32s: %s %s classic", "Connection successful", PRIVATE_ADDRESS(remote_address), (locally_initiated) ? "Local initiated" : "Remote initiated"); } Loading @@ -647,8 +655,8 @@ void bluetooth::shim::legacy::Acl::OnConnectFail(hci::Address address, const RawAddress bd_addr = ToRawAddress(address); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_failed, bd_addr, kInvalidHciHandle, HCI_SUCCESS, false); LOG_WARN("Classic ACL connection failed peer:%s reason:%s", address.ToString().c_str(), hci::ErrorCodeText(reason).c_str()); LOG_WARN("Connection failed classic remote:%s reason:%s", PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s classic reason:%s", "Connection failed", PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str()); Loading Loading @@ -690,6 +698,9 @@ void bluetooth::shim::legacy::Acl::OnLeConnectSuccess( handle, static_cast<uint8_t>(connection_role), conn_interval, conn_latency, conn_timeout, local_rpa, peer_rpa, peer_addr_type); LOG_DEBUG("Connection successful le remote:%s handle:%hu initiator:%s", PRIVATE_ADDRESS(address_with_type), handle, (locally_initiated) ? "local" : "remote"); btm_cb.history_->Push( "%-32s: %s %s le", "Connection successful", PRIVATE_ADDRESS(address_with_type), Loading @@ -707,7 +718,8 @@ void bluetooth::shim::legacy::Acl::OnLeConnectFail( TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, legacy_address_with_type, handle, enhanced, status); LOG_WARN("Le ACL failed peer:%s", address_with_type.ToString().c_str()); LOG_WARN("Connection failed le remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le reason:%s", "Connection failed", PRIVATE_ADDRESS(address_with_type), hci::ErrorCodeText(reason).c_str()); Loading Loading
system/main/shim/acl.cc +26 −14 Original line number Diff line number Diff line Loading @@ -563,9 +563,9 @@ void bluetooth::shim::legacy::Acl::WriteData( void bluetooth::shim::legacy::Acl::CreateClassicConnection( const bluetooth::hci::Address& address) { LOG_DEBUG("Initiate the creation of a classic connection %s", address.ToString().c_str()); GetAclManager()->CreateConnection(address); LOG_DEBUG("Connection initiated for classic to remote:%s", PRIVATE_ADDRESS(address)); btm_cb.history_->Push("%-32s: %s classic", "Initiated connection", PRIVATE_ADDRESS(address)); } Loading @@ -573,8 +573,8 @@ void bluetooth::shim::legacy::Acl::CreateClassicConnection( void bluetooth::shim::legacy::Acl::CreateLeConnection( const bluetooth::hci::AddressWithType& address_with_type) { GetAclManager()->CreateLeConnection(address_with_type); LOG_DEBUG("Started Le device to connection %s", address_with_type.ToString().c_str()); LOG_DEBUG("Connection initiated for le connection to remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le", "Initiated connection", PRIVATE_ADDRESS(address_with_type)); } Loading @@ -582,21 +582,23 @@ void bluetooth::shim::legacy::Acl::CreateLeConnection( void bluetooth::shim::legacy::Acl::CancelLeConnection( const bluetooth::hci::AddressWithType& address_with_type) { GetAclManager()->CancelLeConnect(address_with_type); LOG_DEBUG("Canceled le connection %s", address_with_type.ToString().c_str()); LOG_DEBUG("Cancelled le connection to remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le", "Cancelled connection", PRIVATE_ADDRESS(address_with_type)); } void bluetooth::shim::legacy::Acl::OnClassicLinkDisconnected( HciHandle handle, hci::ErrorCode reason) { LOG_DEBUG("Classic link disconnected handle:%hu reason:%s", handle, ErrorCodeText(reason).c_str()); bluetooth::hci::Address remote_address = pimpl_->handle_to_classic_connection_map_[handle]->GetRemoteAddress(); pimpl_->handle_to_classic_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, ToLegacyHciErrorCode(reason)); LOG_DEBUG("Disconnected classic link remote:%s handle:%hu reason:%s", PRIVATE_ADDRESS(remote_address), handle, ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s classic reason:%s", "Disconnected", PRIVATE_ADDRESS(remote_address), ErrorCodeText(reason).c_str()); Loading @@ -604,14 +606,15 @@ void bluetooth::shim::legacy::Acl::OnClassicLinkDisconnected( void bluetooth::shim::legacy::Acl::OnLeLinkDisconnected(HciHandle handle, hci::ErrorCode reason) { LOG_DEBUG("Le link disconnected handle:%hu reason:%s", handle, ErrorCodeText(reason).c_str()); hci::AddressWithType remote_address_with_type = pimpl_->handle_to_le_connection_map_[handle]->GetRemoteAddressWithType(); pimpl_->handle_to_le_connection_map_.erase(handle); TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_disconnected, ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle, ToLegacyHciErrorCode(reason)); LOG_DEBUG("Disconnected le link remote:%s handle:%hu reason:%s", PRIVATE_ADDRESS(remote_address_with_type), handle, ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s le reason:%s", "Disconnected", PRIVATE_ADDRESS(remote_address_with_type), ErrorCodeText(reason).c_str()); Loading @@ -622,7 +625,8 @@ void bluetooth::shim::legacy::Acl::OnConnectSuccess( ASSERT(connection != nullptr); auto handle = connection->GetHandle(); bool locally_initiated = connection->locally_initiated_; const RawAddress bd_addr = ToRawAddress(connection->GetAddress()); const hci::Address remote_address = connection->GetAddress(); const RawAddress bd_addr = ToRawAddress(remote_address); pimpl_->handle_to_classic_connection_map_.emplace( handle, Loading @@ -637,8 +641,12 @@ void bluetooth::shim::legacy::Acl::OnConnectSuccess( TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_connected, bd_addr, handle, HCI_SUCCESS, false); LOG_DEBUG("Connection successful classic remote:%s handle:%hu initiator:%s", PRIVATE_ADDRESS(remote_address), handle, (locally_initiated) ? "local" : "remote"); btm_cb.history_->Push( "%-32s: %s %s classic", "Connection successful", PRIVATE_ADDRESS(bd_addr), "%-32s: %s %s classic", "Connection successful", PRIVATE_ADDRESS(remote_address), (locally_initiated) ? "Local initiated" : "Remote initiated"); } Loading @@ -647,8 +655,8 @@ void bluetooth::shim::legacy::Acl::OnConnectFail(hci::Address address, const RawAddress bd_addr = ToRawAddress(address); TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_failed, bd_addr, kInvalidHciHandle, HCI_SUCCESS, false); LOG_WARN("Classic ACL connection failed peer:%s reason:%s", address.ToString().c_str(), hci::ErrorCodeText(reason).c_str()); LOG_WARN("Connection failed classic remote:%s reason:%s", PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str()); btm_cb.history_->Push("%-32s: %s classic reason:%s", "Connection failed", PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str()); Loading Loading @@ -690,6 +698,9 @@ void bluetooth::shim::legacy::Acl::OnLeConnectSuccess( handle, static_cast<uint8_t>(connection_role), conn_interval, conn_latency, conn_timeout, local_rpa, peer_rpa, peer_addr_type); LOG_DEBUG("Connection successful le remote:%s handle:%hu initiator:%s", PRIVATE_ADDRESS(address_with_type), handle, (locally_initiated) ? "local" : "remote"); btm_cb.history_->Push( "%-32s: %s %s le", "Connection successful", PRIVATE_ADDRESS(address_with_type), Loading @@ -707,7 +718,8 @@ void bluetooth::shim::legacy::Acl::OnLeConnectFail( TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, legacy_address_with_type, handle, enhanced, status); LOG_WARN("Le ACL failed peer:%s", address_with_type.ToString().c_str()); LOG_WARN("Connection failed le remote:%s", PRIVATE_ADDRESS(address_with_type)); btm_cb.history_->Push("%-32s: %s le reason:%s", "Connection failed", PRIVATE_ADDRESS(address_with_type), hci::ErrorCodeText(reason).c_str()); Loading