Loading system/test/rootcanal/bluetooth_hci.cc +0 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ Return<void> BluetoothHci::initialize_impl( Return<void> BluetoothHci::close() { LOG_INFO("%s", __func__); test_model_.Reset(); return Void(); } Loading system/vendor_libs/test_vendor_lib/model/devices/beacon.cc +2 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ void Beacon::TimerTick() { std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send = std::move(ad); for (const auto& phy : phy_layers_) { for (const auto& phy : phy_layers_[Phy::Type::LOW_ENERGY]) { phy->Send(to_send); } } Loading @@ -87,7 +87,7 @@ void Beacon::IncomingPacket(model::packets::LinkLayerPacketView packet) { std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send = std::move(scan_response); for (const auto& phy : phy_layers_) { for (const auto& phy : phy_layers_[Phy::Type::LOW_ENERGY]) { phy->Send(to_send); } } Loading system/vendor_libs/test_vendor_lib/model/devices/device.cc +14 −17 Original line number Diff line number Diff line Loading @@ -29,22 +29,23 @@ std::string Device::ToString() const { } void Device::RegisterPhyLayer(std::shared_ptr<PhyLayer> phy) { phy_layers_.push_back(std::move(phy)); phy_layers_[phy->GetType()].push_back(phy); } void Device::UnregisterPhyLayers() { for (const auto& phy : phy_layers_) { for (auto phy_pair : phy_layers_) { auto phy_list = std::get<1>(phy_pair); for (auto phy : phy_list) { phy->Unregister(); } phy_layers_.clear(); } } void Device::UnregisterPhyLayer(Phy::Type phy_type, uint32_t factory_id) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type && phy->IsFactoryId(factory_id)) { phy->Unregister(); phy_layers_.remove(phy); break; for (const auto phy_layer : phy_layers_[phy_type]) { if (phy_layer->IsFactoryId(factory_id)) { phy_layer->Unregister(); phy_layers_[phy_type].remove(phy_layer); } } } Loading @@ -57,21 +58,17 @@ bool Device::IsAdvertisementAvailable() const { void Device::SendLinkLayerPacket( std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send, Phy::Type phy_type) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type) { for (const auto& phy : phy_layers_[phy_type]) { phy->Send(to_send); } } } void Device::SendLinkLayerPacket(model::packets::LinkLayerPacketView to_send, Phy::Type phy_type) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type) { for (const auto& phy : phy_layers_[phy_type]) { phy->Send(to_send); } } } void Device::SetAddress(Address) { LOG_INFO("%s does not implement %s", GetTypeString().c_str(), __func__); Loading system/vendor_libs/test_vendor_lib/model/devices/device.h +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class Device { Phy::Type phy_type); protected: std::list<std::shared_ptr<PhyLayer>> phy_layers_; std::map<Phy::Type, std::list<std::shared_ptr<PhyLayer>>> phy_layers_; std::chrono::steady_clock::time_point last_advertisement_; Loading system/vendor_libs/test_vendor_lib/model/devices/hci_socket_device.cc +1 −1 Original line number Diff line number Diff line Loading @@ -88,8 +88,8 @@ HciSocketDevice::HciSocketDevice(int file_descriptor) : socket_file_descriptor_( }, [this]() { LOG_INFO("HCI socket device disconnected"); socket_file_descriptor_ = -1; close_callback_(); socket_file_descriptor_ = -1; }); RegisterEventChannel([this](std::shared_ptr<std::vector<uint8_t>> packet) { Loading Loading
system/test/rootcanal/bluetooth_hci.cc +0 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ Return<void> BluetoothHci::initialize_impl( Return<void> BluetoothHci::close() { LOG_INFO("%s", __func__); test_model_.Reset(); return Void(); } Loading
system/vendor_libs/test_vendor_lib/model/devices/beacon.cc +2 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ void Beacon::TimerTick() { std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send = std::move(ad); for (const auto& phy : phy_layers_) { for (const auto& phy : phy_layers_[Phy::Type::LOW_ENERGY]) { phy->Send(to_send); } } Loading @@ -87,7 +87,7 @@ void Beacon::IncomingPacket(model::packets::LinkLayerPacketView packet) { std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send = std::move(scan_response); for (const auto& phy : phy_layers_) { for (const auto& phy : phy_layers_[Phy::Type::LOW_ENERGY]) { phy->Send(to_send); } } Loading
system/vendor_libs/test_vendor_lib/model/devices/device.cc +14 −17 Original line number Diff line number Diff line Loading @@ -29,22 +29,23 @@ std::string Device::ToString() const { } void Device::RegisterPhyLayer(std::shared_ptr<PhyLayer> phy) { phy_layers_.push_back(std::move(phy)); phy_layers_[phy->GetType()].push_back(phy); } void Device::UnregisterPhyLayers() { for (const auto& phy : phy_layers_) { for (auto phy_pair : phy_layers_) { auto phy_list = std::get<1>(phy_pair); for (auto phy : phy_list) { phy->Unregister(); } phy_layers_.clear(); } } void Device::UnregisterPhyLayer(Phy::Type phy_type, uint32_t factory_id) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type && phy->IsFactoryId(factory_id)) { phy->Unregister(); phy_layers_.remove(phy); break; for (const auto phy_layer : phy_layers_[phy_type]) { if (phy_layer->IsFactoryId(factory_id)) { phy_layer->Unregister(); phy_layers_[phy_type].remove(phy_layer); } } } Loading @@ -57,21 +58,17 @@ bool Device::IsAdvertisementAvailable() const { void Device::SendLinkLayerPacket( std::shared_ptr<model::packets::LinkLayerPacketBuilder> to_send, Phy::Type phy_type) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type) { for (const auto& phy : phy_layers_[phy_type]) { phy->Send(to_send); } } } void Device::SendLinkLayerPacket(model::packets::LinkLayerPacketView to_send, Phy::Type phy_type) { for (const auto& phy : phy_layers_) { if (phy->GetType() == phy_type) { for (const auto& phy : phy_layers_[phy_type]) { phy->Send(to_send); } } } void Device::SetAddress(Address) { LOG_INFO("%s does not implement %s", GetTypeString().c_str(), __func__); Loading
system/vendor_libs/test_vendor_lib/model/devices/device.h +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class Device { Phy::Type phy_type); protected: std::list<std::shared_ptr<PhyLayer>> phy_layers_; std::map<Phy::Type, std::list<std::shared_ptr<PhyLayer>>> phy_layers_; std::chrono::steady_clock::time_point last_advertisement_; Loading
system/vendor_libs/test_vendor_lib/model/devices/hci_socket_device.cc +1 −1 Original line number Diff line number Diff line Loading @@ -88,8 +88,8 @@ HciSocketDevice::HciSocketDevice(int file_descriptor) : socket_file_descriptor_( }, [this]() { LOG_INFO("HCI socket device disconnected"); socket_file_descriptor_ = -1; close_callback_(); socket_file_descriptor_ = -1; }); RegisterEventChannel([this](std::shared_ptr<std::vector<uint8_t>> packet) { Loading