• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Pigweed Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 #pragma once
16 
17 #include "pw_bluetooth/hci_h4.emb.h"
18 #include "pw_function/function.h"
19 #include "pw_span/span.h"
20 
21 namespace pw::bluetooth::proxy {
22 
23 // An H4 HCI packet. `h4_type` should be the HCI packet type indicator as
24 // defined in BT Core Spec Version 5.4 | Vol 4, Part A, Section 2. The
25 // `hci_span` should be an HCI packet as defined in BT Core Spec Version 5.4 |
26 // Vol 4, Part E, Section 5.4.
27 struct H4HciPacket {
28   emboss::H4PacketType h4_type;
29   pw::span<uint8_t> hci_span;
30 };
31 
32 using H4HciPacketSendFn = pw::Function<void(H4HciPacket packet)>;
33 
34 }  // namespace pw::bluetooth::proxy
35