Skip to content

Commit

Permalink
pw_bluetooth_proxy: Delete old basic l2cap channel create function
Browse files Browse the repository at this point in the history
Now all downstream users are on new signature

Bug: 390191420
Change-Id: I6dcdab50b1579361de953a666b9838af2b71e15d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/262454
Lint: Lint 🤖 <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Pigweed-Auto-Submit: Austin Foxley <[email protected]>
Reviewed-by: Charlie Boutier <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Ben Lawson <[email protected]>
Docs-Not-Needed: Austin Foxley <[email protected]>
  • Loading branch information
afoxley authored and CQ Bot Account committed Jan 24, 2025
1 parent a368701 commit 1c682f1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 55 deletions.
16 changes: 0 additions & 16 deletions pw_bluetooth_proxy/proxy_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,22 +545,6 @@ pw::Result<BasicL2capChannel> ProxyHost::AcquireBasicL2capChannel(
/*event_fn=*/std::move(event_fn));
}

pw::Result<BasicL2capChannel> ProxyHost::AcquireBasicL2capChannel(
uint16_t connection_handle,
uint16_t local_cid,
uint16_t remote_cid,
AclTransportType transport,
Function<bool(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Function<void(L2capChannelEvent event)>&& event_fn) {
return AcquireBasicL2capChannel(connection_handle,
local_cid,
remote_cid,
transport,
std::move(payload_from_controller_fn),
nullptr,
std::move(event_fn));
}

namespace {

pw::Result<GattNotifyChannel> CreateGattNotifyChannel(
Expand Down
6 changes: 6 additions & 0 deletions pw_bluetooth_proxy/proxy_host_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,7 @@ TEST_F(BasicL2capChannelTest, BasicWrite) {
/*remote_cid=*/capture.channel_id,
/*transport=*/AclTransportType::kLe,
/*payload_from_controller_fn=*/nullptr,
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr));

PW_TEST_EXPECT_OK(
Expand Down Expand Up @@ -2268,6 +2269,7 @@ TEST_F(BasicL2capChannelTest, ErrorOnWriteTooLarge) {
/*remote_cid=*/0x123,
/*transport=*/AclTransportType::kLe,
/*payload_from_controller_fn=*/nullptr,
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr));

EXPECT_EQ(channel.Write(MultiBufFromSpan(pw::span(hci_arr))).status,
Expand All @@ -2293,6 +2295,7 @@ TEST_F(BasicL2capChannelTest, CannotCreateChannelWithInvalidArgs) {
/*remote_cid=*/0x123,
/*transport=*/AclTransportType::kLe,
/*payload_from_controller_fn=*/nullptr,
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr)
.status(),
PW_STATUS_INVALID_ARGUMENT);
Expand All @@ -2305,6 +2308,7 @@ TEST_F(BasicL2capChannelTest, CannotCreateChannelWithInvalidArgs) {
/*remote_cid=*/0x123,
/*transport=*/AclTransportType::kLe,
/*payload_from_controller_fn=*/nullptr,
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr)
.status(),
PW_STATUS_INVALID_ARGUMENT);
Expand Down Expand Up @@ -2344,6 +2348,7 @@ TEST_F(BasicL2capChannelTest, BasicRead) {
capture.expected_payload.end()));
return true;
},
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr));

std::array<uint8_t,
Expand Down Expand Up @@ -2420,6 +2425,7 @@ TEST_F(BasicL2capChannelTest, BasicForward) {
// Forward to host.
return false;
},
/*payload_from_host_fn=*/nullptr,
/*event_fn=*/nullptr));

Result<emboss::AclDataFrameWriter> acl =
Expand Down
39 changes: 0 additions & 39 deletions pw_bluetooth_proxy/public/pw_bluetooth_proxy/proxy_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,45 +218,6 @@ class ProxyHost {
Function<bool(pw::span<uint8_t> payload)>&& payload_from_host_fn,
Function<void(L2capChannelEvent event)>&& event_fn);

/// Returns an L2CAP channel operating in basic mode that supports writing to
/// and reading from a remote peer.
///
/// @param[in] connection_handle The connection handle of the remote
/// peer.
///
/// @param[in] local_cid L2CAP channel ID of the local
/// endpoint.
///
/// @param[in] remote_cid L2CAP channel ID of the remote
/// endpoint.
///
/// @param[in] transport Logical link transport type.
///
/// @param[in] payload_from_controller_fn Read callback to be invoked on Rx
/// SDUs. Return value of false
/// indicates the packet should be
/// forwarded on to host.
///
/// @param[in] event_fn Handle asynchronous events such as
/// errors encountered by the channel.
/// See `l2cap_channel_common.h`.
///
/// @returns @rst
///
/// .. pw-status-codes::
/// INVALID_ARGUMENT: If arguments are invalid (check logs).
/// UNAVAILABLE: If channel could not be created because no memory was
/// available to accommodate an additional ACL connection.
/// @endrst
/// @deprecated
pw::Result<BasicL2capChannel> AcquireBasicL2capChannel(
uint16_t connection_handle,
uint16_t local_cid,
uint16_t remote_cid,
AclTransportType transport,
Function<bool(pw::span<uint8_t> payload)>&& payload_from_controller_fn,
Function<void(L2capChannelEvent event)>&& event_fn);

/// Send a GATT Notify to the indicated connection.
///
/// @param[in] connection_handle The connection handle of the peer to notify.
Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_proxy/pw_bluetooth_proxy_private/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ struct BasicL2capParameters {
AclTransportType transport = AclTransportType::kLe;
Function<bool(pw::span<uint8_t> payload)>&& payload_from_controller_fn =
nullptr;
Function<bool(pw::span<uint8_t> payload)>&& payload_from_host_fn = nullptr;
Function<void(L2capChannelEvent event)>&& event_fn = nullptr;
};

Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_proxy/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ BasicL2capChannel BuildBasicL2capChannel(ProxyHost& proxy,
params.remote_cid,
params.transport,
std::move(params.payload_from_controller_fn),
std::move(params.payload_from_host_fn),
std::move(params.event_fn));
PW_TEST_EXPECT_OK(channel);
return std::move(channel.value());
Expand Down

0 comments on commit 1c682f1

Please sign in to comment.