Loading system/gd/hci/acl_manager.cc +4 −2 Original line number Diff line number Diff line Loading @@ -291,8 +291,9 @@ struct AclManager::impl { if (acl_connections_.size() == 1 && packet_to_send_ == nullptr) { start_round_robin(); } auto role = connection_complete.GetRole(); std::unique_ptr<AclConnection> connection_proxy( new AclConnection(&acl_manager_, handle, address, peer_address_type)); new AclConnection(&acl_manager_, handle, address, peer_address_type, role)); le_client_handler_->Post(common::BindOnce(&LeConnectionCallbacks::OnLeConnectSuccess, common::Unretained(le_client_callbacks_), address_with_type, std::move(connection_proxy))); Loading Loading @@ -323,8 +324,9 @@ struct AclManager::impl { if (acl_connections_.size() == 1 && packet_to_send_ == nullptr) { start_round_robin(); } auto role = connection_complete.GetRole(); std::unique_ptr<AclConnection> connection_proxy( new AclConnection(&acl_manager_, handle, address, peer_address_type)); new AclConnection(&acl_manager_, handle, address, peer_address_type, role)); le_client_handler_->Post(common::BindOnce(&LeConnectionCallbacks::OnLeConnectSuccess, common::Unretained(le_client_callbacks_), reporting_address_with_type, std::move(connection_proxy))); Loading system/gd/hci/acl_manager.h +10 −2 Original line number Diff line number Diff line Loading @@ -99,6 +99,13 @@ class AclConnection { return handle_; } /* This return role for LE devices only, for Classic, please see |RoleDiscovery| method. * TODO: split AclConnection for LE and Classic */ Role GetRole() const { return role_; } using Queue = common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder>; using QueueUpEnd = common::BidiQueueEnd<BasePacketBuilder, PacketView<kLittleEndian>>; using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>; Loading Loading @@ -145,12 +152,13 @@ class AclConnection { friend AclManager; AclConnection(AclManager* manager, uint16_t handle, Address address) : manager_(manager), handle_(handle), address_(address) {} AclConnection(AclManager* manager, uint16_t handle, Address address, AddressType address_type) : manager_(manager), handle_(handle), address_(address), address_type_(address_type) {} AclConnection(AclManager* manager, uint16_t handle, Address address, AddressType address_type, Role role) : manager_(manager), handle_(handle), address_(address), address_type_(address_type), role_(role) {} AclManager* manager_; uint16_t handle_; Address address_; AddressType address_type_; Role role_; DISALLOW_COPY_AND_ASSIGN(AclConnection); }; Loading system/gd/l2cap/le/fixed_channel.cc +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ hci::AddressWithType FixedChannel::GetDevice() const { return impl_->GetDevice(); } hci::Role FixedChannel::GetRole() const { return impl_->GetRole(); } void FixedChannel::RegisterOnCloseCallback(os::Handler* user_handler, FixedChannel::OnCloseCallback on_close_callback) { l2cap_handler_->Post(common::BindOnce(&internal::FixedChannelImpl::RegisterOnCloseCallback, impl_, user_handler, std::move(on_close_callback))); Loading system/gd/l2cap/le/fixed_channel.h +5 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,11 @@ class FixedChannel { hci::AddressWithType GetDevice() const; /** * Return the role we have in the associated link */ hci::Role GetRole() const; /** * Register close callback. If close callback is registered, when a channel is closed, the channel's resource will * only be freed after on_close callback is invoked. Otherwise, if no on_close callback is registered, the channel's Loading system/gd/l2cap/le/internal/fixed_channel_impl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ namespace l2cap { namespace le { namespace internal { hci::Role FixedChannelImpl::GetRole() const { return link_->GetRole(); } FixedChannelImpl::FixedChannelImpl(Cid cid, Link* link, os::Handler* l2cap_handler) : cid_(cid), device_(link->GetDevice()), link_(link), l2cap_handler_(l2cap_handler) { ASSERT_LOG(cid_ >= kFirstFixedChannel && cid_ <= kLastFixedChannel, "Invalid cid: %d", cid_); Loading Loading
system/gd/hci/acl_manager.cc +4 −2 Original line number Diff line number Diff line Loading @@ -291,8 +291,9 @@ struct AclManager::impl { if (acl_connections_.size() == 1 && packet_to_send_ == nullptr) { start_round_robin(); } auto role = connection_complete.GetRole(); std::unique_ptr<AclConnection> connection_proxy( new AclConnection(&acl_manager_, handle, address, peer_address_type)); new AclConnection(&acl_manager_, handle, address, peer_address_type, role)); le_client_handler_->Post(common::BindOnce(&LeConnectionCallbacks::OnLeConnectSuccess, common::Unretained(le_client_callbacks_), address_with_type, std::move(connection_proxy))); Loading Loading @@ -323,8 +324,9 @@ struct AclManager::impl { if (acl_connections_.size() == 1 && packet_to_send_ == nullptr) { start_round_robin(); } auto role = connection_complete.GetRole(); std::unique_ptr<AclConnection> connection_proxy( new AclConnection(&acl_manager_, handle, address, peer_address_type)); new AclConnection(&acl_manager_, handle, address, peer_address_type, role)); le_client_handler_->Post(common::BindOnce(&LeConnectionCallbacks::OnLeConnectSuccess, common::Unretained(le_client_callbacks_), reporting_address_with_type, std::move(connection_proxy))); Loading
system/gd/hci/acl_manager.h +10 −2 Original line number Diff line number Diff line Loading @@ -99,6 +99,13 @@ class AclConnection { return handle_; } /* This return role for LE devices only, for Classic, please see |RoleDiscovery| method. * TODO: split AclConnection for LE and Classic */ Role GetRole() const { return role_; } using Queue = common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder>; using QueueUpEnd = common::BidiQueueEnd<BasePacketBuilder, PacketView<kLittleEndian>>; using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>; Loading Loading @@ -145,12 +152,13 @@ class AclConnection { friend AclManager; AclConnection(AclManager* manager, uint16_t handle, Address address) : manager_(manager), handle_(handle), address_(address) {} AclConnection(AclManager* manager, uint16_t handle, Address address, AddressType address_type) : manager_(manager), handle_(handle), address_(address), address_type_(address_type) {} AclConnection(AclManager* manager, uint16_t handle, Address address, AddressType address_type, Role role) : manager_(manager), handle_(handle), address_(address), address_type_(address_type), role_(role) {} AclManager* manager_; uint16_t handle_; Address address_; AddressType address_type_; Role role_; DISALLOW_COPY_AND_ASSIGN(AclConnection); }; Loading
system/gd/l2cap/le/fixed_channel.cc +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ hci::AddressWithType FixedChannel::GetDevice() const { return impl_->GetDevice(); } hci::Role FixedChannel::GetRole() const { return impl_->GetRole(); } void FixedChannel::RegisterOnCloseCallback(os::Handler* user_handler, FixedChannel::OnCloseCallback on_close_callback) { l2cap_handler_->Post(common::BindOnce(&internal::FixedChannelImpl::RegisterOnCloseCallback, impl_, user_handler, std::move(on_close_callback))); Loading
system/gd/l2cap/le/fixed_channel.h +5 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,11 @@ class FixedChannel { hci::AddressWithType GetDevice() const; /** * Return the role we have in the associated link */ hci::Role GetRole() const; /** * Register close callback. If close callback is registered, when a channel is closed, the channel's resource will * only be freed after on_close callback is invoked. Otherwise, if no on_close callback is registered, the channel's Loading
system/gd/l2cap/le/internal/fixed_channel_impl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ namespace l2cap { namespace le { namespace internal { hci::Role FixedChannelImpl::GetRole() const { return link_->GetRole(); } FixedChannelImpl::FixedChannelImpl(Cid cid, Link* link, os::Handler* l2cap_handler) : cid_(cid), device_(link->GetDevice()), link_(link), l2cap_handler_(l2cap_handler) { ASSERT_LOG(cid_ >= kFirstFixedChannel && cid_ <= kLastFixedChannel, "Invalid cid: %d", cid_); Loading