• 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
15load("@pigweed//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
16load("@rules_cc//cc:cc_library.bzl", "cc_library")
17
18package(
19    default_visibility = ["//visibility:public"],
20    features = ["-layering_check"],
21)
22
23cc_library(
24    name = "transport",
25    srcs = [
26        "acl_data_channel.cc",
27        "acl_data_packet.cc",
28        "command_channel.cc",
29        "control_packets.cc",
30        "error.cc",
31        "iso_data_channel.cc",
32        "link_type.cc",
33        "sco_data_channel.cc",
34        "sco_data_packet.cc",
35        "transport.cc",
36    ],
37    hdrs = [
38        "public/pw_bluetooth_sapphire/internal/host/transport/acl_data_channel.h",
39        "public/pw_bluetooth_sapphire/internal/host/transport/acl_data_packet.h",
40        "public/pw_bluetooth_sapphire/internal/host/transport/command_channel.h",
41        "public/pw_bluetooth_sapphire/internal/host/transport/control_packets.h",
42        "public/pw_bluetooth_sapphire/internal/host/transport/data_buffer_info.h",
43        "public/pw_bluetooth_sapphire/internal/host/transport/emboss_packet.h",
44        "public/pw_bluetooth_sapphire/internal/host/transport/error.h",
45        "public/pw_bluetooth_sapphire/internal/host/transport/iso_data_channel.h",
46        "public/pw_bluetooth_sapphire/internal/host/transport/link_type.h",
47        "public/pw_bluetooth_sapphire/internal/host/transport/packet.h",
48        "public/pw_bluetooth_sapphire/internal/host/transport/sco_data_channel.h",
49        "public/pw_bluetooth_sapphire/internal/host/transport/sco_data_packet.h",
50        "public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h",
51        "public/pw_bluetooth_sapphire/internal/host/transport/transport.h",
52    ],
53    strip_include_prefix = "public",
54    tags = ["noclangtidy"],
55    deps = [
56        "//pw_async:dispatcher",
57        "//pw_async:task",
58        "//pw_bluetooth",
59        "//pw_bluetooth:emboss_hci_common",
60        "//pw_bluetooth_sapphire/host/common",
61        "//pw_bluetooth_sapphire/host/hci-spec",
62        "//third_party/fuchsia:fit",
63    ],
64)
65
66cc_library(
67    name = "testing",
68    testonly = True,
69    srcs = [
70        "fake_sco_data_channel.cc",
71        "mock_acl_data_channel.cc",
72    ],
73    hdrs = [
74        "public/pw_bluetooth_sapphire/internal/host/transport/fake_acl_connection.h",
75        "public/pw_bluetooth_sapphire/internal/host/transport/fake_sco_data_channel.h",
76        "public/pw_bluetooth_sapphire/internal/host/transport/mock_acl_data_channel.h",
77    ],
78    strip_include_prefix = "public",
79    tags = ["noclangtidy"],
80    deps = [
81        ":transport",
82    ],
83)
84
85pw_cc_test(
86    name = "transport_test",
87    srcs = [
88        "acl_data_channel_test.cc",
89        "command_channel_test.cc",
90        "control_packets_test.cc",
91        "iso_data_channel_test.cc",
92        "packet_test.cc",
93        "sco_data_channel_test.cc",
94        "sco_data_packet_test.cc",
95        "slab_allocators_test.cc",
96        "transport_test.cc",
97    ],
98    test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main",
99    deps = [
100        ":testing",
101        ":transport",
102        "//pw_bluetooth:emboss_hci_test",
103        "//pw_bluetooth_sapphire/host/testing",
104        "//pw_bluetooth_sapphire/host/testing:mock_controller",
105        "//pw_bluetooth_sapphire/host/testing:test_helpers",
106    ],
107)
108