Loading system/gd/hci/acl_connection_interface.h +0 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ constexpr EventCode AclConnectionEvents[] = { EventCode::FLUSH_OCCURRED, EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE, EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE, EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED, }; Loading system/gd/hci/acl_manager/classic_impl.h +10 −18 Original line number Diff line number Diff line Loading @@ -46,9 +46,10 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage controller_ = controller; handler_ = handler; should_accept_connection_ = common::Bind([](Address, ClassOfDevice) { return true; }); acl_connection_interface_ = hci_layer_->GetAclConnectionInterface(handler_->BindOn(this, &classic_impl::on_classic_event), handler_->BindOn(this, &classic_impl::on_classic_disconnect)); acl_connection_interface_ = hci_layer_->GetAclConnectionInterface( handler_->BindOn(this, &classic_impl::on_classic_event), handler_->BindOn(this, &classic_impl::on_classic_disconnect), handler_->BindOn(this, &classic_impl::on_read_remote_version_information)); } ~classic_impl() override { Loading Loading @@ -98,9 +99,6 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage case EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE: on_read_remote_extended_features_complete(event_packet); break; case EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE: on_read_remote_version_information_complete(event_packet); break; case EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED: on_link_supervision_timeout_changed(event_packet); break; Loading Loading @@ -448,19 +446,13 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage acl_connection.connection_management_callbacks_->OnFlushOccurred(); } void on_read_remote_version_information_complete(EventPacketView packet) { auto view = ReadRemoteVersionInformationCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote version information packet invalid"); if (view.GetStatus() != ErrorCode::SUCCESS) { auto status = view.GetStatus(); std::string error_code = ErrorCodeText(status); LOG_ERROR("Received on_read_remote_version_information_complete with error code %s", error_code.c_str()); return; void on_read_remote_version_information( uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { auto acl_connection = acl_connections_.find(handle); if (acl_connection != acl_connections_.end()) { acl_connection->second.connection_management_callbacks_->OnReadRemoteVersionInformationComplete( version, manufacturer_name, sub_version); } uint16_t handle = view.GetConnectionHandle(); auto& acl_connection = acl_connections_.find(handle)->second; acl_connection.connection_management_callbacks_->OnReadRemoteVersionInformationComplete( view.GetVersion(), view.GetManufacturerName(), view.GetSubVersion()); } void on_read_remote_supported_features_complete(EventPacketView packet) { Loading system/gd/hci/acl_manager/le_acl_connection.cc +4 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ class LeAclConnectionTracker : public LeConnectionManagementCallbacks { SAVE_OR_CALL(OnDataLengthChange, tx_octets, tx_time, rx_octets, rx_time) } void OnReadRemoteVersionInformationComplete(uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) { SAVE_OR_CALL(OnReadRemoteVersionInformationComplete, lmp_version, manufacturer_name, sub_version); } void OnDisconnection(ErrorCode reason) override { SAVE_OR_CALL(OnDisconnection, reason); } Loading system/gd/hci/acl_manager/le_connection_management_callbacks.h +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ class LeConnectionManagementCallbacks { uint16_t supervision_timeout) = 0; virtual void OnDataLengthChange(uint16_t tx_octets, uint16_t tx_time, uint16_t rx_octets, uint16_t rx_time) = 0; virtual void OnDisconnection(ErrorCode reason) = 0; virtual void OnReadRemoteVersionInformationComplete( uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) = 0; }; } // namespace acl_manager Loading system/gd/hci/acl_manager/le_impl.h +12 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,9 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { controller_ = controller; handler_ = handler; le_acl_connection_interface_ = hci_layer_->GetLeAclConnectionInterface( handler_->BindOn(this, &le_impl::on_le_event), handler_->BindOn(this, &le_impl::on_le_disconnect)); handler_->BindOn(this, &le_impl::on_le_event), handler_->BindOn(this, &le_impl::on_le_disconnect), handler_->BindOn(this, &le_impl::on_le_read_remote_version_information)); le_address_manager_ = new LeAddressManager( common::Bind(&le_impl::enqueue_command, common::Unretained(this)), handler_, Loading Loading @@ -253,6 +255,15 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { complete_view.GetConnInterval(), complete_view.GetConnLatency(), complete_view.GetSupervisionTimeout()); } void on_le_read_remote_version_information( uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { auto connection = le_acl_connections_.find(handle); if (connection != le_acl_connections_.end()) { connection->second.le_connection_management_callbacks_->OnReadRemoteVersionInformationComplete( version, manufacturer_name, sub_version); } } void enqueue_command(std::unique_ptr<CommandPacketBuilder> command_packet) { hci_layer_->EnqueueCommand( std::move(command_packet), Loading Loading
system/gd/hci/acl_connection_interface.h +0 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ constexpr EventCode AclConnectionEvents[] = { EventCode::FLUSH_OCCURRED, EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE, EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE, EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED, }; Loading
system/gd/hci/acl_manager/classic_impl.h +10 −18 Original line number Diff line number Diff line Loading @@ -46,9 +46,10 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage controller_ = controller; handler_ = handler; should_accept_connection_ = common::Bind([](Address, ClassOfDevice) { return true; }); acl_connection_interface_ = hci_layer_->GetAclConnectionInterface(handler_->BindOn(this, &classic_impl::on_classic_event), handler_->BindOn(this, &classic_impl::on_classic_disconnect)); acl_connection_interface_ = hci_layer_->GetAclConnectionInterface( handler_->BindOn(this, &classic_impl::on_classic_event), handler_->BindOn(this, &classic_impl::on_classic_disconnect), handler_->BindOn(this, &classic_impl::on_read_remote_version_information)); } ~classic_impl() override { Loading Loading @@ -98,9 +99,6 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage case EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE: on_read_remote_extended_features_complete(event_packet); break; case EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE: on_read_remote_version_information_complete(event_packet); break; case EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED: on_link_supervision_timeout_changed(event_packet); break; Loading Loading @@ -448,19 +446,13 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage acl_connection.connection_management_callbacks_->OnFlushOccurred(); } void on_read_remote_version_information_complete(EventPacketView packet) { auto view = ReadRemoteVersionInformationCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote version information packet invalid"); if (view.GetStatus() != ErrorCode::SUCCESS) { auto status = view.GetStatus(); std::string error_code = ErrorCodeText(status); LOG_ERROR("Received on_read_remote_version_information_complete with error code %s", error_code.c_str()); return; void on_read_remote_version_information( uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { auto acl_connection = acl_connections_.find(handle); if (acl_connection != acl_connections_.end()) { acl_connection->second.connection_management_callbacks_->OnReadRemoteVersionInformationComplete( version, manufacturer_name, sub_version); } uint16_t handle = view.GetConnectionHandle(); auto& acl_connection = acl_connections_.find(handle)->second; acl_connection.connection_management_callbacks_->OnReadRemoteVersionInformationComplete( view.GetVersion(), view.GetManufacturerName(), view.GetSubVersion()); } void on_read_remote_supported_features_complete(EventPacketView packet) { Loading
system/gd/hci/acl_manager/le_acl_connection.cc +4 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ class LeAclConnectionTracker : public LeConnectionManagementCallbacks { SAVE_OR_CALL(OnDataLengthChange, tx_octets, tx_time, rx_octets, rx_time) } void OnReadRemoteVersionInformationComplete(uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) { SAVE_OR_CALL(OnReadRemoteVersionInformationComplete, lmp_version, manufacturer_name, sub_version); } void OnDisconnection(ErrorCode reason) override { SAVE_OR_CALL(OnDisconnection, reason); } Loading
system/gd/hci/acl_manager/le_connection_management_callbacks.h +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ class LeConnectionManagementCallbacks { uint16_t supervision_timeout) = 0; virtual void OnDataLengthChange(uint16_t tx_octets, uint16_t tx_time, uint16_t rx_octets, uint16_t rx_time) = 0; virtual void OnDisconnection(ErrorCode reason) = 0; virtual void OnReadRemoteVersionInformationComplete( uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) = 0; }; } // namespace acl_manager Loading
system/gd/hci/acl_manager/le_impl.h +12 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,9 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { controller_ = controller; handler_ = handler; le_acl_connection_interface_ = hci_layer_->GetLeAclConnectionInterface( handler_->BindOn(this, &le_impl::on_le_event), handler_->BindOn(this, &le_impl::on_le_disconnect)); handler_->BindOn(this, &le_impl::on_le_event), handler_->BindOn(this, &le_impl::on_le_disconnect), handler_->BindOn(this, &le_impl::on_le_read_remote_version_information)); le_address_manager_ = new LeAddressManager( common::Bind(&le_impl::enqueue_command, common::Unretained(this)), handler_, Loading Loading @@ -253,6 +255,15 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { complete_view.GetConnInterval(), complete_view.GetConnLatency(), complete_view.GetSupervisionTimeout()); } void on_le_read_remote_version_information( uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { auto connection = le_acl_connections_.find(handle); if (connection != le_acl_connections_.end()) { connection->second.le_connection_management_callbacks_->OnReadRemoteVersionInformationComplete( version, manufacturer_name, sub_version); } } void enqueue_command(std::unique_ptr<CommandPacketBuilder> command_packet) { hci_layer_->EnqueueCommand( std::move(command_packet), Loading