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

Commit ab062b57 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2capLe: Expose dynamic channel manager API

Test: bluetooth_test_gd
Change-Id: I4c17b257bcfc517d249db30ab6f29f4b9f4df468
parent f964df08
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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_,
                                      &parameter_provider_};
};
@@ -72,6 +74,11 @@ std::unique_ptr<FixedChannelManager> L2capLeModule::GetFixedChannelManager() {
                                                                      &pimpl_->link_manager_, pimpl_->l2cap_handler_));
}

std::unique_ptr<DynamicChannelManager> L2capLeModule::GetDynamicChannelManager() {
  return std::unique_ptr<DynamicChannelManager>(new DynamicChannelManager(
      &pimpl_->dynamic_channel_service_manager_impl_, &pimpl_->link_manager_, pimpl_->l2cap_handler_));
}

}  // namespace le
}  // namespace l2cap
}  // namespace bluetooth
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

#include <memory>

#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<FixedChannelManager> GetFixedChannelManager();

  /**
   * Get the api to the LE dynamic channel l2cap module
   */
  virtual std::unique_ptr<DynamicChannelManager> GetDynamicChannelManager();

  static const ModuleFactory Factory;

 protected: