Lines Matching refs:std

55 using namespace std::literals;
77 const std::list<std::shared_ptr<rootcanal::PhyDevice>> &phy_devices) { in Contains()
78 return std::any_of( in Contains()
84 void Send(std::vector<uint8_t> const &packet, int8_t tx_power, in Send()
106 std::unique_ptr<rootcanal::PhyLayer> CreatePhyLayer( in CreatePhyLayer()
108 return std::make_unique<SimPhyLayer>(id, type); in CreatePhyLayer()
116 std::shared_ptr<rootcanal::AsyncManager> gAsyncManager;
118 std::shared_ptr<SimTestModel> gTestModel;
119 std::shared_ptr<rootcanal::configuration::Controller> controller_proto_;
123 std::unique_ptr<rootcanal::TestCommandHandler> gTestChannel;
124 std::unique_ptr<rootcanal::TestChannelTransport> gTestChannelTransport;
125 std::shared_ptr<AsyncDataChannelServer> gTestSocketServer;
136 gTestSocketServer = std::make_shared<PosixAsyncSocketServer>( in SetUpTestChannel()
139 gTestChannel = std::make_unique<rootcanal::TestCommandHandler>(*gTestModel); in SetUpTestChannel()
141 gTestChannelTransport = std::make_unique<rootcanal::TestChannelTransport>(); in SetUpTestChannel()
143 [](const std::string &name, const std::vector<std::string> &args) { in SetUpTestChannel()
144 gAsyncManager->ExecAsync(gSocketUserId, std::chrono::milliseconds(0), in SetUpTestChannel()
146 std::string args_str = ""; in SetUpTestChannel()
156 gTestSocketServer, [](std::shared_ptr<AsyncDataChannel> conn_fd, in SetUpTestChannel()
168 [conn_fd](const std::string &response) { in SetUpTestChannel()
194 void Start(const rust::Slice<::std::uint8_t const> proto_bytes, in Start()
203 controller_proto_ = std::make_shared<rootcanal::configuration::Controller>( in Start()
215 gAsyncManager = std::make_shared<rootcanal::AsyncManager>(); in Start()
219 gTestModel = std::make_unique<SimTestModel>( in Start()
220 std::bind(&rootcanal::AsyncManager::GetNextUserId, gAsyncManager), in Start()
221 std::bind(&rootcanal::AsyncManager::ExecAsync, gAsyncManager, in Start()
222 std::placeholders::_1, std::placeholders::_2, in Start()
223 std::placeholders::_3), in Start()
224 std::bind(&rootcanal::AsyncManager::ExecAsyncPeriodically, gAsyncManager, in Start()
225 std::placeholders::_1, std::placeholders::_2, in Start()
226 std::placeholders::_3, std::placeholders::_4), in Start()
227 std::bind(&rootcanal::AsyncManager::CancelAsyncTasksFromUser, in Start()
228 gAsyncManager, std::placeholders::_1), in Start()
229 std::bind(&rootcanal::AsyncManager::CancelAsyncTask, gAsyncManager, in Start()
230 std::placeholders::_1), in Start()
231 [](const std::string & /* server */, int /* port */, in Start()
247 testCommands.RegisterSendResponse([](const std::string &) {}); in Start()
276 std::shared_ptr<model::Chip::Bluetooth> model;
281 std::shared_ptr<rootcanal::configuration::Controller> controller_proto;
282 std::unique_ptr<rootcanal::ControllerProperties> controller_properties;
284 ChipInfo(uint32_t chip_id, std::shared_ptr<model::Chip::Bluetooth> model) in ChipInfo()
287 uint32_t chip_id, std::shared_ptr<model::Chip::Bluetooth> model, in ChipInfo()
288 std::shared_ptr<rootcanal::configuration::Controller> controller_proto, in ChipInfo()
289 std::unique_ptr<rootcanal::ControllerProperties> controller_properties) in ChipInfo()
292 controller_proto(std::move(controller_proto)), in ChipInfo()
293 controller_properties(std::move(controller_properties)) {} in ChipInfo()
296 std::unordered_map<uint32_t, std::shared_ptr<ChipInfo>> id_to_chip_info_;
335 gAsyncManager->ExecAsync(gSocketUserId, std::chrono::milliseconds(0), [id]() { in Remove()
343 uint32_t Add(uint32_t chip_id, const std::string &address_string, in Add()
344 const rust::Slice<::std::uint8_t const> controller_proto_bytes) { in Add()
345 auto transport = std::make_shared<HciPacketTransport>(chip_id, gAsyncManager); in Add()
347 std::shared_ptr<rootcanal::configuration::Controller> controller_proto = in Add()
366 std::make_shared<rootcanal::configuration::Controller>(custom_proto); in Add()
368 std::unique_ptr<rootcanal::ControllerProperties> controller_properties = in Add()
369 std::make_unique<rootcanal::ControllerProperties>(*controller_proto); in Add()
372 std::make_shared<rootcanal::HciDevice>(transport, *controller_properties); in Add()
377 std::string description, const std::vector<uint8_t> &packet) { in Add()
384 std::promise<uint32_t> rootcanal_id_promise; in Add()
387 std::optional<Address> address_option; in Add()
392 gSocketUserId, std::chrono::milliseconds(0), in Add()
403 auto model = std::make_shared<model::Chip::Bluetooth>(); in Add()
407 id_to_chip_info_.emplace(rootcanal_id, std::make_shared<ChipInfo>( in Add()
409 std::move(controller_properties))); in Add()
419 const std::string &type, const std::string &address) { in AddRustDevice()
421 std::make_shared<RustDevice>(std::move(callbacks), type, address); in AddRustDevice()
429 auto model = std::make_shared<model::Chip::Bluetooth>(); in AddRustDevice()
433 std::make_shared<ChipInfo>(chip_id, model)); in AddRustDevice()
435 rootcanal_id, std::make_unique<RustBluetoothChip>(rust_device)); in AddRustDevice()
440 std::array<uint8_t, rootcanal::Address::kLength> address) { in SetRustDeviceAddress()
442 std::memcpy(addr, address.data(), rootcanal::Address::kLength); in SetRustDeviceAddress()
486 rust::Vec<::std::uint8_t> GetCxx(uint32_t id) { in GetCxx()
488 std::vector<uint8_t> proto_bytes(bluetooth.ByteSizeLong()); in GetCxx()
491 std::copy(proto_bytes.begin(), proto_bytes.end(), in GetCxx()
492 std::back_inserter(proto_rust_bytes)); in GetCxx()