| # Copyright 2025 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_pigweed/third_party/emboss/emboss.gni") |
| import("$dir_pw_async2/backend.gni") |
| import("$dir_pw_chrono/backend.gni") |
| import("$dir_pw_sync/backend.gni") |
| import("$dir_pw_unit_test/test.gni") |
| |
| config("public_include_path") { |
| include_dirs = [ "public" ] |
| visibility = [ ":*" ] |
| } |
| |
| pw_source_set("types") { |
| # LINT.IfChange |
| public = [ "public/pw_bluetooth_proxy/hci/types.h" ] |
| public_configs = [ ":public_include_path" ] |
| |
| # LINT.ThenChange(Android.bp, BUILD.bazel, CMakeLists.txt) |
| } |
| |
| pw_source_set("command_multiplexer") { |
| # LINT.IfChange |
| public = [ |
| "public/pw_bluetooth_proxy/hci/command_multiplexer.h", |
| "public/pw_bluetooth_proxy/hci/internal/type_safe_ids.h", |
| ] |
| public_configs = [ ":public_include_path" ] |
| public_deps = [ |
| "$dir_pw_assert:check", |
| "$dir_pw_async2:pw_async2", |
| "$dir_pw_async2:time_provider", |
| "$dir_pw_bluetooth:emboss_hci_commands", |
| "$dir_pw_bluetooth:emboss_hci_common", |
| "$dir_pw_bluetooth:emboss_hci_events", |
| "$dir_pw_bluetooth:emboss_hci_h4", |
| "$dir_pw_bluetooth_proxy:clock", |
| "$dir_pw_containers:dynamic_hash_map", |
| "$dir_pw_containers:dynamic_queue", |
| "$dir_pw_function", |
| "$dir_pw_log", |
| "$dir_pw_multibuf/v2:multibuf", |
| "$dir_pw_result", |
| "$dir_pw_result:expected", |
| "$dir_pw_span", |
| "$dir_pw_status", |
| "$dir_pw_sync:lock_annotations", |
| "$dir_pw_sync:mutex", |
| ] |
| sources = [ "command_multiplexer.cc" ] |
| |
| # LINT.ThenChange(Android.bp, BUILD.bazel, CMakeLists.txt) |
| visibility = [ ":*" ] |
| } |
| |
| pw_source_set("sniff_offload") { |
| # LINT.IfChange |
| sources = [ "sniff_offload_manager.cc" ] |
| public_configs = [ ":public_include_path" ] |
| public = [ "public/pw_bluetooth_proxy/hci/sniff_offload_manager.h" ] |
| public_deps = [ |
| ":types", |
| "$dir_pw_allocator", |
| "$dir_pw_assert:check", |
| "$dir_pw_async2", |
| "$dir_pw_async2:channel", |
| "$dir_pw_async2:time_provider", |
| "$dir_pw_bluetooth:emboss_hci_android", |
| "$dir_pw_bluetooth:emboss_hci_commands", |
| "$dir_pw_bluetooth:emboss_hci_common", |
| "$dir_pw_bluetooth:emboss_hci_data", |
| "$dir_pw_bluetooth:emboss_hci_events", |
| "$dir_pw_bluetooth:emboss_util", |
| "$dir_pw_bluetooth_proxy:clock", |
| "$dir_pw_containers:dynamic_map", |
| "$dir_pw_function", |
| "$dir_pw_multibuf/v2:multibuf", |
| "$dir_pw_sync:lock_annotations", |
| "$dir_pw_sync:mutex", |
| ] |
| |
| # LINT.ThenChange(Android.bp, BUILD.bazel, CMakeLists.txt) |
| } |
| |
| pw_test("command_multiplexer_test") { |
| # For now, disable if there's no system timer backend. In the future we will |
| # want to remove this restriction since async2 will be the normal way to |
| # handle timeouts. |
| enable_if = |
| pw_chrono_SYSTEM_TIMER_BACKEND != "" && dir_pw_third_party_emboss != "" |
| |
| # LINT.IfChange |
| sources = [ "command_multiplexer_test.cc" ] |
| deps = [ |
| ":command_multiplexer", |
| "$dir_pw_allocator:testing", |
| "$dir_pw_async2:simulated_time_provider", |
| "$dir_pw_async2:testing", |
| "$dir_pw_containers:vector", |
| ] |
| |
| # LINT.ThenChange(Android.bp, BUILD.bazel, CMakeLists.txt) |
| } |
| |
| pw_test("sniff_offload_manager_test") { |
| enable_if = pw_async2_DISPATCHER_FOR_TEST_BACKEND != "" && |
| pw_thread_TEST_THREAD_CONTEXT_BACKEND != "" && |
| dir_pw_third_party_emboss != "" |
| |
| # LINT.IfChange |
| sources = [ "sniff_offload_manager_test.cc" ] |
| deps = [ |
| ":sniff_offload", |
| "$dir_pw_allocator:synchronized_allocator", |
| "$dir_pw_allocator:testing", |
| "$dir_pw_async2:simulated_time_provider", |
| "$dir_pw_async2:testing", |
| "$dir_pw_bluetooth_proxy:clock", |
| "$dir_pw_function", |
| "$dir_pw_thread:sleep", |
| "$dir_pw_thread:test_thread_context", |
| "$dir_pw_thread:thread", |
| ] |
| |
| # LINT.ThenChange(Android.bp, BUILD.gn, CMakeLists.txt) |
| } |
| |
| pw_test_group("tests") { |
| tests = [ |
| ":command_multiplexer_test", |
| ":sniff_offload_manager_test", |
| ] |
| } |