1# Copyright 2021 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_fuzzer:fuzzer.bzl", "pw_cc_fuzz_test") 19load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 20 21package( 22 default_visibility = ["//visibility:public"], 23 features = ["-layering_check"], 24) 25 26licenses(["notice"]) 27 28cc_library( 29 name = "pw_bluetooth_hci", 30 deps = [ 31 ":packet", 32 ":uart_transport", 33 ], 34) 35 36cc_library( 37 name = "packet", 38 srcs = [ 39 "packet.cc", 40 ], 41 hdrs = [ 42 "public/pw_bluetooth_hci/packet.h", 43 ], 44 strip_include_prefix = "public", 45 deps = [ 46 "//pw_assert:assert", 47 "//pw_bytes", 48 "//pw_bytes:bit", 49 "//pw_result", 50 "//pw_status", 51 ], 52) 53 54cc_library( 55 name = "uart_transport", 56 srcs = [ 57 "uart_transport.cc", 58 ], 59 hdrs = [ 60 "public/pw_bluetooth_hci/uart_transport.h", 61 ], 62 strip_include_prefix = "public", 63 deps = [ 64 ":packet", 65 "//pw_bytes", 66 "//pw_bytes:bit", 67 "//pw_function", 68 "//pw_status", 69 ], 70) 71 72pw_cc_test( 73 name = "packet_test", 74 srcs = ["packet_test.cc"], 75 deps = [ 76 ":packet", 77 "//pw_bytes", 78 "//pw_containers:algorithm", 79 "//pw_status", 80 ], 81) 82 83pw_cc_test( 84 name = "uart_transport_test", 85 srcs = ["uart_transport_test.cc"], 86 deps = [ 87 ":packet", 88 ":uart_transport", 89 "//pw_bytes", 90 "//pw_status", 91 ], 92) 93 94pw_cc_fuzz_test( 95 name = "uart_transport_fuzzer", 96 srcs = ["uart_transport_fuzzer.cc"], 97 deps = [ 98 ":packet", 99 ":uart_transport", 100 "//pw_bytes", 101 "//pw_status", 102 "//pw_stream", 103 ], 104) 105 106sphinx_docs_library( 107 name = "docs", 108 srcs = [ 109 "docs.rst", 110 ], 111 prefix = "pw_bluetooth_hci/", 112 target_compatible_with = incompatible_with_mcu(), 113) 114