| # Copyright 2018 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/driver_package.gni") |
| import("//build/fuzzing/fuzzer.gni") |
| import("//src/sys/build/components.gni") |
| |
| bind_rules("bt_host_bind") { |
| rules = "bt_host.bind" |
| output = "bt_host_bind.h" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.bluetooth" ] |
| } |
| |
| driver_module("driver") { |
| output_name = "bt-host" |
| |
| sources = [ "driver.cc" ] |
| |
| deps = [ |
| ":bt_host_bind", |
| ":sources", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| ] |
| } |
| |
| # Conversions between host FIDL and internal library types. |
| source_set("fidl_helpers") { |
| sources = [ |
| "fidl/helpers.cc", |
| "fidl/helpers.h", |
| ] |
| public_deps = [ |
| "common", |
| "gap", |
| "gatt", |
| "sdp", |
| "//sdk/fidl/fuchsia.bluetooth", |
| "//sdk/fidl/fuchsia.bluetooth.gatt", |
| "//src/connectivity/bluetooth/fidl:host", |
| ] |
| } |
| |
| source_set("sources") { |
| sources = [ |
| "gatt_host.cc", |
| "gatt_host.h", |
| "gatt_remote_service_device.cc", |
| "gatt_remote_service_device.h", |
| "host.cc", |
| "host.h", |
| "host_device.cc", |
| "host_device.h", |
| |
| # FIDL servers |
| "fidl/gatt_client_server.cc", |
| "fidl/gatt_client_server.h", |
| "fidl/gatt_remote_service_server.cc", |
| "fidl/gatt_remote_service_server.h", |
| "fidl/gatt_server_server.cc", |
| "fidl/gatt_server_server.h", |
| "fidl/host_server.cc", |
| "fidl/host_server.h", |
| "fidl/low_energy_central_server.cc", |
| "fidl/low_energy_central_server.h", |
| "fidl/low_energy_connection_server.cc", |
| "fidl/low_energy_connection_server.h", |
| "fidl/low_energy_peripheral_server.cc", |
| "fidl/low_energy_peripheral_server.h", |
| "fidl/profile_server.cc", |
| "fidl/profile_server.h", |
| "fidl/server_base.h", |
| ] |
| |
| deps = [ |
| "//src/devices/lib/driver", |
| "//zircon/system/ulib/inspect", |
| ] |
| |
| public_deps = [ |
| ":fidl_helpers", |
| ":stack", |
| "//sdk/banjo/fuchsia.hardware.bt.gattsvc", |
| "//sdk/banjo/fuchsia.hardware.bt.vendor", |
| "//sdk/fidl/fuchsia.bluetooth", |
| "//sdk/fidl/fuchsia.bluetooth.gatt", |
| "//sdk/fidl/fuchsia.bluetooth.le", |
| "//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_c", |
| "//src/connectivity/bluetooth/fidl:host", |
| "//src/connectivity/bluetooth/lib/fidl", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/fxl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| } |
| |
| group("stack") { |
| public_deps = [ |
| "att", |
| "cobalt:base", |
| "cobalt:real", |
| "common", |
| "gap", |
| "gatt", |
| "hci", |
| "l2cap", |
| "sco", |
| "sdp", |
| "sm", |
| "socket", |
| ] |
| } |
| |
| # TODO(armansito): Enable debug assertions by default from here for all package |
| # dependencies when there is a way for it. |
| driver_package("bt-host") { |
| deps = [ ":driver" ] |
| |
| drivers = [ |
| { |
| name = "bt-host.so" |
| }, |
| ] |
| } |
| |
| # Unit tests for driver code, not including the Bluetooth stack unit tests |
| # defined in subdirectories. |
| source_set("driver_tests") { |
| testonly = true |
| |
| sources = [ |
| "fidl/adapter_test_fixture.cc", |
| "fidl/adapter_test_fixture.h", |
| "fidl/gatt_client_server_unittest.cc", |
| "fidl/gatt_remote_service_server_unittest.cc", |
| "fidl/helpers_unittest.cc", |
| "fidl/host_server_unittest.cc", |
| "fidl/low_energy_central_server_unittest.cc", |
| "fidl/low_energy_peripheral_server_unittest.cc", |
| "fidl/profile_server_unittest.cc", |
| "gatt_host_unittest.cc", |
| ] |
| |
| deps = [ |
| ":sources", |
| "gap:testing", |
| "gatt:testing", |
| "testing:fake_controller", |
| "testing:testing", |
| "//sdk/lib/inspect/testing/cpp:cpp", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("tests") { |
| testonly = true |
| |
| output_name = "bt-host-unittests" |
| |
| deps = [ |
| ":driver_tests", |
| "att:tests", |
| "cobalt:tests", |
| "common:tests", |
| "gap:tests", |
| "gatt:tests", |
| "hci:tests", |
| "l2cap:tests", |
| "sco:tests", |
| "sdp:tests", |
| "sm:tests", |
| "socket:tests", |
| "testing:gtest_main", |
| "//src/devices/lib/driver", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("bt-host-tests") { |
| deps = [ "sco:sco-tests" ] |
| } |
| |
| fuzzers_package("fuzzers") { |
| package_name = "bt-host-fuzzers" |
| fuzzers = [ |
| "l2cap:l2cap_fuzzer", |
| "l2cap:basic_mode_rx_engine_fuzzer", |
| "l2cap:enhanced_retransmission_mode_engines_fuzzer", |
| "l2cap:bredr_dynamic_channel_registry_fuzzer", |
| "l2cap:channel_configuration_fuzzer", |
| "l2cap:common_handler_fuzzer", |
| "sdp:data_element_fuzzer", |
| "sdp:pdu_fuzzer", |
| "sm:valid_packet_reader_fuzzer", |
| "hci:read_acl_data_packet_fuzzer", |
| "hci:read_command_event_packet_fuzzer", |
| ] |
| } |