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 "gatt_defs.cc", 25 ], 26 deps = [ 27 "//pw_bluetooth_sapphire:public", 28 "//pw_bluetooth_sapphire/host/att:definitions", 29 ], 30) 31 32cc_library( 33 name = "gatt", 34 srcs = [ 35 "client.cc", 36 "connection.cc", 37 "gatt.cc", 38 "generic_attribute_service.cc", 39 "local_service_manager.cc", 40 "remote_characteristic.cc", 41 "remote_service.cc", 42 "remote_service_manager.cc", 43 "server.cc", 44 "types.cc", 45 ], 46 deps = [ 47 ":definitions", 48 "//pw_bluetooth_sapphire:public", 49 "//pw_bluetooth_sapphire/host/att", 50 "//third_party/fuchsia:fit", 51 ], 52) 53 54cc_library( 55 name = "testing", 56 testonly = True, 57 srcs = [ 58 "fake_client.cc", 59 "fake_layer.cc", 60 "mock_server.cc", 61 ], 62 deps = [ 63 ":gatt", 64 "//pw_async:heap_dispatcher", 65 "//pw_bluetooth_sapphire:public", 66 "//pw_bluetooth_sapphire/host/common", 67 "//pw_bluetooth_sapphire/host/common:uuid_string_util", 68 "//pw_unit_test", 69 ], 70) 71 72pw_cc_test( 73 name = "gatt_test", 74 srcs = [ 75 "client_test.cc", 76 "gatt_test.cc", 77 "generic_attribute_service_test.cc", 78 "local_service_manager_test.cc", 79 "remote_service_manager_test.cc", 80 "server_test.cc", 81 ], 82 test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", 83 deps = [ 84 ":gatt", 85 ":testing", 86 "//pw_bluetooth_sapphire/host/att", 87 "//pw_bluetooth_sapphire/host/l2cap:testing", 88 "//pw_bluetooth_sapphire/host/testing", 89 ], 90) 91