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( 16 "@fuchsia_sdk//fuchsia:defs.bzl", 17 "fuchsia_cc_library", 18 "fuchsia_cc_test", 19 "fuchsia_unittest_package", 20) 21load("//pw_bluetooth_sapphire/fuchsia:fuchsia_api_level.bzl", "FUCHSIA_API_LEVEL") 22 23package(default_visibility = ["//visibility:public"]) 24 25fuchsia_cc_library( 26 name = "public", 27 hdrs = [ 28 "public/pw_bluetooth_sapphire/fuchsia/host/controllers/fidl_controller.h", 29 "public/pw_bluetooth_sapphire/fuchsia/host/controllers/helpers.h", 30 ], 31 strip_include_prefix = "public", 32) 33 34fuchsia_cc_library( 35 name = "controllers", 36 deps = [ 37 ":fidl_controller", 38 ], 39) 40 41fuchsia_cc_library( 42 name = "helpers", 43 srcs = [ 44 "helpers.cc", 45 ], 46 deps = [ 47 ":public", 48 "@fuchsia_sdk//pkg/zx", 49 "@pigweed//pw_bluetooth", 50 ], 51) 52 53fuchsia_cc_library( 54 name = "fidl_controller", 55 srcs = [ 56 "fidl_controller.cc", 57 ], 58 deps = [ 59 ":helpers", 60 ":public", 61 "//pw_bluetooth_sapphire/host/common", 62 "//pw_bluetooth_sapphire/host/iso", 63 "//pw_bluetooth_sapphire/host/transport", 64 "@fuchsia_sdk//fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp", 65 "@fuchsia_sdk//pkg/async-cpp", 66 "@fuchsia_sdk//pkg/zx", 67 "@pigweed//pw_bluetooth", 68 ], 69) 70 71fuchsia_cc_test( 72 name = "controllers_test", 73 testonly = True, 74 srcs = [ 75 "fidl_controller_test.cc", 76 ], 77 death_unittest = True, 78 visibility = ["//visibility:public"], 79 deps = [ 80 ":controllers", 81 "//pw_bluetooth_sapphire/fuchsia/host/fidl:fake_vendor_server", 82 "//pw_bluetooth_sapphire/host/testing", 83 "//pw_bluetooth_sapphire/host/testing:gtest_main", 84 "//pw_bluetooth_sapphire/host/testing:loop_fixture", 85 "//pw_bluetooth_sapphire/host/testing:test_helpers", 86 ], 87) 88 89fuchsia_unittest_package( 90 name = "test_pkg", 91 package_name = "controllers_tests", 92 testonly = True, 93 fuchsia_api_level = FUCHSIA_API_LEVEL, 94 unit_tests = [ 95 ":controllers_test", 96 ], 97 visibility = ["//visibility:public"], 98) 99