CKPT: domain: add RfcommSocketFactory instance
Change-Id: I49f4cae4a95fa022f568643edf6d7a7bd86cf3fd
diff --git a/drivers/bluetooth/lib/data/domain.cc b/drivers/bluetooth/lib/data/domain.cc
index e614e55..fd83265 100644
--- a/drivers/bluetooth/lib/data/domain.cc
+++ b/drivers/bluetooth/lib/data/domain.cc
@@ -7,6 +7,7 @@
#include "garnet/drivers/bluetooth/lib/common/log.h"
#include "garnet/drivers/bluetooth/lib/common/task_domain.h"
#include "garnet/drivers/bluetooth/lib/data/l2cap_socket_factory.h"
+#include "garnet/drivers/bluetooth/lib/data/rfcomm_socket_factory.h"
#include "garnet/drivers/bluetooth/lib/hci/transport.h"
#include "garnet/drivers/bluetooth/lib/l2cap/channel_manager.h"
#include "garnet/drivers/bluetooth/lib/rfcomm/channel_manager.h"
@@ -31,7 +32,9 @@
InitializeL2CAP();
InitializeRFCOMM();
- socket_factory_ = std::make_unique<internal::L2capSocketFactory>();
+ l2cap_socket_factory_ = std::make_unique<internal::L2capSocketFactory>();
+ rfcomm_socket_factory_ =
+ std::make_unique<internal::RfcommSocketFactory>();
bt_log(TRACE, "data-domain", "initialized");
});
@@ -129,7 +132,7 @@
psm,
[this, psm, cb = std::move(socket_callback),
cb_dispatcher](auto channel) mutable {
- zx::socket s = socket_factory_->MakeSocketForChannel(channel);
+ zx::socket s = l2cap_socket_factory_->MakeSocketForChannel(channel);
// Called every time the service is connected, cb must be shared.
async::PostTask(cb_dispatcher,
[s = std::move(s), cb = cb.share(),
@@ -196,9 +199,10 @@
std::unique_ptr<l2cap::ChannelManager> l2cap_;
std::unique_ptr<rfcomm::ChannelManager> rfcomm_;
- // Creates sockets that bridge internal L2CAP and RFCOMM channels to profile
- // processes.
- std::unique_ptr<internal::L2capSocketFactory> socket_factory_;
+ // Creates sockets that bridge internal L2CAP channels to profile processes.
+ std::unique_ptr<internal::L2capSocketFactory> l2cap_socket_factory_;
+ // Creates sockets that bridge internal RFCOMM channels to profile processes.
+ std::unique_ptr<internal::RfcommSocketFactory> rfcomm_socket_factory_;
FXL_DISALLOW_COPY_AND_ASSIGN(Impl);
};