1# Copyright 2023 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 15import("//build_overrides/pigweed.gni") 16import("$dir_pw_unit_test/test.gni") 17 18config("public_include_path") { 19 include_dirs = [ "public" ] 20} 21 22pw_source_set("hci") { 23 sources = [ 24 "acl_connection.cc", 25 "advertising_handle_map.cc", 26 "android_extended_low_energy_advertiser.cc", 27 "bredr_connection.cc", 28 "bredr_connection_request.cc", 29 "connection.cc", 30 "discovery_filter.cc", 31 "extended_low_energy_advertiser.cc", 32 "extended_low_energy_scanner.cc", 33 "legacy_low_energy_advertiser.cc", 34 "legacy_low_energy_scanner.cc", 35 "low_energy_advertiser.cc", 36 "low_energy_connection.cc", 37 "low_energy_connector.cc", 38 "low_energy_scanner.cc", 39 "sco_connection.cc", 40 "sequential_command_runner.cc", 41 ] 42 public = [ 43 "public/pw_bluetooth_sapphire/internal/host/hci/acl_connection.h", 44 "public/pw_bluetooth_sapphire/internal/host/hci/advertising_handle_map.h", 45 "public/pw_bluetooth_sapphire/internal/host/hci/advertising_report_parser.h", 46 "public/pw_bluetooth_sapphire/internal/host/hci/android_extended_low_energy_advertiser.h", 47 "public/pw_bluetooth_sapphire/internal/host/hci/bredr_connection.h", 48 "public/pw_bluetooth_sapphire/internal/host/hci/bredr_connection_request.h", 49 "public/pw_bluetooth_sapphire/internal/host/hci/connection.h", 50 "public/pw_bluetooth_sapphire/internal/host/hci/discovery_filter.h", 51 "public/pw_bluetooth_sapphire/internal/host/hci/extended_low_energy_advertiser.h", 52 "public/pw_bluetooth_sapphire/internal/host/hci/extended_low_energy_scanner.h", 53 "public/pw_bluetooth_sapphire/internal/host/hci/legacy_low_energy_advertiser.h", 54 "public/pw_bluetooth_sapphire/internal/host/hci/legacy_low_energy_scanner.h", 55 "public/pw_bluetooth_sapphire/internal/host/hci/local_address_delegate.h", 56 "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_advertiser.h", 57 "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_connection.h", 58 "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_connector.h", 59 "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_scanner.h", 60 "public/pw_bluetooth_sapphire/internal/host/hci/sco_connection.h", 61 "public/pw_bluetooth_sapphire/internal/host/hci/sequential_command_runner.h", 62 ] 63 public_configs = [ ":public_include_path" ] 64 public_deps = [ 65 "$dir_pw_bluetooth_sapphire/host/common", 66 "$dir_pw_bluetooth_sapphire/host/hci-spec", 67 "$dir_pw_bluetooth_sapphire/host/transport", 68 "$dir_pw_third_party/fuchsia:fit", 69 ] 70 deps = [ 71 "$dir_pw_async:heap_dispatcher", 72 "$dir_pw_bluetooth:emboss_hci_group", 73 dir_pw_preprocessor, 74 ] 75} 76 77pw_source_set("testing") { 78 sources = [ 79 "fake_bredr_connection.cc", 80 "fake_local_address_delegate.cc", 81 "fake_low_energy_connection.cc", 82 "fake_sco_connection.cc", 83 ] 84 public = [ 85 "public/pw_bluetooth_sapphire/internal/host/hci/fake_bredr_connection.h", 86 "public/pw_bluetooth_sapphire/internal/host/hci/fake_local_address_delegate.h", 87 "public/pw_bluetooth_sapphire/internal/host/hci/fake_low_energy_connection.h", 88 "public/pw_bluetooth_sapphire/internal/host/hci/fake_sco_connection.h", 89 ] 90 public_configs = [ ":public_include_path" ] 91 public_deps = [ 92 ":hci", 93 "$dir_pw_async:heap_dispatcher", 94 "$dir_pw_bluetooth_sapphire/host/common", 95 ] 96} 97 98pw_test("hci_test") { 99 enable_if = pw_unit_test_BACKEND == "$dir_pw_unit_test:googletest" 100 sources = [ 101 "advertising_handle_map_test.cc", 102 "connection_test.cc", 103 "discovery_filter_test.cc", 104 "extended_low_energy_advertiser_test.cc", 105 "extended_low_energy_scanner_test.cc", 106 "legacy_low_energy_advertiser_test.cc", 107 "legacy_low_energy_scanner_test.cc", 108 "low_energy_advertiser_test.cc", 109 "low_energy_connector_test.cc", 110 "low_energy_multiple_advertising_test.cc", 111 "low_energy_scanner_test.cc", 112 "sequential_command_runner_test.cc", 113 ] 114 test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" 115 deps = [ 116 ":testing", 117 "$dir_pw_bluetooth:emboss_hci_test", 118 "$dir_pw_bluetooth_sapphire/host/testing", 119 "$dir_pw_bluetooth_sapphire/host/testing:fake_controller", 120 "$dir_pw_bluetooth_sapphire/host/testing:gtest_helpers", 121 "$dir_pw_bluetooth_sapphire/host/testing:mock_controller", 122 "$dir_pw_bluetooth_sapphire/host/testing:test_helpers", 123 "$dir_pw_bluetooth_sapphire/host/transport:testing", 124 ] 125} 126 127pw_test_group("tests") { 128 tests = [ ":hci_test" ] 129} 130