aboutsummaryrefslogtreecommitdiff
path: root/gd/l2cap/classic/dynamic_channel_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gd/l2cap/classic/dynamic_channel_manager.cc')
-rw-r--r--gd/l2cap/classic/dynamic_channel_manager.cc37
1 files changed, 17 insertions, 20 deletions
diff --git a/gd/l2cap/classic/dynamic_channel_manager.cc b/gd/l2cap/classic/dynamic_channel_manager.cc
index dbbd465b8..8620086bb 100644
--- a/gd/l2cap/classic/dynamic_channel_manager.cc
+++ b/gd/l2cap/classic/dynamic_channel_manager.cc
@@ -24,38 +24,35 @@ namespace bluetooth {
namespace l2cap {
namespace classic {
-bool DynamicChannelManager::ConnectChannel(hci::Address device, DynamicChannelConfigurationOption configuration_option,
- Psm psm, OnConnectionOpenCallback on_connection_open,
- OnConnectionFailureCallback on_fail_callback, os::Handler* handler) {
- internal::Link::PendingDynamicChannelConnection pending_dynamic_channel_connection{
- .handler_ = handler,
+void DynamicChannelManager::ConnectChannel(
+ hci::Address device,
+ DynamicChannelConfigurationOption configuration_option,
+ Psm psm,
+ OnConnectionOpenCallback on_connection_open,
+ OnConnectionFailureCallback on_fail_callback) {
+ internal::Link::PendingDynamicChannelConnection pending_connection{
.on_open_callback_ = std::move(on_connection_open),
.on_fail_callback_ = std::move(on_fail_callback),
.configuration_ = configuration_option,
};
- l2cap_layer_handler_->Post(common::BindOnce(&internal::LinkManager::ConnectDynamicChannelServices,
- common::Unretained(link_manager_), device,
- std::move(pending_dynamic_channel_connection), psm));
-
- return true;
+ l2cap_layer_handler_->CallOn(
+ link_manager_, &internal::LinkManager::ConnectDynamicChannelServices, device, std::move(pending_connection), psm);
}
-bool DynamicChannelManager::RegisterService(Psm psm, DynamicChannelConfigurationOption configuration_option,
- const SecurityPolicy& security_policy,
- OnRegistrationCompleteCallback on_registration_complete,
- OnConnectionOpenCallback on_connection_open, os::Handler* handler) {
+void DynamicChannelManager::RegisterService(
+ Psm psm,
+ DynamicChannelConfigurationOption configuration_option,
+ const classic::SecurityPolicy& security_policy,
+ OnRegistrationCompleteCallback on_registration_complete,
+ OnConnectionOpenCallback on_connection_open) {
internal::DynamicChannelServiceImpl::PendingRegistration pending_registration{
- .user_handler_ = handler,
.security_policy_ = security_policy,
.on_registration_complete_callback_ = std::move(on_registration_complete),
.on_connection_open_callback_ = std::move(on_connection_open),
.configuration_ = configuration_option,
};
- l2cap_layer_handler_->Post(common::BindOnce(&internal::DynamicChannelServiceManagerImpl::Register,
- common::Unretained(service_manager_), psm,
- std::move(pending_registration)));
-
- return true;
+ l2cap_layer_handler_->CallOn(
+ service_manager_, &internal::DynamicChannelServiceManagerImpl::Register, psm, std::move(pending_registration));
}
} // namespace classic