Skip to content

Commit 829a733

Browse files
BenjaminLawsongnoliyil
authored andcommitted
[bt][controllers] Create FIDL and Banjo Controllers
Create bt-host/controllers directory for implementations of pw::bluetooth::Controller. Create FidlController, an implementation of Controller that uses the BtHci FIDL API. Create BanjoController, an implementation of Controller that uses the BtHci and BtVendor Banjo APIs. FidlController and BanjoController are intended to replace HciWrapper and DeviceWrapper in the future. Bug: 112750 Test: bt-host-controllers-tests Change-Id: I281f70486209d22a6db45917c2c3992870468e01 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/739651 Reviewed-by: Faraaz Sareshwala <fsareshwala@google.com> Commit-Queue: Ben Lawson <benlawson@google.com> Reviewed-by: Marie Janssen <jamuraa@google.com>
1 parent 26405e5 commit 829a733

File tree

10 files changed

+1858
-0
lines changed

10 files changed

+1858
-0
lines changed

src/connectivity/bluetooth/core/bt-host/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ group("stack") {
7575
public_deps = [
7676
"att",
7777
"common",
78+
"controllers",
7879
"gap",
7980
"gatt",
8081
"hci",
@@ -140,6 +141,7 @@ group("tests") {
140141
":fuzzers",
141142
"att:bt-host-att-tests",
142143
"common:bt-host-common-tests",
144+
"controllers:bt-host-controllers-tests",
143145
"fidl:bt-host-fidl-tests",
144146
"gap:bt-host-gap-tests",
145147
"gatt:bt-host-gatt-tests",
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Copyright 2022 The Fuchsia Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("//src/connectivity/bluetooth/core/bt-host/build/bt_gtest_package.gni")
6+
7+
group("controllers") {
8+
public_deps = [
9+
":banjo_controller",
10+
":fidl_controller",
11+
]
12+
}
13+
14+
source_set("helpers") {
15+
visibility = [ ":*" ]
16+
17+
sources = [
18+
"helpers.cc",
19+
"helpers.h",
20+
]
21+
22+
public_deps = [
23+
"//third_party/pigweed:pw_bluetooth",
24+
"//zircon/system/ulib/zx",
25+
]
26+
}
27+
28+
source_set("banjo_controller") {
29+
sources = [
30+
"banjo_controller.cc",
31+
"banjo_controller.h",
32+
]
33+
34+
deps = [
35+
":helpers",
36+
"//src/connectivity/bluetooth/core/bt-host/common",
37+
"//src/connectivity/bluetooth/core/bt-host/transport",
38+
"//src/lib/ddk",
39+
"//zircon/system/ulib/async:async-cpp",
40+
"//zircon/system/ulib/fbl",
41+
"//zircon/system/ulib/zx",
42+
]
43+
44+
public_deps = [
45+
"//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp",
46+
"//sdk/banjo/fuchsia.hardware.bt.vendor:fuchsia.hardware.bt.vendor_banjo_cpp",
47+
"//third_party/pigweed:pw_bluetooth",
48+
"//zircon/system/ulib/async",
49+
]
50+
}
51+
52+
source_set("fidl_controller") {
53+
sources = [
54+
"fidl_controller.cc",
55+
"fidl_controller.h",
56+
]
57+
58+
deps = [
59+
":helpers",
60+
"//src/connectivity/bluetooth/core/bt-host/common",
61+
"//src/connectivity/bluetooth/core/bt-host/transport",
62+
"//src/lib/ddk",
63+
"//zircon/system/ulib/async:async-cpp",
64+
"//zircon/system/ulib/zx",
65+
]
66+
67+
public_deps = [
68+
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_hlcpp",
69+
"//third_party/pigweed:pw_bluetooth",
70+
"//zircon/system/ulib/async",
71+
]
72+
}
73+
74+
source_set("tests") {
75+
testonly = true
76+
77+
sources = [
78+
"banjo_controller_unittest.cc",
79+
"fidl_controller_unittest.cc",
80+
]
81+
82+
deps = [
83+
":controllers",
84+
"//src/connectivity/bluetooth/core/bt-host/testing",
85+
"//src/devices/testing/mock-ddk",
86+
"//src/lib/ddktl",
87+
"//src/lib/testing/loop_fixture",
88+
"//third_party/googletest:gmock",
89+
"//third_party/googletest:gtest",
90+
]
91+
}
92+
93+
bt_gtest_package("bt-host-controllers-tests") {
94+
deps = [ ":tests" ]
95+
}

0 commit comments

Comments
 (0)