Loading tools/rootcanal/desktop/test_environment.cc +27 −21 Original line number Diff line number Diff line Loading @@ -97,13 +97,17 @@ void TestEnvironment::SetUpHciServer( server->SetOnConnectCallback([this, properties = std::move(properties)]( std::shared_ptr<AsyncDataChannel> socket, AsyncDataChannelServer* server) { // AddHciConnection needs to be executed in task thread to // prevent data races on test model. async_manager_.ExecAsync(socket_user_id_, std::chrono::milliseconds(0), [=]() { auto transport = HciSocketTransport::Create(socket); if (enable_hci_sniffer_) { transport = HciSniffer::Create(transport); } auto device = HciDevice::Create(transport, properties); async_manager_.ExecAsync(socket_user_id_, std::chrono::milliseconds(0), [=]() { test_model_.AddHciConnection(device); }); test_model_.AddHciConnection(device); if (enable_hci_sniffer_) { auto filename = device->GetAddress().ToString() + ".pcap"; for (auto i = 0; std::filesystem::exists(filename); i++) { Loading @@ -123,6 +127,8 @@ void TestEnvironment::SetUpHciServer( sniffer->SetPcapFilter(std::make_shared<rootcanal::PcapFilter>()); } } }); server->StartListening(); }); hci_socket_servers_.emplace_back(std::move(server)); Loading Loading
tools/rootcanal/desktop/test_environment.cc +27 −21 Original line number Diff line number Diff line Loading @@ -97,13 +97,17 @@ void TestEnvironment::SetUpHciServer( server->SetOnConnectCallback([this, properties = std::move(properties)]( std::shared_ptr<AsyncDataChannel> socket, AsyncDataChannelServer* server) { // AddHciConnection needs to be executed in task thread to // prevent data races on test model. async_manager_.ExecAsync(socket_user_id_, std::chrono::milliseconds(0), [=]() { auto transport = HciSocketTransport::Create(socket); if (enable_hci_sniffer_) { transport = HciSniffer::Create(transport); } auto device = HciDevice::Create(transport, properties); async_manager_.ExecAsync(socket_user_id_, std::chrono::milliseconds(0), [=]() { test_model_.AddHciConnection(device); }); test_model_.AddHciConnection(device); if (enable_hci_sniffer_) { auto filename = device->GetAddress().ToString() + ".pcap"; for (auto i = 0; std::filesystem::exists(filename); i++) { Loading @@ -123,6 +127,8 @@ void TestEnvironment::SetUpHciServer( sniffer->SetPcapFilter(std::make_shared<rootcanal::PcapFilter>()); } } }); server->StartListening(); }); hci_socket_servers_.emplace_back(std::move(server)); Loading