Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7a41e34 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Execute AddHciConnection from the async manager context"

parents 7cacb0a9 0bdb4889
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -61,14 +61,16 @@ void TestEnvironment::initialize(std::promise<void> barrier) {
      });

  SetUpTestChannel();
  SetUpHciServer([this](std::shared_ptr<AsyncDataChannel> socket,
  SetUpHciServer([this, user_id](std::shared_ptr<AsyncDataChannel> socket,
                        AsyncDataChannelServer* srv) {
    auto transport = HciSocketTransport::Create(socket);
    if (enable_hci_sniffer_) {
      transport = HciSniffer::Create(transport);
    }
    auto device = HciDevice::Create(transport, controller_properties_file_);
    async_manager_.ExecAsync(user_id, std::chrono::milliseconds(0), [=]() {
      test_model_.AddHciConnection(device);
    });
    if (enable_hci_sniffer_) {
      auto filename = device->GetAddress().ToString() + ".pcap";
      for (auto i = 0; std::filesystem::exists(filename); i++) {
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class PhyDevice {
  using Identifier = uint32_t;

  PhyDevice(Identifier id, std::string type, std::shared_ptr<Device> device);
  PhyDevice(PhyDevice &&) = delete;
  ~PhyDevice() = default;

  void Register(PhyLayer* phy);