Skip to content

Commit

Permalink
pw_bluetooth_sapphire: Use packet header definitions from Emboss
Browse files Browse the repository at this point in the history
Replace uses of EventHeader and ACLDataHeader with definitions
from Emboss.

Bug: 42167863
Test: fx test //src/connectivity/bluetooth/core/bt-host
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1097113
GitOrigin-RevId: 6efc50f64607c9432c4bfd2e63503e698104baca
Change-Id: Id373bb06d76fc22493dc1ce2a2815cf0001f31ab
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230556
Reviewed-by: Lulu Wang <[email protected]>
Commit-Queue: Jason Graffius <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
josh-conner authored and CQ Bot Account committed Aug 23, 2024
1 parent eb5d242 commit 7176f39
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// the License.

#pragma once
#include <pw_bluetooth/hci_common.emb.h>
#include <pw_bluetooth/hci_data.emb.h>

#include <memory>

#include "pw_bluetooth_sapphire/internal/host/common/macros.h"
Expand All @@ -35,26 +38,30 @@ constexpr size_t kMaxNumSlabs = 100;
// The largest possible control packet size.
constexpr size_t kMaxEventPayloadSize = hci_spec::kMaxEventPacketPayloadSize;
constexpr size_t kMaxEventPacketSize =
sizeof(hci_spec::EventHeader) + kMaxEventPayloadSize;
pw::bluetooth::emboss::EventHeader::IntrinsicSizeInBytes() +
kMaxEventPayloadSize;
constexpr size_t kMaxNumEventPackets =
kMaxControlSlabSize / kMaxEventPacketSize;

// Large, medium, and small buffer sizes for ACL data packets.
constexpr size_t kLargeACLDataPayloadSize = hci_spec::kMaxACLPayloadSize;
constexpr size_t kLargeACLDataPacketSize =
sizeof(hci_spec::ACLDataHeader) + kLargeACLDataPayloadSize;
pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() +
kLargeACLDataPayloadSize;
constexpr size_t kNumLargeACLDataPackets =
kMaxACLSlabSize / kLargeACLDataPacketSize;

constexpr size_t kMediumACLDataPayloadSize = 256;
constexpr size_t kMediumACLDataPacketSize =
sizeof(hci_spec::ACLDataHeader) + kMediumACLDataPayloadSize;
pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() +
kMediumACLDataPayloadSize;
constexpr size_t kNumMediumACLDataPackets =
kMaxACLSlabSize / kMediumACLDataPacketSize;

constexpr size_t kSmallACLDataPayloadSize = 64;
constexpr size_t kSmallACLDataPacketSize =
sizeof(hci_spec::ACLDataHeader) + kSmallACLDataPayloadSize;
pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() +
kSmallACLDataPayloadSize;
constexpr size_t kNumSmallACLDataPackets =
kMaxACLSlabSize / kSmallACLDataPacketSize;

Expand Down

0 comments on commit 7176f39

Please sign in to comment.