diff --git a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h index d35bc8e8d9..6788dea4ec 100644 --- a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h +++ b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h @@ -13,6 +13,9 @@ // the License. #pragma once +#include +#include + #include #include "pw_bluetooth_sapphire/internal/host/common/macros.h" @@ -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;