Skip to content

Commit

Permalink
pw_bluetooth_proxy: Pass H4 as event type plus an HCI span
Browse files Browse the repository at this point in the history
This is more consistent with our intended clients.

Bug: 326499611
Test: CQ (tests updated)
Change-Id: Ifd28d95c51e3c040b0ea8dfe566b40e3504a2c58
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/213664
Commit-Queue: Auto-Submit <[email protected]>
Pigweed-Auto-Submit: David Rees <[email protected]>
Reviewed-by: Ben Lawson <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
studgeek authored and CQ Bot Account committed Jun 4, 2024
1 parent ee2ddb5 commit 9c5ff32
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 138 deletions.
6 changes: 3 additions & 3 deletions pw_bluetooth_proxy/proxy_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ void ProxyHost::HandleH4HciFromHost(H4HciPacket h4_packet) {
}

void ProxyHost::ProcessH4HciFromController(H4HciPacket h4_packet) {
if (h4_packet.empty()) {
if (h4_packet.hci_span.empty()) {
PW_LOG_ERROR("Received empty H4 buffer. So will not process.");
return;
}

if (h4_packet[0] != cpp23::to_underlying(emboss::H4PacketType::EVENT)) {
if (h4_packet.h4_type != emboss::H4PacketType::EVENT) {
return;
}
pw::span hci_buffer = H4HciSubspan(h4_packet);
pw::span hci_buffer = h4_packet.hci_span;
auto event = MakeEmboss<emboss::EventHeaderView>(hci_buffer);
if (!event.IsComplete()) {
PW_LOG_ERROR("Buffer is too small for EventHeader. So will not process.");
Expand Down
Loading

0 comments on commit 9c5ff32

Please sign in to comment.