# Copyright 2023 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. import("//build_overrides/pigweed.gni") import("$dir_pw_unit_test/test.gni") config("public_include_path") { include_dirs = [ "public" ] } pw_source_set("hci") { sources = [ "acl_connection.cc", "advertising_handle_map.cc", "android_extended_low_energy_advertiser.cc", "bredr_connection.cc", "bredr_connection_request.cc", "connection.cc", "discovery_filter.cc", "extended_low_energy_advertiser.cc", "extended_low_energy_scanner.cc", "legacy_low_energy_advertiser.cc", "legacy_low_energy_scanner.cc", "low_energy_advertiser.cc", "low_energy_connection.cc", "low_energy_connector.cc", "low_energy_scanner.cc", "sco_connection.cc", "sequential_command_runner.cc", ] public = [ "public/pw_bluetooth_sapphire/internal/host/hci/acl_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/advertising_handle_map.h", "public/pw_bluetooth_sapphire/internal/host/hci/advertising_report_parser.h", "public/pw_bluetooth_sapphire/internal/host/hci/android_extended_low_energy_advertiser.h", "public/pw_bluetooth_sapphire/internal/host/hci/bredr_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/bredr_connection_request.h", "public/pw_bluetooth_sapphire/internal/host/hci/connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/discovery_filter.h", "public/pw_bluetooth_sapphire/internal/host/hci/extended_low_energy_advertiser.h", "public/pw_bluetooth_sapphire/internal/host/hci/extended_low_energy_scanner.h", "public/pw_bluetooth_sapphire/internal/host/hci/legacy_low_energy_advertiser.h", "public/pw_bluetooth_sapphire/internal/host/hci/legacy_low_energy_scanner.h", "public/pw_bluetooth_sapphire/internal/host/hci/local_address_delegate.h", "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_advertiser.h", "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_connector.h", "public/pw_bluetooth_sapphire/internal/host/hci/low_energy_scanner.h", "public/pw_bluetooth_sapphire/internal/host/hci/sco_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/sequential_command_runner.h", ] public_configs = [ ":public_include_path" ] public_deps = [ "$dir_pw_bluetooth_sapphire/host/common", "$dir_pw_bluetooth_sapphire/host/hci-spec", "$dir_pw_bluetooth_sapphire/host/transport", "$dir_pw_third_party/fuchsia:fit", ] deps = [ "$dir_pw_async:heap_dispatcher", "$dir_pw_bluetooth:emboss_hci_group", dir_pw_preprocessor, ] } pw_source_set("testing") { sources = [ "fake_bredr_connection.cc", "fake_local_address_delegate.cc", "fake_low_energy_connection.cc", "fake_sco_connection.cc", ] public = [ "public/pw_bluetooth_sapphire/internal/host/hci/fake_bredr_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/fake_local_address_delegate.h", "public/pw_bluetooth_sapphire/internal/host/hci/fake_low_energy_connection.h", "public/pw_bluetooth_sapphire/internal/host/hci/fake_sco_connection.h", ] public_configs = [ ":public_include_path" ] public_deps = [ ":hci", "$dir_pw_async:heap_dispatcher", "$dir_pw_bluetooth_sapphire/host/common", ] } pw_test("hci_test") { enable_if = pw_unit_test_BACKEND == "$dir_pw_unit_test:googletest" sources = [ "advertising_handle_map_test.cc", "connection_test.cc", "discovery_filter_test.cc", "extended_low_energy_advertiser_test.cc", "extended_low_energy_scanner_test.cc", "legacy_low_energy_advertiser_test.cc", "legacy_low_energy_scanner_test.cc", "low_energy_advertiser_test.cc", "low_energy_connector_test.cc", "low_energy_multiple_advertising_test.cc", "low_energy_scanner_test.cc", "sequential_command_runner_test.cc", ] test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" deps = [ ":testing", "$dir_pw_bluetooth:emboss_hci_test", "$dir_pw_bluetooth_sapphire/host/testing", "$dir_pw_bluetooth_sapphire/host/testing:fake_controller", "$dir_pw_bluetooth_sapphire/host/testing:gtest_helpers", "$dir_pw_bluetooth_sapphire/host/testing:mock_controller", "$dir_pw_bluetooth_sapphire/host/testing:test_helpers", "$dir_pw_bluetooth_sapphire/host/transport:testing", ] } pw_test_group("tests") { tests = [ ":hci_test" ] }