Skip to content

Commit

Permalink
pw_bluetooth_proxy: Un-hardcode transport type for BasicL2capChannel
Browse files Browse the repository at this point in the history
Change-Id: I5ddf1558bdf2eaf03ba7fc263567c0ea35cbac18
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/252556
Docs-Not-Needed: Ali Saeed <[email protected]>
Reviewed-by: Ali Saeed <[email protected]>
Pigweed-Auto-Submit: Austin Foxley <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: David Rees <[email protected]>
  • Loading branch information
afoxley authored and CQ Bot Account committed Dec 6, 2024
1 parent e858848 commit b336566
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pw_bluetooth_proxy/basic_l2cap_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace pw::bluetooth::proxy {
pw::Result<BasicL2capChannel> BasicL2capChannel::Create(
L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t local_cid,
uint16_t remote_cid,
Function<void(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Expand All @@ -38,6 +39,7 @@ pw::Result<BasicL2capChannel> BasicL2capChannel::Create(
return BasicL2capChannel(
/*l2cap_channel_manager=*/l2cap_channel_manager,
/*connection_handle=*/connection_handle,
/*transport=*/transport,
/*local_cid=*/local_cid,
/*remote_cid=*/remote_cid,
/*payload_from_controller_fn=*/std::move(payload_from_controller_fn),
Expand Down Expand Up @@ -73,13 +75,14 @@ pw::Status BasicL2capChannel::Write(pw::span<const uint8_t> payload) {
BasicL2capChannel::BasicL2capChannel(
L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t local_cid,
uint16_t remote_cid,
Function<void(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Function<void()>&& queue_space_available_fn)
: L2capChannel(/*l2cap_channel_manager=*/l2cap_channel_manager,
/*connection_handle=*/connection_handle,
/*transport=*/AclTransportType::kLe,
/*transport=*/transport,
/*local_cid=*/local_cid,
/*remote_cid=*/remote_cid,
/*payload_from_controller_fn=*/
Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_proxy/l2cap_aclu_signaling_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ L2capAclUSignalingChannel::L2capAclUSignalingChannel(
: L2capSignalingChannel(
/*l2cap_channel_manager=*/l2cap_channel_manager,
/*connection_handle=*/connection_handle,
/*transport=*/AclTransportType::kBrEdr,
/*fixed_cid=*/
cpp23::to_underlying(emboss::L2capFixedCid::ACL_U_SIGNALING)) {}

Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_proxy/l2cap_leu_signaling_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ L2capLeUSignalingChannel::L2capLeUSignalingChannel(
: L2capSignalingChannel(
/*l2cap_channel_manager=*/l2cap_channel_manager,
/*connection_handle=*/connection_handle,
/*transport=*/AclTransportType::kLe,
/*fixed_cid=*/
cpp23::to_underlying(emboss::L2capFixedCid::LE_U_SIGNALING)) {}

Expand Down
2 changes: 2 additions & 0 deletions pw_bluetooth_proxy/l2cap_signaling_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ namespace pw::bluetooth::proxy {
L2capSignalingChannel::L2capSignalingChannel(
L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t fixed_cid)
: BasicL2capChannel(/*l2cap_channel_manager=*/l2cap_channel_manager,
/*connection_handle=*/connection_handle,
/*transport*/ transport,
/*local_cid=*/fixed_cid,
/*remote_cid=*/fixed_cid,
/*payload_from_controller_fn=*/nullptr,
Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_proxy/proxy_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ pw::Result<BasicL2capChannel> ProxyHost::AcquireBasicL2capChannel(
return BasicL2capChannel::Create(
/*l2cap_channel_manager=*/l2cap_channel_manager_,
/*connection_handle=*/connection_handle,
/*transport=*/transport,
/*local_cid=*/local_cid,
/*remote_cid=*/remote_cid,
/*payload_from_controller_fn=*/std::move(payload_from_controller_fn),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class BasicL2capChannel : public L2capChannel {
static pw::Result<BasicL2capChannel> Create(
L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t local_cid,
uint16_t remote_cid,
Function<void(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Expand Down Expand Up @@ -57,6 +58,7 @@ class BasicL2capChannel : public L2capChannel {
explicit BasicL2capChannel(
L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t local_cid,
uint16_t remote_cid,
Function<void(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class L2capSignalingChannel : public BasicL2capChannel {
public:
explicit L2capSignalingChannel(L2capChannelManager& l2cap_channel_manager,
uint16_t connection_handle,
AclTransportType transport,
uint16_t fixed_cid);

L2capSignalingChannel& operator=(L2capSignalingChannel&& other);
Expand Down

0 comments on commit b336566

Please sign in to comment.