Loading system/gd/hci/acl_connection_interface.h +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ constexpr EventCode AclConnectionEvents[] = { EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE, EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED, EventCode::ENHANCED_FLUSH_COMPLETE, }; typedef CommandInterface<AclCommandBuilder> AclConnectionInterface; Loading system/gd/hci/acl_manager/classic_acl_connection.cc +2 −2 Original line number Diff line number Diff line Loading @@ -494,8 +494,8 @@ bool ClassicAclConnection::SniffSubrating(uint16_t maximum_latency, uint16_t min bool ClassicAclConnection::Flush() { acl_connection_interface_->EnqueueCommand( FlushBuilder::Create(handle_), pimpl_->tracker.client_handler_->BindOnce(check_complete<FlushCompleteView>)); EnhancedFlushBuilder::Create(handle_), pimpl_->tracker.client_handler_->BindOnce(check_status<EnhancedFlushStatusView>)); return true; } Loading system/gd/hci/acl_manager/classic_acl_connection_test.cc +1 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ class TestAclConnectionInterface : public hci::AclConnectionInterface { const std::lock_guard<std::mutex> lock(command_queue_mutex_); auto packet = std::move(command_queue_.front()); command_queue_.pop(); return std::move(packet); return packet; } std::shared_ptr<std::vector<uint8_t>> DequeueCommandBytes() { Loading system/gd/hci/acl_manager/classic_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,9 @@ struct classic_impl : public security::ISecurityManagerListener { case EventCode::FLUSH_OCCURRED: on_flush_occurred(event_packet); break; case EventCode::ENHANCED_FLUSH_COMPLETE: on_enhanced_flush_complete(event_packet); break; case EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE: on_read_remote_supported_features_complete(event_packet); break; Loading Loading @@ -608,6 +611,17 @@ struct classic_impl : public security::ISecurityManagerListener { connections.execute(handle, [=](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); }); } void on_enhanced_flush_complete(EventView packet) { auto flush_complete = EnhancedFlushCompleteView::Create(packet); if (!flush_complete.IsValid()) { LOG_ERROR("Received an invalid packet"); return; } uint16_t handle = flush_complete.GetConnectionHandle(); connections.execute( handle, [=](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); }); } void on_read_remote_version_information( hci::ErrorCode hci_status, uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { connections.execute(handle, [=](ConnectionManagementCallbacks* callbacks) { Loading system/gd/hci/acl_manager_test.cc +3 −3 Original line number Diff line number Diff line Loading @@ -957,12 +957,12 @@ TEST_F(AclManagerWithConnectionTest, send_flow_specification) { TEST_F(AclManagerWithConnectionTest, send_flush) { connection_->Flush(); auto packet = GetConnectionManagementCommand(OpCode::FLUSH); auto command_view = FlushView::Create(packet); auto packet = GetConnectionManagementCommand(OpCode::ENHANCED_FLUSH); auto command_view = EnhancedFlushView::Create(packet); ASSERT_TRUE(command_view.IsValid()); EXPECT_CALL(mock_connection_management_callbacks_, OnFlushOccurred()); test_hci_layer_->IncomingEvent(FlushOccurredBuilder::Create(handle_)); test_hci_layer_->IncomingEvent(EnhancedFlushCompleteBuilder::Create(handle_)); sync_client_handler(); } Loading Loading
system/gd/hci/acl_connection_interface.h +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ constexpr EventCode AclConnectionEvents[] = { EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE, EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED, EventCode::ENHANCED_FLUSH_COMPLETE, }; typedef CommandInterface<AclCommandBuilder> AclConnectionInterface; Loading
system/gd/hci/acl_manager/classic_acl_connection.cc +2 −2 Original line number Diff line number Diff line Loading @@ -494,8 +494,8 @@ bool ClassicAclConnection::SniffSubrating(uint16_t maximum_latency, uint16_t min bool ClassicAclConnection::Flush() { acl_connection_interface_->EnqueueCommand( FlushBuilder::Create(handle_), pimpl_->tracker.client_handler_->BindOnce(check_complete<FlushCompleteView>)); EnhancedFlushBuilder::Create(handle_), pimpl_->tracker.client_handler_->BindOnce(check_status<EnhancedFlushStatusView>)); return true; } Loading
system/gd/hci/acl_manager/classic_acl_connection_test.cc +1 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ class TestAclConnectionInterface : public hci::AclConnectionInterface { const std::lock_guard<std::mutex> lock(command_queue_mutex_); auto packet = std::move(command_queue_.front()); command_queue_.pop(); return std::move(packet); return packet; } std::shared_ptr<std::vector<uint8_t>> DequeueCommandBytes() { Loading
system/gd/hci/acl_manager/classic_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,9 @@ struct classic_impl : public security::ISecurityManagerListener { case EventCode::FLUSH_OCCURRED: on_flush_occurred(event_packet); break; case EventCode::ENHANCED_FLUSH_COMPLETE: on_enhanced_flush_complete(event_packet); break; case EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE: on_read_remote_supported_features_complete(event_packet); break; Loading Loading @@ -608,6 +611,17 @@ struct classic_impl : public security::ISecurityManagerListener { connections.execute(handle, [=](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); }); } void on_enhanced_flush_complete(EventView packet) { auto flush_complete = EnhancedFlushCompleteView::Create(packet); if (!flush_complete.IsValid()) { LOG_ERROR("Received an invalid packet"); return; } uint16_t handle = flush_complete.GetConnectionHandle(); connections.execute( handle, [=](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); }); } void on_read_remote_version_information( hci::ErrorCode hci_status, uint16_t handle, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version) { connections.execute(handle, [=](ConnectionManagementCallbacks* callbacks) { Loading
system/gd/hci/acl_manager_test.cc +3 −3 Original line number Diff line number Diff line Loading @@ -957,12 +957,12 @@ TEST_F(AclManagerWithConnectionTest, send_flow_specification) { TEST_F(AclManagerWithConnectionTest, send_flush) { connection_->Flush(); auto packet = GetConnectionManagementCommand(OpCode::FLUSH); auto command_view = FlushView::Create(packet); auto packet = GetConnectionManagementCommand(OpCode::ENHANCED_FLUSH); auto command_view = EnhancedFlushView::Create(packet); ASSERT_TRUE(command_view.IsValid()); EXPECT_CALL(mock_connection_management_callbacks_, OnFlushOccurred()); test_hci_layer_->IncomingEvent(FlushOccurredBuilder::Create(handle_)); test_hci_layer_->IncomingEvent(EnhancedFlushCompleteBuilder::Create(handle_)); sync_client_handler(); } Loading