From 377960ed85db6db84cc9c94e838cdb6e895f5a04 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 5 Mar 2020 15:16:56 -0800 Subject: [PATCH] L2capLe: Expose dynamic channel manager API Test: bluetooth_test_gd Change-Id: I4c17b257bcfc517d249db30ab6f29f4b9f4df468 --- gd/l2cap/le/l2cap_le_module.cc | 7 +++++++ gd/l2cap/le/l2cap_le_module.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/gd/l2cap/le/l2cap_le_module.cc b/gd/l2cap/le/l2cap_le_module.cc index 49595477f..511cc3670 100644 --- a/gd/l2cap/le/l2cap_le_module.cc +++ b/gd/l2cap/le/l2cap_le_module.cc @@ -23,6 +23,7 @@ #include "hci/hci_layer.h" #include "hci/hci_packets.h" #include "l2cap/internal/parameter_provider.h" +#include "l2cap/le/internal/dynamic_channel_service_manager_impl.h" #include "l2cap/le/internal/fixed_channel_service_manager_impl.h" #include "l2cap/le/internal/link_manager.h" #include "module.h" @@ -44,6 +45,7 @@ struct L2capLeModule::impl { hci::AclManager* acl_manager_; l2cap::internal::ParameterProvider parameter_provider_; internal::FixedChannelServiceManagerImpl fixed_channel_service_manager_impl_{l2cap_handler_}; + internal::DynamicChannelServiceManagerImpl dynamic_channel_service_manager_impl_{l2cap_handler_}; internal::LinkManager link_manager_{l2cap_handler_, acl_manager_, &fixed_channel_service_manager_impl_, ¶meter_provider_}; }; @@ -72,6 +74,11 @@ std::unique_ptr L2capLeModule::GetFixedChannelManager() { &pimpl_->link_manager_, pimpl_->l2cap_handler_)); } +std::unique_ptr L2capLeModule::GetDynamicChannelManager() { + return std::unique_ptr(new DynamicChannelManager( + &pimpl_->dynamic_channel_service_manager_impl_, &pimpl_->link_manager_, pimpl_->l2cap_handler_)); +} + } // namespace le } // namespace l2cap } // namespace bluetooth diff --git a/gd/l2cap/le/l2cap_le_module.h b/gd/l2cap/le/l2cap_le_module.h index 4ed3d9fcb..b9d76d561 100644 --- a/gd/l2cap/le/l2cap_le_module.h +++ b/gd/l2cap/le/l2cap_le_module.h @@ -17,6 +17,7 @@ #include +#include "l2cap/le/dynamic_channel_manager.h" #include "l2cap/le/fixed_channel_manager.h" #include "module.h" @@ -34,6 +35,11 @@ class L2capLeModule : public bluetooth::Module { */ virtual std::unique_ptr GetFixedChannelManager(); + /** + * Get the api to the LE dynamic channel l2cap module + */ + virtual std::unique_ptr GetDynamicChannelManager(); + static const ModuleFactory Factory; protected: -- 2.11.0