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("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 19 20package( 21 default_visibility = ["//visibility:public"], 22 features = ["-layering_check"], 23) 24 25# Basic target with protocol definitions and no logic, suitable for test 26# emulation. 27cc_library( 28 name = "definitions", 29 srcs = [ 30 "packet.cc", 31 ], 32 hdrs = [ 33 "public/pw_bluetooth_sapphire/internal/host/att/att.h", 34 "public/pw_bluetooth_sapphire/internal/host/att/packet.h", 35 ], 36 strip_include_prefix = "public", 37 tags = ["noclangtidy"], 38 deps = [ 39 "//pw_bluetooth_sapphire/host/common", 40 "//pw_bluetooth_sapphire/host/hci-spec", 41 "//pw_bluetooth_sapphire/host/l2cap:definitions", 42 ], 43) 44 45cc_library( 46 name = "att", 47 srcs = [ 48 "attribute.cc", 49 "bearer.cc", 50 "database.cc", 51 "error.cc", 52 "permissions.cc", 53 "write_queue.cc", 54 ], 55 hdrs = [ 56 "public/pw_bluetooth_sapphire/internal/host/att/attribute.h", 57 "public/pw_bluetooth_sapphire/internal/host/att/bearer.h", 58 "public/pw_bluetooth_sapphire/internal/host/att/database.h", 59 "public/pw_bluetooth_sapphire/internal/host/att/error.h", 60 "public/pw_bluetooth_sapphire/internal/host/att/permissions.h", 61 "public/pw_bluetooth_sapphire/internal/host/att/write_queue.h", 62 ], 63 implementation_deps = [ 64 "//pw_preprocessor", 65 "//pw_string", 66 ], 67 strip_include_prefix = "public", 68 tags = ["noclangtidy"], 69 deps = [ 70 ":definitions", 71 "//pw_async:dispatcher", 72 "//pw_bluetooth_sapphire/host/common", 73 "//pw_bluetooth_sapphire/host/l2cap", 74 "//pw_bluetooth_sapphire/host/sm:definitions", 75 "//third_party/fuchsia:fit", 76 ], 77) 78 79pw_cc_test( 80 name = "att_test", 81 srcs = [ 82 "attribute_test.cc", 83 "bearer_test.cc", 84 "database_test.cc", 85 "error_test.cc", 86 "permissions_test.cc", 87 ], 88 test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", 89 deps = [ 90 ":att", 91 "//pw_bluetooth_sapphire/host/l2cap:testing", 92 "//pw_bluetooth_sapphire/host/testing:test_helpers", 93 ], 94) 95 96sphinx_docs_library( 97 name = "docs", 98 srcs = [ 99 "docs.rst", 100 ], 101 target_compatible_with = incompatible_with_mcu(), 102) 103