-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_bluetooth_proxy: Support queueing + L2CAP credits
- Support queueing L2CAP packets if ACL send credits are unavailable. - Support L2CAP CoC credit-based control flow. - Implement L2CAP signaling channels to handle L2CAP_FLOW_CONTROL_CREDIT_IND packets. - Add basic L2CAP channel. Bug: 360929142, 360934030 Change-Id: Ib7a2022538f89a579fa096d59f576663c8a8fd18 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237263 Docs-Not-Needed: Ali Saeed <saeedali@google.com> Reviewed-by: David Rees <drees@google.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Commit-Queue: Ali Saeed <saeedali@google.com>
- Loading branch information
Showing
26 changed files
with
1,181 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2024 The Pigweed Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
// use this file except in compliance with the License. You may obtain a copy of | ||
// the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
#include "pw_bluetooth_proxy/basic_l2cap_channel.h" | ||
|
||
#include "pw_bluetooth/emboss_util.h" | ||
#include "pw_bluetooth/l2cap_frames.emb.h" | ||
|
||
namespace pw::bluetooth::proxy { | ||
|
||
BasicL2capChannel::BasicL2capChannel( | ||
L2capChannelManager& l2cap_channel_manager, | ||
uint16_t connection_handle, | ||
uint16_t local_cid, | ||
pw::Function<void(pw::span<uint8_t> payload)>&& receive_fn) | ||
: L2capReadChannel(l2cap_channel_manager, | ||
std::move(receive_fn), | ||
connection_handle, | ||
local_cid) {} | ||
|
||
bool BasicL2capChannel::OnPduReceived(pw::span<uint8_t> bframe) { | ||
Result<emboss::BFrameWriter> bframe_view = | ||
MakeEmbossWriter<emboss::BFrameWriter>(bframe); | ||
CallReceiveFn(span(bframe_view->payload().BackingStorage().data(), | ||
bframe_view->BackingStorage().SizeInBytes())); | ||
return true; | ||
} | ||
|
||
} // namespace pw::bluetooth::proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.