Loading system/gd/cert/gd_device.py +1 −1 Original line number Diff line number Diff line Loading @@ -231,7 +231,7 @@ class GdDeviceBase(ABC): self.rootservice = facade_rootservice_pb2_grpc.RootFacadeStub(self.grpc_root_server_channel) self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel) self.controller_read_only_property = facade_rootservice_pb2_grpc.ReadOnlyPropertyStub(self.grpc_channel) self.hci = hci_facade_pb2_grpc.HciLayerFacadeStub(self.grpc_channel) self.hci = hci_facade_pb2_grpc.HciFacadeStub(self.grpc_channel) self.l2cap = l2cap_facade_pb2_grpc.L2capClassicModuleFacadeStub(self.grpc_channel) self.l2cap_le = l2cap_le_facade_pb2_grpc.L2capLeModuleFacadeStub(self.grpc_channel) self.hci_acl_manager = acl_manager_facade_pb2_grpc.AclManagerFacadeStub(self.grpc_channel) Loading system/gd/facade/grpc_root_server.cc +4 −4 Original line number Diff line number Diff line Loading @@ -78,11 +78,11 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { break; case BluetoothModule::HCI: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); break; case BluetoothModule::HCI_INTERFACES: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); modules.add<::bluetooth::hci::facade::AclManagerFacadeModule>(); modules.add<::bluetooth::hci::facade::ControllerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeAclManagerFacadeModule>(); Loading @@ -99,7 +99,7 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::l2cap::classic::L2capClassicModuleFacadeModule>(); modules.add<::bluetooth::l2cap::le::L2capLeModuleFacadeModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); break; case BluetoothModule::SECURITY: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); Loading @@ -107,7 +107,7 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { modules.add<::bluetooth::security::SecurityModuleFacadeModule>(); modules.add<::bluetooth::neighbor::facade::NeighborFacadeModule>(); modules.add<::bluetooth::l2cap::classic::L2capClassicModuleFacadeModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); modules.add<::bluetooth::hci::facade::ControllerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeAdvertisingManagerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeScanningManagerFacadeModule>(); Loading system/gd/hci/facade/facade.cc +18 −20 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ namespace bluetooth { namespace hci { namespace facade { class HciLayerFacadeService : public HciLayerFacade::Service { class HciFacadeService : public HciFacade::Service { public: HciLayerFacadeService(HciLayer* hci_layer, Controller* controller, ::bluetooth::os::Handler* facade_handler) HciFacadeService(HciLayer* hci_layer, Controller* controller, ::bluetooth::os::Handler* facade_handler) : hci_layer_(hci_layer), controller_(controller), facade_handler_(facade_handler) {} virtual ~HciLayerFacadeService() { virtual ~HciFacadeService() { if (unregister_acl_dequeue_) { hci_layer_->GetAclQueueEnd()->UnregisterDequeue(); } Loading Loading @@ -72,8 +72,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::google::protobuf::Empty* response) override { auto packet = std::make_unique<TestCommandBuilder>( std::vector<uint8_t>(command->payload().begin(), command->payload().end())); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciLayerFacadeService::on_complete)); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciFacadeService::on_complete)); return ::grpc::Status::OK; } Loading @@ -83,7 +82,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::google::protobuf::Empty* response) override { auto packet = std::make_unique<TestCommandBuilder>( std::vector<uint8_t>(command->payload().begin(), command->payload().end())); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciLayerFacadeService::on_status)); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciFacadeService::on_status)); return ::grpc::Status::OK; } Loading @@ -91,8 +90,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::grpc::ServerContext* context, const ::bluetooth::hci::EventRequest* event, ::google::protobuf::Empty* response) override { hci_layer_->RegisterEventHandler(static_cast<EventCode>(event->code()), facade_handler_->BindOn(this, &HciLayerFacadeService::on_event)); hci_layer_->RegisterEventHandler( static_cast<EventCode>(event->code()), facade_handler_->BindOn(this, &HciFacadeService::on_event)); return ::grpc::Status::OK; } Loading @@ -100,8 +99,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::grpc::ServerContext* context, const ::bluetooth::hci::EventRequest* event, ::google::protobuf::Empty* response) override { hci_layer_->RegisterLeEventHandler(static_cast<SubeventCode>(event->code()), facade_handler_->BindOn(this, &HciLayerFacadeService::on_le_subevent)); hci_layer_->RegisterLeEventHandler( static_cast<SubeventCode>(event->code()), facade_handler_->BindOn(this, &HciFacadeService::on_le_subevent)); return ::grpc::Status::OK; } Loading Loading @@ -152,8 +151,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { completed_packets_callback_registered_ = true; } hci_layer_->GetAclQueueEnd()->RegisterEnqueue( facade_handler_, common::Bind(&HciLayerFacadeService::handle_enqueue_acl, common::Unretained(this), common::Unretained(&enqueued))); facade_handler_, common::Bind(&HciFacadeService::handle_enqueue_acl, common::Unretained(this), common::Unretained(&enqueued))); auto result = future.wait_for(std::chrono::milliseconds(100)); ASSERT(std::future_status::ready == result); return ::grpc::Status::OK; Loading @@ -164,7 +163,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { const ::google::protobuf::Empty* request, ::grpc::ServerWriter<::bluetooth::facade::Data>* writer) override { hci_layer_->GetAclQueueEnd()->RegisterDequeue( facade_handler_, common::Bind(&HciLayerFacadeService::on_acl_ready, common::Unretained(this))); facade_handler_, common::Bind(&HciFacadeService::on_acl_ready, common::Unretained(this))); unregister_acl_dequeue_ = true; return pending_acl_events_.RunLoop(context, writer); }; Loading Loading @@ -229,28 +228,27 @@ class HciLayerFacadeService : public HciLayerFacade::Service { bool completed_packets_callback_registered_{false}; }; void HciLayerFacadeModule::ListDependencies(ModuleList* list) { void HciFacadeModule::ListDependencies(ModuleList* list) { ::bluetooth::grpc::GrpcFacadeModule::ListDependencies(list); list->add<HciLayer>(); list->add<Controller>(); } void HciLayerFacadeModule::Start() { void HciFacadeModule::Start() { ::bluetooth::grpc::GrpcFacadeModule::Start(); service_ = new HciLayerFacadeService(GetDependency<HciLayer>(), GetDependency<Controller>(), GetHandler()); service_ = new HciFacadeService(GetDependency<HciLayer>(), GetDependency<Controller>(), GetHandler()); } void HciLayerFacadeModule::Stop() { void HciFacadeModule::Stop() { delete service_; ::bluetooth::grpc::GrpcFacadeModule::Stop(); } ::grpc::Service* HciLayerFacadeModule::GetService() const { ::grpc::Service* HciFacadeModule::GetService() const { return service_; } const ModuleFactory HciLayerFacadeModule::Factory = ::bluetooth::ModuleFactory([]() { return new HciLayerFacadeModule(); }); const ModuleFactory HciFacadeModule::Factory = ::bluetooth::ModuleFactory([]() { return new HciFacadeModule(); }); } // namespace facade } // namespace hci Loading system/gd/hci/facade/facade.h +3 −3 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ namespace bluetooth { namespace hci { namespace facade { class HciLayerFacadeService; class HciFacadeService; class HciLayerFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { class HciFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { public: static const ModuleFactory Factory; Loading @@ -37,7 +37,7 @@ class HciLayerFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { ::grpc::Service* GetService() const override; private: HciLayerFacadeService* service_; HciFacadeService* service_; }; } // namespace facade Loading system/gd/hci/facade/hci_facade.proto +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ package bluetooth.hci; import "google/protobuf/empty.proto"; import "facade/common.proto"; service HciLayerFacade { service HciFacade { rpc SendCommandWithComplete(facade.Data) returns (google.protobuf.Empty) {} rpc SendCommandWithStatus(facade.Data) returns (google.protobuf.Empty) {} Loading Loading
system/gd/cert/gd_device.py +1 −1 Original line number Diff line number Diff line Loading @@ -231,7 +231,7 @@ class GdDeviceBase(ABC): self.rootservice = facade_rootservice_pb2_grpc.RootFacadeStub(self.grpc_root_server_channel) self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel) self.controller_read_only_property = facade_rootservice_pb2_grpc.ReadOnlyPropertyStub(self.grpc_channel) self.hci = hci_facade_pb2_grpc.HciLayerFacadeStub(self.grpc_channel) self.hci = hci_facade_pb2_grpc.HciFacadeStub(self.grpc_channel) self.l2cap = l2cap_facade_pb2_grpc.L2capClassicModuleFacadeStub(self.grpc_channel) self.l2cap_le = l2cap_le_facade_pb2_grpc.L2capLeModuleFacadeStub(self.grpc_channel) self.hci_acl_manager = acl_manager_facade_pb2_grpc.AclManagerFacadeStub(self.grpc_channel) Loading
system/gd/facade/grpc_root_server.cc +4 −4 Original line number Diff line number Diff line Loading @@ -78,11 +78,11 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { break; case BluetoothModule::HCI: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); break; case BluetoothModule::HCI_INTERFACES: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); modules.add<::bluetooth::hci::facade::AclManagerFacadeModule>(); modules.add<::bluetooth::hci::facade::ControllerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeAclManagerFacadeModule>(); Loading @@ -99,7 +99,7 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); modules.add<::bluetooth::l2cap::classic::L2capClassicModuleFacadeModule>(); modules.add<::bluetooth::l2cap::le::L2capLeModuleFacadeModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); break; case BluetoothModule::SECURITY: modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>(); Loading @@ -107,7 +107,7 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service { modules.add<::bluetooth::security::SecurityModuleFacadeModule>(); modules.add<::bluetooth::neighbor::facade::NeighborFacadeModule>(); modules.add<::bluetooth::l2cap::classic::L2capClassicModuleFacadeModule>(); modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>(); modules.add<::bluetooth::hci::facade::HciFacadeModule>(); modules.add<::bluetooth::hci::facade::ControllerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeAdvertisingManagerFacadeModule>(); modules.add<::bluetooth::hci::facade::LeScanningManagerFacadeModule>(); Loading
system/gd/hci/facade/facade.cc +18 −20 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ namespace bluetooth { namespace hci { namespace facade { class HciLayerFacadeService : public HciLayerFacade::Service { class HciFacadeService : public HciFacade::Service { public: HciLayerFacadeService(HciLayer* hci_layer, Controller* controller, ::bluetooth::os::Handler* facade_handler) HciFacadeService(HciLayer* hci_layer, Controller* controller, ::bluetooth::os::Handler* facade_handler) : hci_layer_(hci_layer), controller_(controller), facade_handler_(facade_handler) {} virtual ~HciLayerFacadeService() { virtual ~HciFacadeService() { if (unregister_acl_dequeue_) { hci_layer_->GetAclQueueEnd()->UnregisterDequeue(); } Loading Loading @@ -72,8 +72,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::google::protobuf::Empty* response) override { auto packet = std::make_unique<TestCommandBuilder>( std::vector<uint8_t>(command->payload().begin(), command->payload().end())); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciLayerFacadeService::on_complete)); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciFacadeService::on_complete)); return ::grpc::Status::OK; } Loading @@ -83,7 +82,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::google::protobuf::Empty* response) override { auto packet = std::make_unique<TestCommandBuilder>( std::vector<uint8_t>(command->payload().begin(), command->payload().end())); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciLayerFacadeService::on_status)); hci_layer_->EnqueueCommand(std::move(packet), facade_handler_->BindOnceOn(this, &HciFacadeService::on_status)); return ::grpc::Status::OK; } Loading @@ -91,8 +90,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::grpc::ServerContext* context, const ::bluetooth::hci::EventRequest* event, ::google::protobuf::Empty* response) override { hci_layer_->RegisterEventHandler(static_cast<EventCode>(event->code()), facade_handler_->BindOn(this, &HciLayerFacadeService::on_event)); hci_layer_->RegisterEventHandler( static_cast<EventCode>(event->code()), facade_handler_->BindOn(this, &HciFacadeService::on_event)); return ::grpc::Status::OK; } Loading @@ -100,8 +99,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { ::grpc::ServerContext* context, const ::bluetooth::hci::EventRequest* event, ::google::protobuf::Empty* response) override { hci_layer_->RegisterLeEventHandler(static_cast<SubeventCode>(event->code()), facade_handler_->BindOn(this, &HciLayerFacadeService::on_le_subevent)); hci_layer_->RegisterLeEventHandler( static_cast<SubeventCode>(event->code()), facade_handler_->BindOn(this, &HciFacadeService::on_le_subevent)); return ::grpc::Status::OK; } Loading Loading @@ -152,8 +151,8 @@ class HciLayerFacadeService : public HciLayerFacade::Service { completed_packets_callback_registered_ = true; } hci_layer_->GetAclQueueEnd()->RegisterEnqueue( facade_handler_, common::Bind(&HciLayerFacadeService::handle_enqueue_acl, common::Unretained(this), common::Unretained(&enqueued))); facade_handler_, common::Bind(&HciFacadeService::handle_enqueue_acl, common::Unretained(this), common::Unretained(&enqueued))); auto result = future.wait_for(std::chrono::milliseconds(100)); ASSERT(std::future_status::ready == result); return ::grpc::Status::OK; Loading @@ -164,7 +163,7 @@ class HciLayerFacadeService : public HciLayerFacade::Service { const ::google::protobuf::Empty* request, ::grpc::ServerWriter<::bluetooth::facade::Data>* writer) override { hci_layer_->GetAclQueueEnd()->RegisterDequeue( facade_handler_, common::Bind(&HciLayerFacadeService::on_acl_ready, common::Unretained(this))); facade_handler_, common::Bind(&HciFacadeService::on_acl_ready, common::Unretained(this))); unregister_acl_dequeue_ = true; return pending_acl_events_.RunLoop(context, writer); }; Loading Loading @@ -229,28 +228,27 @@ class HciLayerFacadeService : public HciLayerFacade::Service { bool completed_packets_callback_registered_{false}; }; void HciLayerFacadeModule::ListDependencies(ModuleList* list) { void HciFacadeModule::ListDependencies(ModuleList* list) { ::bluetooth::grpc::GrpcFacadeModule::ListDependencies(list); list->add<HciLayer>(); list->add<Controller>(); } void HciLayerFacadeModule::Start() { void HciFacadeModule::Start() { ::bluetooth::grpc::GrpcFacadeModule::Start(); service_ = new HciLayerFacadeService(GetDependency<HciLayer>(), GetDependency<Controller>(), GetHandler()); service_ = new HciFacadeService(GetDependency<HciLayer>(), GetDependency<Controller>(), GetHandler()); } void HciLayerFacadeModule::Stop() { void HciFacadeModule::Stop() { delete service_; ::bluetooth::grpc::GrpcFacadeModule::Stop(); } ::grpc::Service* HciLayerFacadeModule::GetService() const { ::grpc::Service* HciFacadeModule::GetService() const { return service_; } const ModuleFactory HciLayerFacadeModule::Factory = ::bluetooth::ModuleFactory([]() { return new HciLayerFacadeModule(); }); const ModuleFactory HciFacadeModule::Factory = ::bluetooth::ModuleFactory([]() { return new HciFacadeModule(); }); } // namespace facade } // namespace hci Loading
system/gd/hci/facade/facade.h +3 −3 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ namespace bluetooth { namespace hci { namespace facade { class HciLayerFacadeService; class HciFacadeService; class HciLayerFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { class HciFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { public: static const ModuleFactory Factory; Loading @@ -37,7 +37,7 @@ class HciLayerFacadeModule : public ::bluetooth::grpc::GrpcFacadeModule { ::grpc::Service* GetService() const override; private: HciLayerFacadeService* service_; HciFacadeService* service_; }; } // namespace facade Loading
system/gd/hci/facade/hci_facade.proto +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ package bluetooth.hci; import "google/protobuf/empty.proto"; import "facade/common.proto"; service HciLayerFacade { service HciFacade { rpc SendCommandWithComplete(facade.Data) returns (google.protobuf.Empty) {} rpc SendCommandWithStatus(facade.Data) returns (google.protobuf.Empty) {} Loading