Skip to content

Commit 6e3a0fc

Browse files
committed
Sync with aosp main
Synchronized to packages/modules/Bluetooth commit b6245f8beee5e87e66659d54136bc9714826585f Changelist: - Set support for APCF Transport Discovery Service filter to false - Use Jacobian Coordinates in Point implementation - Use pow for consistency - Do not report an invalid packet for unsupported LE Apcf Transport Discovert Service command - Send well formatted Apcf command complete event - Update to pdl 0.3.0 - Typo in LE Apcf Transport Discovery Data command handling - Reset APCF scanner in LinkLayerController::Reset() - Set the default value of acl_data_packet_length to 1023 - Encryption Change V2 - Implement the command LE Read Local P-256 Public Key - Add Authenticated Payload Timeout Expired event - Update to Core version 6.0 - Update build.rs to directly use the pdl_compiler library - Add INTEL_BE200 controller preset - Update controller_info.py script
1 parent 5f7ab5f commit 6e3a0fc

File tree

155 files changed

+8352
-9442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+8352
-9442
lines changed

.github/workflows/avatar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python -m pip install pandora-avatar
3838
- name: Rootcanal
3939
run: |
40-
cargo install pdl-compiler --version 0.2.2
40+
cargo install pdl-compiler --version 0.3.2
4141
bazel build :rootcanal
4242
- name: Test
4343
run: |

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Install dependencies
3030
run: |
31-
cargo install pdl-compiler --version 0.2.2
31+
cargo install pdl-compiler --version 0.3.2
3232
3333
- name: Build
3434
run: |
@@ -65,7 +65,7 @@ jobs:
6565

6666
- name: Install dependencies
6767
run: |
68-
cargo install pdl-compiler --version 0.2.2
68+
cargo install pdl-compiler --version 0.3.2
6969
python3 -m pip install hatch
7070
7171
- name: Set VERSION

BUILD

