Loading system/gd/hal/fuzz/fuzz_hci_hal.cc +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ void FuzzHciHal::injectArbitrary(FuzzedDataProvider& fdp) { } void FuzzHciHal::sendHciCommand(HciPacket packet) { hci::CommandPacketView command = hci::CommandPacketView::FromBytes(packet); hci::CommandView command = hci::CommandView::FromBytes(packet); if (!command.IsValid()) { return; } Loading system/gd/hci/acl_manager/le_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { callbacks->OnReadRemoteVersionInformationComplete(version, manufacturer_name, sub_version); } void enqueue_command(std::unique_ptr<CommandPacketBuilder> command_packet) { void enqueue_command(std::unique_ptr<CommandBuilder> command_packet) { hci_layer_->EnqueueCommand( std::move(command_packet), handler_->BindOnce(&LeAddressManager::OnCommandComplete, common::Unretained(le_address_manager_))); Loading system/gd/hci/acl_manager_test.cc +68 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes system/gd/hci/controller_test.cc +14 −11 Original line number Diff line number Diff line Loading @@ -57,21 +57,24 @@ PacketView<kLittleEndian> GetPacketView(std::unique_ptr<packet::BasePacketBuilde class TestHciLayer : public HciLayer { public: void EnqueueCommand(std::unique_ptr<CommandPacketBuilder> command, void EnqueueCommand( std::unique_ptr<CommandBuilder> command, common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) override { GetHandler()->Post(common::BindOnce(&TestHciLayer::HandleCommand, common::Unretained(this), std::move(command), std::move(on_complete))); } void EnqueueCommand(std::unique_ptr<CommandPacketBuilder> command, void EnqueueCommand( std::unique_ptr<CommandBuilder> command, common::ContextualOnceCallback<void(CommandStatusView)> on_status) override { EXPECT_TRUE(false) << "Controller properties should not generate Command Status"; } void HandleCommand(std::unique_ptr<CommandPacketBuilder> command_builder, void HandleCommand( std::unique_ptr<CommandBuilder> command_builder, common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) { auto packet_view = GetPacketView(std::move(command_builder)); CommandPacketView command = CommandPacketView::Create(packet_view); CommandView command = CommandView::Create(packet_view); ASSERT_TRUE(command.IsValid()); uint8_t num_packets = 1; Loading Loading @@ -227,7 +230,7 @@ class TestHciLayer : public HciLayer { number_of_completed_packets_callback_.Invoke(event); } CommandPacketView GetCommand(OpCode op_code) { CommandView GetCommand(OpCode op_code) { std::unique_lock<std::mutex> lock(mutex_); std::chrono::milliseconds time = std::chrono::milliseconds(3000); Loading @@ -239,9 +242,9 @@ class TestHciLayer : public HciLayer { } EXPECT_TRUE(command_queue_.size() > 0); if (command_queue_.empty()) { return CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())); return CommandView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())); } CommandPacketView command = command_queue_.front(); CommandView command = command_queue_.front(); EXPECT_EQ(command.GetOpCode(), op_code); command_queue_.pop(); return command; Loading @@ -260,7 +263,7 @@ class TestHciLayer : public HciLayer { private: common::ContextualCallback<void(EventPacketView)> number_of_completed_packets_callback_; std::queue<CommandPacketView> command_queue_; std::queue<CommandView> command_queue_; mutable std::mutex mutex_; std::condition_variable not_empty_; }; Loading system/gd/hci/facade/acl_manager_facade.cc +2 −2 Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ class AclManagerFacadeService : public AclManagerFacade::Service, public Connect ::grpc::ServerContext* context, const ConnectionCommandMsg* request, ::google::protobuf::Empty* response) override { auto command_view = ConnectionManagementCommandView::Create( AclCommandView::Create(CommandPacketView::Create(PacketView<kLittleEndian>( auto command_view = ConnectionManagementCommandView::Create(AclCommandView::Create(CommandView::Create(PacketView<kLittleEndian>( std::make_shared<std::vector<uint8_t>>(request->packet().begin(), request->packet().end()))))); if (!command_view.IsValid()) { return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT, "Invalid command packet"); Loading Loading
system/gd/hal/fuzz/fuzz_hci_hal.cc +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ void FuzzHciHal::injectArbitrary(FuzzedDataProvider& fdp) { } void FuzzHciHal::sendHciCommand(HciPacket packet) { hci::CommandPacketView command = hci::CommandPacketView::FromBytes(packet); hci::CommandView command = hci::CommandView::FromBytes(packet); if (!command.IsValid()) { return; } Loading
system/gd/hci/acl_manager/le_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { callbacks->OnReadRemoteVersionInformationComplete(version, manufacturer_name, sub_version); } void enqueue_command(std::unique_ptr<CommandPacketBuilder> command_packet) { void enqueue_command(std::unique_ptr<CommandBuilder> command_packet) { hci_layer_->EnqueueCommand( std::move(command_packet), handler_->BindOnce(&LeAddressManager::OnCommandComplete, common::Unretained(le_address_manager_))); Loading
system/gd/hci/acl_manager_test.cc +68 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes
system/gd/hci/controller_test.cc +14 −11 Original line number Diff line number Diff line Loading @@ -57,21 +57,24 @@ PacketView<kLittleEndian> GetPacketView(std::unique_ptr<packet::BasePacketBuilde class TestHciLayer : public HciLayer { public: void EnqueueCommand(std::unique_ptr<CommandPacketBuilder> command, void EnqueueCommand( std::unique_ptr<CommandBuilder> command, common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) override { GetHandler()->Post(common::BindOnce(&TestHciLayer::HandleCommand, common::Unretained(this), std::move(command), std::move(on_complete))); } void EnqueueCommand(std::unique_ptr<CommandPacketBuilder> command, void EnqueueCommand( std::unique_ptr<CommandBuilder> command, common::ContextualOnceCallback<void(CommandStatusView)> on_status) override { EXPECT_TRUE(false) << "Controller properties should not generate Command Status"; } void HandleCommand(std::unique_ptr<CommandPacketBuilder> command_builder, void HandleCommand( std::unique_ptr<CommandBuilder> command_builder, common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) { auto packet_view = GetPacketView(std::move(command_builder)); CommandPacketView command = CommandPacketView::Create(packet_view); CommandView command = CommandView::Create(packet_view); ASSERT_TRUE(command.IsValid()); uint8_t num_packets = 1; Loading Loading @@ -227,7 +230,7 @@ class TestHciLayer : public HciLayer { number_of_completed_packets_callback_.Invoke(event); } CommandPacketView GetCommand(OpCode op_code) { CommandView GetCommand(OpCode op_code) { std::unique_lock<std::mutex> lock(mutex_); std::chrono::milliseconds time = std::chrono::milliseconds(3000); Loading @@ -239,9 +242,9 @@ class TestHciLayer : public HciLayer { } EXPECT_TRUE(command_queue_.size() > 0); if (command_queue_.empty()) { return CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())); return CommandView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())); } CommandPacketView command = command_queue_.front(); CommandView command = command_queue_.front(); EXPECT_EQ(command.GetOpCode(), op_code); command_queue_.pop(); return command; Loading @@ -260,7 +263,7 @@ class TestHciLayer : public HciLayer { private: common::ContextualCallback<void(EventPacketView)> number_of_completed_packets_callback_; std::queue<CommandPacketView> command_queue_; std::queue<CommandView> command_queue_; mutable std::mutex mutex_; std::condition_variable not_empty_; }; Loading
system/gd/hci/facade/acl_manager_facade.cc +2 −2 Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ class AclManagerFacadeService : public AclManagerFacade::Service, public Connect ::grpc::ServerContext* context, const ConnectionCommandMsg* request, ::google::protobuf::Empty* response) override { auto command_view = ConnectionManagementCommandView::Create( AclCommandView::Create(CommandPacketView::Create(PacketView<kLittleEndian>( auto command_view = ConnectionManagementCommandView::Create(AclCommandView::Create(CommandView::Create(PacketView<kLittleEndian>( std::make_shared<std::vector<uint8_t>>(request->packet().begin(), request->packet().end()))))); if (!command_view.IsValid()) { return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT, "Invalid command packet"); Loading