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") 16 17package(default_visibility = ["//visibility:public"]) 18 19exports_files(glob(["**/*"])) 20 21cc_library( 22 name = "definitions", 23 srcs = [ 24 "gap.cc", 25 ], 26 deps = [ 27 "//pw_bluetooth_sapphire:public", 28 "//pw_bluetooth_sapphire/host/common", 29 ], 30) 31 32cc_library( 33 name = "gap", 34 srcs = [ 35 "adapter.cc", 36 "android_vendor_capabilities.cc", 37 "bredr_connection.cc", 38 "bredr_connection_manager.cc", 39 "bredr_connection_request.cc", 40 "bredr_discovery_manager.cc", 41 "bredr_interrogator.cc", 42 "discovery_filter.cc", 43 "generic_access_client.cc", 44 "identity_resolving_list.cc", 45 "legacy_pairing_state.cc", 46 "low_energy_address_manager.cc", 47 "low_energy_advertising_manager.cc", 48 "low_energy_connection.cc", 49 "low_energy_connection_handle.cc", 50 "low_energy_connection_manager.cc", 51 "low_energy_connection_request.cc", 52 "low_energy_connector.cc", 53 "low_energy_discovery_manager.cc", 54 "low_energy_interrogator.cc", 55 "pairing_state_manager.cc", 56 "peer.cc", 57 "peer_cache.cc", 58 "peer_metrics.cc", 59 "secure_simple_pairing_state.cc", 60 "types.cc", 61 ], 62 deps = [ 63 ":definitions", 64 "//pw_bluetooth_sapphire:public", 65 "//pw_bluetooth_sapphire/host/common", 66 "//pw_bluetooth_sapphire/host/gatt", 67 "//pw_bluetooth_sapphire/host/hci", 68 "//pw_bluetooth_sapphire/host/iso", 69 "//pw_bluetooth_sapphire/host/l2cap", 70 "//pw_bluetooth_sapphire/host/sco", 71 "//pw_bluetooth_sapphire/host/sdp", 72 "//pw_bluetooth_sapphire/host/sm:definitions", 73 "@pigweed//pw_async:heap_dispatcher", 74 "@pigweed//pw_bluetooth", 75 "@pigweed//pw_string:utf_codecs", 76 "@pigweed//third_party/fuchsia:fit", 77 ], 78) 79 80cc_library( 81 name = "testing", 82 testonly = True, 83 srcs = [ 84 "fake_adapter.cc", 85 "fake_pairing_delegate.cc", 86 ], 87 deps = [ 88 ":gap", 89 "//pw_bluetooth_sapphire:public", 90 "//pw_bluetooth_sapphire/host/hci:testing", 91 "//pw_bluetooth_sapphire/host/l2cap:testing", 92 "@pigweed//pw_unit_test", 93 ], 94) 95 96pw_cc_test( 97 name = "gap_test", 98 srcs = [ 99 "adapter_test.cc", 100 "android_vendor_capabilities_test.cc", 101 "bredr_connection_manager_test.cc", 102 "bredr_connection_request_test.cc", 103 "bredr_discovery_manager_test.cc", 104 "bredr_interrogator_test.cc", 105 "discovery_filter_test.cc", 106 "fake_pairing_delegate_test.cc", 107 "identity_resolving_list_test.cc", 108 "legacy_pairing_state_test.cc", 109 "low_energy_address_manager_test.cc", 110 "low_energy_advertising_manager_test.cc", 111 "low_energy_connection_manager_test.cc", 112 "low_energy_discovery_manager_test.cc", 113 "low_energy_interrogator_test.cc", 114 "peer_cache_test.cc", 115 "peer_test.cc", 116 "secure_simple_pairing_state_test.cc", 117 "types_test.cc", 118 ], 119 test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", 120 deps = [ 121 ":gap", 122 ":testing", 123 "//pw_bluetooth_sapphire/host/common", 124 "//pw_bluetooth_sapphire/host/gatt:testing", 125 "//pw_bluetooth_sapphire/host/hci:testing", 126 "//pw_bluetooth_sapphire/host/l2cap:testing", 127 "//pw_bluetooth_sapphire/host/sm", 128 "//pw_bluetooth_sapphire/host/sm:testing", 129 "//pw_bluetooth_sapphire/host/testing", 130 ], 131) 132