Lines changed: 61 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ cc_proto_library(
3434

3535
genrule(
3636
name = "lmp_packets_rs",
37-
cmd = "pdlc --output-format rust $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)",
37+
cmd = "pdlc --output-format rust_legacy $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)",
3838
outs = ["lmp_packets.rs"],
3939
srcs = ["rust/lmp_packets.pdl"],
4040
)
4141

4242
genrule(
4343
name = "llcp_packets_rs",
44-
cmd = "pdlc --output-format rust $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)",
44+
cmd = "pdlc --output-format rust_legacy $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)",
4545
outs = ["llcp_packets.rs"],
4646
srcs = ["rust/llcp_packets.pdl"],
4747
)
4848

4949
genrule(
5050
name = "hci_packets_rs",
51-
cmd = "pdlc --output-format rust $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)",
51+
cmd = "pdlc --output-format rust_legacy $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)",
5252
outs = ["hci_packets.rs"],
5353
srcs = ["//packets:hci_packets.pdl"],
5454
visibility = ["//visibility:public"],
@@ -103,10 +103,10 @@ rust_static_library(
103103
],
104104
)
105105

106-
cc_library(
107-
name = "rootcanal_lib",
106+
cc_binary(
107+
name = "librootcanal_ffi.so",
108+
linkopts = ["-shared"],
108109
srcs = [
109-
"desktop/test_environment.cc",
110110
"include/crypto/crypto.h",
111111
"include/hci/address.h",
112112
"include/hci/address_with_type.h",
@@ -116,7 +116,6 @@ cc_library(
116116
"include/phy.h",
117117
"lib/crypto/crypto.cc",
118118
"lib/hci/address.cc",
119-
"lib/hci/pcap_filter.cc",
120119
"model/controller/acl_connection.cc",
121120
"model/controller/acl_connection.h",
122121
"model/controller/acl_connection_handler.cc",
@@ -134,58 +133,12 @@ cc_library(
134133
"model/controller/vendor_commands/csr.h",
135134
"model/controller/vendor_commands/le_apcf.cc",
136135
"model/controller/vendor_commands/le_apcf.h",
137-
"model/devices/baseband_sniffer.cc",
138-
"model/devices/baseband_sniffer.h",
139-
"model/devices/beacon.cc",
140-
"model/devices/beacon.h",
141-
"model/devices/beacon_swarm.cc",
142-
"model/devices/beacon_swarm.h",
136+
"model/controller/ffi.cc",
137+
"model/controller/ffi.h",
143138
"model/devices/device.cc",
144139
"model/devices/device.h",
145-
"model/devices/hci_device.cc",
146-
"model/devices/hci_device.h",
147-
"model/devices/link_layer_socket_device.cc",
148-
"model/devices/link_layer_socket_device.h",
149-
"model/devices/sniffer.cc",
150-
"model/devices/sniffer.h",
151-
"model/hci/h4.h",
152-
"model/hci/h4_data_channel_packetizer.cc",
153-
"model/hci/h4_data_channel_packetizer.h",
154-
"model/hci/h4_parser.cc",
155-
"model/hci/h4_parser.h",
156-
"model/hci/hci_sniffer.cc",
157-
"model/hci/hci_sniffer.h",
158-
"model/hci/hci_socket_transport.cc",
159-
"model/hci/hci_socket_transport.h",
160-
"model/hci/hci_transport.h",
161-
"model/setup/async_manager.cc",
162-
"model/setup/device_boutique.cc",
163-
"model/setup/device_boutique.h",
164-
"model/setup/phy_device.cc",
165-
"model/setup/phy_device.h",
166-
"model/setup/phy_layer.cc",
167-
"model/setup/phy_layer.h",
168-
"model/setup/test_channel_transport.cc",
169-
"model/setup/test_channel_transport.h",
170-
"model/setup/test_command_handler.cc",
171-
"model/setup/test_command_handler.h",
172-
"model/setup/test_model.cc",
173-
"model/setup/test_model.h",
174-
"net/async_data_channel.h",
175-
"net/async_data_channel_connector.h",
176-
"net/async_data_channel_server.h",
177-
"net/posix/posix_async_socket.cc",
178-
"net/posix/posix_async_socket.h",
179-
"net/posix/posix_async_socket_connector.cc",
180-
"net/posix/posix_async_socket_server.cc",
181140
"rust/include/rootcanal_rs.h",
182141
],
183-
hdrs = [
184-
"desktop/test_environment.h",
185-
"model/setup/async_manager.h",
186-
"net/posix/posix_async_socket_connector.h",
187-
"net/posix/posix_async_socket_server.h",
188-
],
189142
copts = [
190143
"-std=c++17",
191144
"-Wno-c99-designator",
@@ -210,16 +163,18 @@ cc_library(
210163
":rootcanal_log",
211164
":rootcanal_rs",
212165
"//packets:generated",
166+
"@pdl//:packet_runtime",
213167
"@fmtlib",
214168
"@openssl//:crypto",
215-
"@pdl//:packet_runtime",
216169
],
217170
)
218171

219172
cc_binary(
220-
name = "librootcanal_ffi.so",
221-
linkopts = ["-shared"],
173+
name = "rootcanal",
222174
srcs = [
175+
"desktop/root_canal_main.cc",
176+
"desktop/test_environment.cc",
177+
"desktop/test_environment.h",
223178
"include/crypto/crypto.h",
224179
"include/hci/address.h",
225180
"include/hci/address_with_type.h",
@@ -229,6 +184,7 @@ cc_binary(
229184
"include/phy.h",
230185
"lib/crypto/crypto.cc",
231186
"lib/hci/address.cc",
187+
"lib/hci/pcap_filter.cc",
232188
"model/controller/acl_connection.cc",
233189
"model/controller/acl_connection.h",
234190
"model/controller/acl_connection_handler.cc",
@@ -246,10 +202,53 @@ cc_binary(
246202
"model/controller/vendor_commands/csr.h",
247203
"model/controller/vendor_commands/le_apcf.cc",
248204
"model/controller/vendor_commands/le_apcf.h",
249-
"model/controller/ffi.cc",
250-
"model/controller/ffi.h",
205+
"model/devices/baseband_sniffer.cc",
206+
"model/devices/baseband_sniffer.h",
207+
"model/devices/beacon.cc",
208+
"model/devices/beacon.h",
209+
"model/devices/beacon_swarm.cc",
210+
"model/devices/beacon_swarm.h",
251211
"model/devices/device.cc",
252212
"model/devices/device.h",
213+
"model/devices/hci_device.cc",
214+
"model/devices/hci_device.h",
215+
"model/devices/link_layer_socket_device.cc",
216+
"model/devices/link_layer_socket_device.h",
217+
"model/devices/sniffer.cc",
218+
"model/devices/sniffer.h",
219+
"model/hci/h4.h",
220+
"model/hci/h4_data_channel_packetizer.cc",
221+
"model/hci/h4_data_channel_packetizer.h",
222+
"model/hci/h4_parser.cc",
223+
"model/hci/h4_parser.h",
224+
"model/hci/hci_sniffer.cc",
225+
"model/hci/hci_sniffer.h",
226+
"model/hci/hci_socket_transport.cc",
227+
"model/hci/hci_socket_transport.h",
228+
"model/hci/hci_transport.h",
229+
"model/setup/async_manager.cc",
230+
"model/setup/async_manager.h",
231+
"model/setup/device_boutique.cc",
232+
"model/setup/device_boutique.h",
233+
"model/setup/phy_device.cc",
234+
"model/setup/phy_device.h",
235+
"model/setup/phy_layer.cc",
236+
"model/setup/phy_layer.h",
237+
"model/setup/test_channel_transport.cc",
238+
"model/setup/test_channel_transport.h",
239+
"model/setup/test_command_handler.cc",
240+
"model/setup/test_command_handler.h",
241+
"model/setup/test_model.cc",
242+
"model/setup/test_model.h",
243+
"net/async_data_channel.h",
244+
"net/async_data_channel_connector.h",
245+
"net/async_data_channel_server.h",
246+
"net/posix/posix_async_socket.cc",
247+
"net/posix/posix_async_socket.h",
248+
"net/posix/posix_async_socket_connector.cc",
249+
"net/posix/posix_async_socket_connector.h",
250+
"net/posix/posix_async_socket_server.cc",
251+
"net/posix/posix_async_socket_server.h",
253252
"rust/include/rootcanal_rs.h",
254253
],
255254
copts = [
@@ -276,27 +275,12 @@ cc_binary(
276275
":rootcanal_log",
277276
":rootcanal_rs",
278277
"//packets:generated",
279-
"@pdl//:packet_runtime",
278+
"@gflags",
280279
"@fmtlib",
281280
"@openssl//:crypto",
281+
"@pdl//:packet_runtime",
282282
],
283-
)
284-
285-
cc_binary(
286-
name = "rootcanal",
287-
srcs = ["desktop/root_canal_main.cc"],
288-
copts = ["-std=c++17"],
289283
# TODO enable thin_lto
290284
# breaks the device registration
291285
# features = ["-thin_lto"],
292-
visibility = ["//visibility:public"],
293-
deps = [
294-
":rootcanal_lib",
295-
":rootcanal_config",
296-
":rootcanal_log",
297-
":rootcanal_rs",
298-
"@gflags",
299-
"@fmtlib",
300-
"@openssl//:crypto",
301-
],
302286
)

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ crate.spec(package = "num-derive", version = "0.3.3")
3737
crate.spec(package = "num-integer", version = "0.1.45")
3838
crate.spec(package = "num-traits", version = "0.2.14")
3939
crate.spec(package = "paste", version = "1.0.4")
40-
crate.spec(package = "pdl-runtime", version = "0.2.2")
40+
crate.spec(package = "pdl-runtime", version = "0.3.2")
4141
crate.spec(package = "pin-utils", version = "0.1.0")
4242
crate.spec(package = "rand", version = "0.8.3")
4343
crate.spec(package = "thiserror", version = "1.0.23")

desktop/root_canal_main.cc

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ using namespace rootcanal;
4040

4141
DEFINE_string(controller_properties_file, "", "deprecated");
4242
DEFINE_string(configuration, "", "controller configuration (see config.proto)");
43-
DEFINE_string(configuration_file, "",
44-
"controller configuration file path (see config.proto)");
43+
DEFINE_string(configuration_file, "", "controller configuration file path (see config.proto)");
4544
DEFINE_string(default_commands_file, "", "deprecated");
4645
DEFINE_bool(enable_log_color, false, "enable log colors");
4746
DEFINE_bool(enable_hci_sniffer, false, "enable hci sniffer");
4847
DEFINE_bool(enable_baseband_sniffer, false, "enable baseband sniffer");
4948
DEFINE_bool(enable_pcap_filter, false, "enable PCAP filter");
50-
DEFINE_bool(disable_address_reuse, false,
51-
"prevent rootcanal from reusing device addresses");
49+
DEFINE_bool(disable_address_reuse, false, "prevent rootcanal from reusing device addresses");
5250
DEFINE_uint32(test_port, 6401, "test tcp port");
5351
DEFINE_uint32(hci_port, 6402, "hci server tcp port");
5452
DEFINE_uint32(link_port, 6403, "link server tcp port");
@@ -95,17 +93,14 @@ int main(int argc, char** argv) {
9593
}
9694

9795
TestEnvironment root_canal(
98-
[](AsyncManager* am, int port) {
99-
return std::make_shared<PosixAsyncSocketServer>(port, am);
100-
},
101-
[](AsyncManager* am) {
102-
return std::make_shared<PosixAsyncSocketConnector>(am);
103-
},
104-
static_cast<int>(FLAGS_test_port), static_cast<int>(FLAGS_hci_port),
105-
static_cast<int>(FLAGS_link_port), static_cast<int>(FLAGS_link_ble_port),
106-
configuration_str, FLAGS_enable_hci_sniffer,
107-
FLAGS_enable_baseband_sniffer, FLAGS_enable_pcap_filter,
108-
FLAGS_disable_address_reuse);
96+
[](AsyncManager* am, int port) {
97+
return std::make_shared<PosixAsyncSocketServer>(port, am);
98+
},
99+
[](AsyncManager* am) { return std::make_shared<PosixAsyncSocketConnector>(am); },
100+
static_cast<int>(FLAGS_test_port), static_cast<int>(FLAGS_hci_port),
101+
static_cast<int>(FLAGS_link_port), static_cast<int>(FLAGS_link_ble_port),
102+
configuration_str, FLAGS_enable_hci_sniffer, FLAGS_enable_baseband_sniffer,
103+
FLAGS_enable_pcap_filter, FLAGS_disable_address_reuse);
109104

110105
std::promise<void> barrier;
111106
std::future<void> barrier_future = barrier.get_future();

0 commit comments

Comments
 (0)